Nenue@80: -- Veneer Nenue@84: -- WorldState.lua Nenue@80: -- Created: 10/7/2016 10:55 PM Nenue@80: -- %file-revision% Nenue@80: -- Nenue@80: Nenue@97: local print = DEVIAN_WORKSPACE and function(...) print('VnWorldState', ...) end or nop Nenue@87: local WorldStateBlockMixin = {} Nenue@87: VeneerOrderHallMixin = { Nenue@87: anchorPoint = 'TOP', Nenue@90: anchorFrom = 'TOP', Nenue@90: anchorX = 0, Nenue@90: anchorY = 0, Nenue@90: addonTrigger = 'Blizzard_OrderHallUI', Nenue@90: addonFrame = 'OrderHallCommandBar', Nenue@87: } Nenue@97: Nenue@93: VeneerWorldStateHeadsUpMixin = { Nenue@93: } Nenue@93: Nenue@87: VeneerWorldStateCurrencyMixin = { Nenue@87: } Nenue@84: VeneerWorldStateProgressMixin = { Nenue@96: keepOpen = true, Nenue@84: } Nenue@81: VeneerWorldStateMixin = { Nenue@82: maxHeight = 0, Nenue@87: detectedFrames = {}, Nenue@87: anchorPoint = 'TOP', Nenue@81: } Nenue@80: Nenue@87: function VeneerWorldStateMixin:Reset() Nenue@87: for i, frame in ipairs(self.modules) do Nenue@87: if frame.Reset then Nenue@87: frame:Reset() Nenue@87: end Nenue@87: end Nenue@87: self:Update() Nenue@87: end Nenue@87: Nenue@80: function VeneerWorldStateMixin:Setup() Nenue@80: --DEFAULT_CHAT_FRAME:AddMessage('Loaded') Nenue@84: print('|cFFFFFF00'..self:GetName()..'|r:Setup()') Nenue@81: Nenue@81: self.modules = self.modules or {self:GetChildren()} Nenue@81: for i, frame in ipairs(self.modules) do Nenue@84: print('--'.. frame:GetName()..' exists') Nenue@81: if frame.Setup then Nenue@84: print('--'.. frame:GetName()..':Setup()') Nenue@81: frame:Setup() Nenue@81: end Nenue@82: Nenue@87: Nenue@87: for k,v in pairs(WorldStateBlockMixin) do Nenue@87: if not frame[k] then Nenue@87: frame[k] = v Nenue@87: if k:match('^On') then Nenue@87: frame:SetScript(k, v) Nenue@87: end Nenue@82: end Nenue@87: end Nenue@82: Nenue@81: end Nenue@84: self:UnregisterEvent('PLAYER_LOGIN') Nenue@80: end Nenue@80: Nenue@82: function VeneerWorldStateMixin:SetOrderHallUIMods() Nenue@87: print('|cFFFF4400remove me', debugstack()) Nenue@80: end Nenue@84: Nenue@84: Nenue@84: function VeneerWorldStateMixin:OnLoad () Nenue@87: self.modules = {self:GetChildren()} Nenue@84: print('|cFFFFFF00'..self:GetName()..'|r!') Nenue@84: self:RegisterEvent('PLAYER_ENTERING_WORLD') Nenue@84: self:RegisterEvent('PLAYER_REGEN_ENABLED') Nenue@84: self:RegisterEvent('PLAYER_REGEN_DISABLED') Nick@108: Veneer:AddHandler(self, self.anchorPoint, 2) Nenue@87: SLASH_VENEERWORLDSTATE1 = "/vws" Nenue@87: SLASH_VENEERWORLDSTATE2 = "/worldstate" Nenue@87: SlashCmdList.VENEERWORLDSTATE = function() Nenue@87: self:Reset() Nenue@87: end Nenue@84: end Nenue@84: Nenue@80: function VeneerWorldStateMixin:OnEvent(event, arg) Nenue@80: print(event, arg) Nenue@90: if event == 'PLAYER_ENTERING_WORLD' then Nenue@80: self:Update() Nenue@81: elseif event == 'PLAYER_REGEN_ENABLED' then Nick@108: self:Update(true) Nenue@81: elseif event == 'PLAYER_REGEN_DISABLED' then Nick@108: self:Update(true) Nenue@80: end Nenue@80: end Nenue@80: Nenue@88: function VeneerWorldStateMixin:Update(isBatchUpdate) Nenue@80: print('|cFFFFFF00All:Update()|r') Nick@111: local canShow = false Nenue@88: for index, frame in ipairs(self.modules) do Nenue@82: if frame.Update then Nenue@88: print(' '..index..' |cFFFF00FFUpdate:|r '.. frame:GetName()) Nenue@88: frame:Update(isBatchUpdate) Nenue@88: print(' ', frame:IsVisible(), frame:IsShown()) Nick@111: if frame:IsShown() then Nick@111: canShow = true Nick@111: end Nick@111: Nenue@82: end Nenue@82: end Nick@111: self:SetShown(canShow) Nenue@82: end Nenue@82: Nick@108: function VeneerWorldStateMixin:OnShow() Nick@108: print('OnShow()', debugstack()) Nick@108: end Nick@108: Nenue@87: function VeneerWorldStateMixin:Reanchor(isUpdate) Nenue@88: print(' |cFF0088FF'..self:GetName()..':Reanchor()|r', #self.modules, 'blocks') Nenue@81: self.maxHeight = 0 Nenue@89: local lastFrame Nenue@81: for i, frame in ipairs(self.modules) do Nick@108: print(' '..frame:GetName()..':',frame:IsShown(), frame:GetHeight()) Nick@108: if frame:IsShown() then Nenue@89: if lastFrame then Nenue@89: frame:SetPoint('TOP', lastFrame, 'BOTTOM') Nenue@89: else Nenue@89: frame:SetPoint('TOP', self, 'TOP') Nenue@89: end Nenue@89: Nenue@89: self.maxHeight = self.maxHeight + frame:GetHeight() Nenue@89: lastFrame = frame Nenue@80: end Nenue@80: end Nick@108: if (self.maxHeight == 0) or InCombatLockdown() then Nick@108: print (' hiding; combat =', InCombatLockdown()) Nick@108: self:SetShown(false) Nenue@82: else Nenue@87: print (' height update:', self.maxHeight) Nenue@82: self:SetHeight(self.maxHeight) Nick@108: self:SetShown(true) Nenue@82: end Nenue@82: Nenue@87: if not isUpdate then Nenue@87: Veneer:InternalReanchor(self, print) Nenue@87: end Nenue@93: Nenue@93: WorldStateAlwaysUpFrame:ClearAllPoints() Nenue@93: WorldStateAlwaysUpFrame:SetPoint('TOP', self, 'BOTTOM', 0, 0) Nenue@80: end Nenue@80: Nenue@80: Nenue@80: Nenue@84: function VeneerWorldStateMixin:OnMouseDown() Nenue@80: end Nenue@80: Nenue@87: function VeneerOrderHallMixin:Setup() Nenue@87: print('|cFFFFFF00'..self:GetName()..':Setup()') Nenue@88: self:SetParent(OrderHallCommandBar) Nenue@88: self:RegisterEvent("ZONE_CHANGED"); Nenue@88: self:RegisterEvent("ZONE_CHANGED_INDOORS"); Nenue@88: self:RegisterEvent("ZONE_CHANGED_NEW_AREA"); Nenue@88: self:SetShown(true) Nenue@88: end Nenue@88: Nenue@90: function VeneerOrderHallMixin:OnLoad() Nick@108: Veneer:AddHandler(self, 'TOP', 1) Nenue@90: end Nenue@90: Nenue@88: function VeneerOrderHallMixin:OnEvent(event, ...) Nenue@88: Nenue@88: print('|cFF00AAFF'..self:GetName()..'|r:'.. event, ...) Nenue@88: self:Update() Nenue@88: end Nenue@88: Nenue@88: function VeneerOrderHallMixin:OnShow() Nenue@90: if OrderHallCommandBar then Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:OnShow()', OrderHallCommandBar:IsShown(), self:IsShown()) Nenue@90: self:Update() Nenue@90: end Nenue@99: Veneer:DynamicReanchor() Nenue@88: end Nenue@88: Nenue@88: function VeneerOrderHallMixin:OnHide() Nenue@90: if OrderHallCommandBar then Nenue@90: print('|cFF00AAFF'..self:GetName()..'|r:OnHide()', OrderHallCommandBar:IsShown(), self:IsShown()) Nenue@90: end Nenue@88: Veneer:Reanchor() Nenue@87: end Nenue@87: Nenue@87: function VeneerOrderHallMixin:Update() Nenue@87: Nenue@87: if not OrderHallCommandBar then Nenue@87: print('|cFFFF4400'..self:GetName()..' updater called without target') Nenue@87: return Nenue@87: end Nenue@87: Nenue@87: OrderHallCommandBar:ClearAllPoints() Nick@108: OrderHallCommandBar:SetAllPoints(self) Nick@112: Nenue@87: OrderHallCommandBar.Background:SetColorTexture(0,0,0,0.5) Nenue@87: OrderHallCommandBar.WorldMapButton:Hide() Nenue@87: OrderHallCommandBar:EnableMouse(false) Nick@112: self:SetSize(700, 24) Nick@112: Nenue@87: Nenue@88: print('|cFF00AAFF'..self:GetName()..'|r:Update()', OrderHallCommandBar:IsVisible(), self:IsShown()) Nenue@88: print(debugstack(6)) Nenue@98: Veneer:DynamicReanchor() Nenue@87: end Nenue@87: Nenue@80: function VeneerWorldStateCurrencyMixin:OnLoad () Nenue@84: self:RegisterEvent("PLAYER_ENTERING_WORLD"); Nenue@84: self:RegisterEvent("ZONE_CHANGED"); Nenue@84: self:RegisterEvent("ZONE_CHANGED_INDOORS"); Nenue@84: self:RegisterEvent("ZONE_CHANGED_NEW_AREA"); Nenue@80: self:RegisterEvent('CURRENCY_DISPLAY_UPDATE') Nenue@80: self:RegisterEvent('CHAT_MSG_CURRENCY') Nenue@80: end Nenue@80: Nenue@80: function VeneerWorldStateCurrencyMixin:OnEvent (event, arg) Nenue@80: self:Update() Nenue@80: end Nenue@93: local zoneCurrency = { Nenue@93: ['Suramar'] = 1155, Nenue@93: ["Sashj'tar Ruins"] = 1155, Nenue@93: ["Faronaar Ruins"] = 1155 Nenue@93: } Nenue@93: local zoneBountyInfo = { Nenue@93: ['Suramar'] = 1859, Nenue@93: ["Sashj'tar Ruins"] = 1859, Nenue@93: ["Faronaar Ruins"] = 1859, Nenue@80: Nenue@93: ['Azsuna'] = 1900, Nenue@93: } Nenue@93: local globalBountyInfo = { Nenue@93: } Nenue@88: function VeneerWorldStateCurrencyMixin:Update(isBatchUpdate) Nenue@93: local zoneText = GetRealZoneText() Nick@111: local canShow = false Nenue@93: if zoneText then Nenue@93: local currency = zoneCurrency[zoneText] Nenue@93: if currency then Nenue@93: local name, earned, texture, earnedThisWeek, weeklyMax, totalMax = GetCurrencyInfo(zoneCurrency[zoneText]) Nenue@93: self.Icon:SetTexture(texture) Nenue@93: self.Label:SetFormattedText("%d / %d", earned, totalMax) Nenue@93: self:SetWidth(self.Icon:GetWidth() + self.Label:GetStringWidth() + 6) Nick@111: canShow = true Nenue@93: end Nenue@80: else Nenue@80: end Nick@111: self:SetShown(canShow) Nick@111: VeneerWorldState:Reanchor(true) Nenue@81: end Nenue@81: Nenue@82: function VeneerWorldStateProgressMixin:OnUpdate(sinceLast) Nenue@87: self.timeLived = (self.timeLived or 0) + sinceLast Nenue@84: if self.keepOpen then Nenue@84: return Nenue@84: end Nenue@93: if self.timeLived >= 3 and not self.TimedFadeOut:IsPlaying() then Nenue@93: self.TimedFadeOut:Play() Nenue@82: end Nenue@82: end Nenue@82: Nenue@81: function VeneerWorldStateProgressMixin:OnLoad() Nenue@82: self:RegisterEvent('PLAYER_EQUIPMENT_CHANGED') Nenue@81: Nenue@82: self:RegisterEvent("PLAYER_XP_UPDATE"); Nenue@82: self:RegisterEvent("UPDATE_EXHAUSTION"); Nenue@82: self:RegisterEvent("PLAYER_LEVEL_UP"); Nenue@82: self:RegisterEvent("PLAYER_UPDATE_RESTING"); Nenue@82: Nenue@82: self:RegisterEvent("ARTIFACT_UPDATE"); Nenue@82: self:RegisterEvent("ARTIFACT_XP_UPDATE"); Nenue@82: self:RegisterEvent("ARTIFACT_CLOSE"); Nenue@82: self:RegisterEvent("ARTIFACT_MAX_RANKS_UPDATE"); Nenue@82: Nenue@82: self.progressPercent = 0 Nenue@82: self.progressAmount = 0 Nenue@82: self.progressMax = 1 Nenue@82: self.progressOverflow = 0 Nenue@84: Nenue@81: end Nenue@81: Nenue@81: function VeneerWorldStateProgressMixin:Setup() Nenue@81: self:UpdateXPGain() Nenue@82: if self.canGainXP then Nenue@81: self.mode = 'xp' Nenue@81: else Nenue@81: self.mode = 'artifact' Nenue@81: end Nenue@81: print('setup mode:', self.mode) Nenue@81: end Nenue@81: Nenue@82: function VeneerWorldStateProgressMixin:OnEvent(event, ...) Nenue@82: local lastMode = self.mode Nenue@82: if event == 'PLAYER_LEVEL_UP' or event == 'ENABLE_XP_GAIN' or event == 'DISABLE_XP_GAIN' then Nenue@81: self:UpdateXPGain() Nenue@81: elseif event == 'ARTIFACT_XP_UPDATE' or event == 'ARTIFACT_UPDATE' then Nenue@81: self.mode = 'artifact' Nenue@82: Nenue@82: elseif event == 'PLAYER_EQUIPMENT_CHANGED' then Nenue@82: local slot, hasEquip = ... Nenue@82: if slot == 16 then Nenue@82: self.mode = 'artifact' Nenue@82: lastMode = nil Nenue@82: end Nenue@82: elseif event == 'PLAYER_XP_UPDATE' or event == 'PLAYER_LEVEL_UP' then Nenue@82: print('forcing to XP mode') Nenue@81: self.mode = 'xp' Nenue@81: end Nenue@82: self.modeChanged = (lastMode ~= self.mode) Nenue@82: if self.modeChanged and self:IsVisible() then Nenue@82: print('|cFF88FF00'..self:GetName()..'.TransitionFadeOut:Play()', event, ...) Nenue@84: self:AnimateMode() Nenue@82: else Nenue@82: print('|cFFFFFF00'..self:GetName()..':Update()', event, ...) Nenue@82: self:Update() Nenue@82: end Nenue@81: end Nenue@81: function VeneerWorldStateProgressMixin:UpdateXPGain() Nenue@82: self.canGainXP = (UnitLevel('player') < GetMaxPlayerLevel()) and (not IsXPUserDisabled()) Nenue@82: if not self.canGainXP then Nenue@81: self.ProgressBar:SetColorTexture(0.75,0.75,0.75) Nenue@81: end Nenue@81: end Nenue@81: Nenue@81: local GetEquippedArtifactInfo = _G.C_ArtifactUI.GetEquippedArtifactInfo Nenue@81: local GetCostForPointAtRank = _G.C_ArtifactUI.GetCostForPointAtRank Nenue@87: Nenue@87: Nenue@89: local progressHandlers = { Nenue@89: xp = function(self) Nenue@89: local hasNewInfo, showChange = false, false Nenue@81: local xp = UnitXP('player') Nenue@81: local xpMax = UnitXPMax('player') Nenue@81: local bonusXP = GetXPExhaustion() Nenue@81: if xp then Nenue@81: self.progressPercent = xp / xpMax Nenue@81: end Nenue@84: self.progressText = '|cFFFFCC00' .. UnitLevel('player') .. '|r ' .. xp .. '/' .. xpMax Nenue@82: if bonusXP then Nenue@89: self.progressOverflow = min(1,(bonusXP / xpMax)) Nenue@89: self.OverflowBar:SetColorTexture(0.5, 0.5,0.5, 0.25) Nenue@89: self.OverflowBar:SetPoint('LEFT', self.ProgressBar, 'LEFT') Nenue@82: else Nenue@89: self.progressOverflow = nil Nenue@82: end Nenue@89: self.ProgressBar:SetColorTexture(0, 0.5,1,1) Nenue@89: self.OverflowAnchor = self.ProgressBar Nenue@89: self.hasNewInfo = (self.progressAmount ~= xp) Nenue@89: showChange = (hasNewInfo and not self.modeChanged) and ((xp - self.progressAmount) / xpMax) Nenue@89: Nenue@82: self.progressAmount = xp Nenue@82: self.progressMax = xpMax Nenue@89: return hasNewInfo, showChange Nenue@89: end, Nenue@89: artifact = function(self) Nenue@89: local hasNewInfo, showChange = false, false Nenue@81: local itemID, altItemID, name, icon, totalXP, pointsSpent = GetEquippedArtifactInfo() Nenue@82: if itemID then Nenue@82: local nextRankCost = GetCostForPointAtRank(pointsSpent) or 0 Nenue@88: print(' API:', itemID, name, 'XP:', totalXP, 'Points:', pointsSpent, 'Next:', nextRankCost) Nenue@82: hasNewInfo = (self.progressAmount ~= totalXP) Nenue@89: showChange = (hasNewInfo and not self.modeChanged) and (((totalXP - self.progressAmount) / nextRankCost)) Nenue@82: Nenue@82: if totalXP > nextRankCost then Nenue@82: self.progressPercent = 1 Nenue@85: else Nenue@82: self.progressPercent = totalXP / nextRankCost Nenue@82: end Nenue@82: Nenue@82: self.progressText = name .. ' ('..pointsSpent .. '): '.. totalXP .. ' / ' .. nextRankCost Nenue@82: Nenue@82: self.ProgressBar:SetColorTexture(1,0.5,0,1) Nenue@82: self.OverflowBar:Hide() Nenue@82: Nenue@89: if totalXP > nextRankCost then Nenue@89: self.progressText = self.progressText .. ' Level Up!' Nenue@89: self.progressOverflow = (totalXP - nextRankCost) / nextRankCost Nenue@89: self.OverflowBar:SetPoint('LEFT', self.ProgressBG, 'LEFT') Nenue@89: self.OverflowAnchor = self.OverflawBar Nenue@89: else Nenue@89: self.progressOverflow = nil Nenue@89: self.OverflowAnchor = self.ProgressBar Nenue@89: end Nenue@89: Nenue@82: self.progressAmount = totalXP Nenue@82: self.progressMax = nextRankCost Nenue@82: else Nenue@89: self.progressOverflow = nil Nenue@82: self.progressAmount = 0 Nenue@82: self.progressMax = 1 Nenue@82: self.progressText = '' Nenue@82: end Nenue@89: return hasNewInfo, showChange Nenue@89: end Nenue@89: } Nenue@89: Nenue@89: function VeneerWorldStateProgressMixin:Update(isBatchUpdate) Nenue@89: Nenue@89: local progressChange = false Nenue@93: print(' current mode:', self.mode, 'vis:', self:IsVisible()) Nenue@89: if (not self.mode) or (not progressHandlers[self.mode]) then Nenue@89: self:HidePanel() Nenue@89: return Nenue@82: end Nenue@82: Nenue@89: local hasNewInfo, showProgress = progressHandlers[self.mode](self) Nenue@89: self:SetSize(600,16) Nenue@89: if hasNewInfo then Nenue@89: self.timeOut = nil Nenue@89: self.timeLived = 0 Nenue@89: end Nenue@82: Nenue@93: Nenue@89: if not self:IsVisible() then Nenue@89: self.TransitionFadeIn:Play() Nenue@89: else Nenue@89: self:ShowPanel() Nenue@89: end Nenue@89: Nenue@89: print(' Percent:', floor(self.progressPercent*100)/100, 'BarLength:', floor(self:GetWidth()* self.progressPercent), 'new:', hasNewInfo, 'shown:', self:IsShown()) Nenue@89: print(' Metrics:', self:IsVisible(), self:GetWidth(), self.ProgressBG:GetWidth()) Nenue@89: if self.progressPercent > 0 then Nenue@89: self.ProgressBar:Show() Nenue@89: self.ProgressBar:SetPoint('TOPRIGHT', self.ProgressBG, 'TOPLEFT', self:GetWidth()* self.progressPercent , 0) Nenue@89: self.Label:SetText(self.progressText) Nenue@89: Nenue@89: self.ProgressSpark:ClearAllPoints() Nenue@89: if self.progressOverflow then Nenue@89: print(' Overflow:', self.progressOverflow) Nenue@89: self.OverflowBar:Show() Nenue@89: self.OverflowBar:SetWidth(self.progressOverflow * self:GetWidth(), 0) Nenue@89: else Nenue@89: self.OverflowBar:Hide() Nenue@81: end Nenue@89: self.ProgressSpark:SetPoint('CENTER', self.OverflowAnchor, 'RIGHT', 0, 0) Nenue@81: Nenue@89: else Nenue@89: self.ProgressBar:Hide() Nenue@89: end Nenue@81: Nenue@89: if self.progressOverflow and (self.progressOverflow >= self.progressPercent) then Nenue@89: self.OverflowBar:SetDrawLayer('ARTWORK', 1) Nenue@89: self.ProgressBar:SetDrawLayer('ARTWORK', 2) Nenue@89: else Nenue@89: self.OverflowBar:SetDrawLayer('ARTWORK', 2) Nenue@89: self.ProgressBar:SetDrawLayer('ARTWORK', 1) Nenue@89: end Nenue@81: Nenue@82: if progressChange then Nenue@89: self:AnimateProgress(progressChange) Nenue@81: end Nenue@81: Nenue@82: self.modeChanged = nil Nenue@84: end Nenue@84: Nenue@89: Nenue@89: function VeneerWorldStateProgressMixin:AnimateProgress(progressChange) Nenue@89: Nenue@89: Nenue@89: local changeAnchor = (self.progressOverflow and self.OverflowBar) or self.ProgressBar Nenue@89: local progressWidth = self:GetWidth() * min(progressChange, changeAnchor:GetWidth()) Nenue@89: Nenue@89: self.ProgressAdded:Show() Nenue@89: self.ProgressAdded:ClearAllPoints() Nenue@89: self.ProgressAdded:SetPoint('TOPRIGHT', changeAnchor, 'TOPRIGHT', 0, 0) Nenue@89: self.ProgressAdded:SetPoint('BOTTOMLEFT', changeAnchor, 'BOTTOMRIGHT', - (progressWidth), 0) Nenue@89: Nenue@89: print(' Render change:', progressWidth, changeAnchor) Nenue@89: self.ProgressFlash.translation:SetOffset(progressWidth, 0) Nenue@89: self.ProgressFlash:Play() Nenue@89: end Nenue@89: Nenue@84: function VeneerWorldStateProgressMixin:OnMouseDown(button) Nenue@84: if button == 'RightButton' then Nenue@84: if self.keepOpen then Nenue@84: self.keepOpen = nil Nenue@87: self.timeLived = 1000 Nenue@84: else Nenue@84: self.keepOpen = true Nenue@93: Nenue@93: self.modeChanged = true Nenue@84: end Nenue@84: print('keepOpen =', self.keepOpen) Nenue@93: self:Update() Nenue@84: else Nenue@89: Nenue@84: if self.mode == 'xp' then Nenue@84: self.mode = 'artifact' Nenue@84: else Nenue@85: if not self.canGainXP then Nenue@85: return Nenue@85: end Nenue@84: self.mode = 'xp' Nenue@84: end Nenue@89: print('|cFFFF4400Change mode:', self.mode) Nenue@89: Nenue@89: Nenue@84: self:AnimateMode() Nenue@84: end Nenue@84: Nenue@84: end Nenue@84: Nenue@84: function VeneerWorldStateProgressMixin:AnimateMode() Nenue@84: Nenue@84: self.TransitionFadeIn:Stop() Nenue@84: print('|cFF88FF00'..self:GetName()..'.TransitionFadeOut:Play()') Nenue@84: self.modeChanged = true Nenue@84: self.TransitionFadeOut:Play() Nenue@87: end Nenue@87: Nenue@87: do Nenue@87: function WorldStateBlockMixin:ShowPanel() Nenue@87: print('|cFF0088FF'..self:GetName()..':ShowPanel()') Nenue@87: self:SetShown(true) Nenue@93: self:SetAlpha(1) Nenue@87: VeneerWorldState:Show() Nenue@87: end Nenue@87: function WorldStateBlockMixin:HidePanel() Nenue@87: print('|cFF0088FF'..self:GetName()..':HidePanel()') Nenue@87: self:SetShown(false) Nenue@87: VeneerWorldState:Reanchor() Nenue@87: end Nenue@87: Nenue@87: function WorldStateBlockMixin:OnSizeChanged () Nenue@87: local h = self:GetHeight() Nenue@87: if h > VeneerWorldState.maxHeight then Nenue@87: VeneerWorldState.maxHeight = h Nenue@87: VeneerWorldState:SetHeight(h) Nenue@87: print('updating max height:', h) Nenue@87: elseif h < VeneerWorldState.maxHeight then Nenue@87: VeneerWorldState:Reanchor() Nenue@87: end Nenue@87: end Nenue@87: function WorldStateBlockMixin:OnHide () Nenue@87: print('|cFF0088FF'..self:GetName()..':OnHide()') Nenue@87: VeneerWorldState:Reanchor() Nenue@87: end Nenue@87: function WorldStateBlockMixin:OnShow () Nenue@87: self.timeLived = 0 Nenue@87: print('|cFF0088FF'..self:GetName()..':OnShow()') Nenue@87: VeneerWorldState:Reanchor() Nenue@87: end Nenue@87: function WorldStateBlockMixin:Setup() Nenue@87: print('|cFF0088FF'..self:GetName()..':Setup()|r -- nop') Nenue@88: self:Update() Nenue@87: end Nenue@87: function WorldStateBlockMixin:Reset() Nenue@87: print('|cFF0088FF'..self:GetName()..':Reset()') Nenue@87: self.keepOpen = true Nenue@87: self:Setup() Nenue@87: end Nenue@93: end Nenue@93: