From 9efe3269eba076b432b4e82f333ae988e06494ac Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Wed, 12 Dec 2007 15:36:10 +0000 Subject: [PATCH] implement (Show|Hide)Grid --- Button.lua | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Button.lua b/Button.lua index baca0e3..3348207 100644 --- a/Button.lua +++ b/Button.lua @@ -147,6 +147,18 @@ function Button:Update() else self:UnregisterActionEvents() + if ( self.showgrid == 0 and not self.parent.config.ShowGrid ) then + self.normalTexture:Hide() + if self.overlay then + self.overlay:Hide() + end + else + self.normalTexture:Show() + if self.overlay then + self.overlay:Show() + end + end + self.cooldown:Hide() self:HideButton() @@ -295,11 +307,23 @@ function Button:HideButton() end function Button:ShowGrid() - + self.showgrid = self.showgrid+1 + self.normalTexture:Show() + + if self.overlay then + self.overlay:Show() + end end function Button:HideGrid() - + local button = self.frame + self.showgrid = self.showgrid-1 + if ( self.showgrid == 0 and not HasAction(self.action) and not self.parent.config.ShowGrid ) then + self.normalTexture:Hide() + if self.overlay then + self.overlay:Hide() + end + end end function Button:RegisterButtonEvents()