Skip to content

Commit 2098b45

Browse files
author
justjuangui
committed
GemSelectControl now doesnt show shortcut when disabled
1 parent 571900d commit 2098b45

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

src/Classes/GemSelectControl.lua

+19-18
Original file line numberDiff line numberDiff line change
@@ -492,24 +492,25 @@ function GemSelectClass:Draw(viewPort, noTooltip)
492492
self.tooltip:AddLine(16, "Only show Active gems")
493493
end
494494

495-
-- support shortcut
496-
sx = x + width - 16 - 2
497-
SetDrawColor(colorS,colorS,colorS)
498-
DrawImage(nil, sx, y+2, 16, height-4)
499-
SetDrawColor(0,0,0)
500-
DrawImage(nil, sx+1, y+2, 16-2, height-4)
501-
SetDrawColor(colorS,colorS,colorS)
502-
DrawString(sx + 8, y, "CENTER_X", height - 2, "VAR", "S")
503-
504-
-- active shortcut
505-
sx = x + width - (16*2) - (2*2)
506-
SetDrawColor(colorA,colorA,colorA)
507-
DrawImage(nil, sx, y+2, 16, height-4)
508-
SetDrawColor(0,0,0)
509-
DrawImage(nil, sx+1, y+2, 16-2, height-4)
510-
SetDrawColor(colorA,colorA,colorA)
511-
DrawString(sx + 8, y, "CENTER_X", height - 2, "VAR", "A")
512-
495+
if self:IsEnabled() then
496+
-- support shortcut
497+
sx = x + width - 16 - 2
498+
SetDrawColor(colorS,colorS,colorS)
499+
DrawImage(nil, sx, y+2, 16, height-4)
500+
SetDrawColor(0,0,0)
501+
DrawImage(nil, sx+1, y+2, 16-2, height-4)
502+
SetDrawColor(colorS,colorS,colorS)
503+
DrawString(sx + 8, y, "CENTER_X", height - 2, "VAR", "S")
504+
505+
-- active shortcut
506+
sx = x + width - (16*2) - (2*2)
507+
SetDrawColor(colorA,colorA,colorA)
508+
DrawImage(nil, sx, y+2, 16, height-4)
509+
SetDrawColor(0,0,0)
510+
DrawImage(nil, sx+1, y+2, 16-2, height-4)
511+
SetDrawColor(colorA,colorA,colorA)
512+
DrawString(sx + 8, y, "CENTER_X", height - 2, "VAR", "A")
513+
end
513514

514515
SetDrawLayer(nil, 10)
515516
self.tooltip:Draw(x, y, width, height, viewPort)

0 commit comments

Comments
 (0)