Skip to content

Commit

Permalink
Fix bugged acu button textoverlay labels when opening large map previ…
Browse files Browse the repository at this point in the history
…ew for second time
  • Loading branch information
TheKeyBlue authored and shalkya committed Jun 13, 2021
1 parent 6341bbf commit 6aa8645
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions lua/ui/controls/acubutton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ ACUButton = Class(Group) {

self.indicator = indicator

local textOverlay = Text(self)
textOverlay:SetFont(UIUtil.bodyFont, 20)
LayoutHelpers.AtCenterIn(textOverlay, self)
self.textOverlay = textOverlay

self.OnHide = function(self, hidden)
self.markerOverlay:SetHidden(hidden)
self.marker:SetHidden(hidden)
self.teamIndicator:SetHidden(hidden)
if self.textOverlay then
self.textOverlay:SetHidden(hidden)
end
self.textOverlay:SetHidden(hidden)
return true
end
end,
Expand Down Expand Up @@ -186,20 +189,13 @@ ACUButton = Class(Group) {
end,

draw = function(self, color, text)
local textOverlay = Text(self)
textOverlay:SetFont(UIUtil.bodyFont, 20)
textOverlay:SetColor(color)
textOverlay:SetText(text)
LayoutHelpers.AtCenterIn(textOverlay, self)

self.textOverlay = textOverlay
self.textOverlay:SetColor(color)
self.textOverlay:SetText(text)
end,

RemoveTextOverlay = function(self)
if self.textOverlay then
self.textOverlay:Destroy()
self.textOverlay = nil
end
self.textOverlay:SetColor('00000000')
self.textOverlay:SetText('')
end,

-- Override for events...
Expand Down

0 comments on commit 6aa8645

Please sign in to comment.