diff classes/ReAction.lua @ 8:c05fd3e18b4f

Version 0.31
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:33:59 +0000
parents f920db5fc6b1
children f3a7bfebc283
line wrap: on
line diff
--- a/classes/ReAction.lua	Tue Mar 20 21:25:29 2007 +0000
+++ b/classes/ReAction.lua	Tue Mar 20 21:33:59 2007 +0000
@@ -76,7 +76,7 @@
   TempShow           = "function", -- TempShow(visible), calls to this can be nested so keep track.
   GetActionFrame     = "function", -- f = GetActionFrame(), return a frame derived from SecureActionButtonTemplate (note: this is inherited unimplemented from ReBar.IButton)
   GetBaseButtonSize  = "function", -- sz = GetBaseButtonSize(), return size in pixels of the nominal button (square)
-  DisplayID          = "function", -- DisplayID(id), show the action ID (or equivalent). Pass nil to hide.
+  DisplayID          = "function", -- DisplayID(show), true/false to show/hide the action ID (or equivalent)
   DisplayHotkey      = "function", -- DisplayHotkey(keyText), set the hotkey display text
 }
 
@@ -146,8 +146,8 @@
 
   if id == nil then return nil end  -- all action ids are in use
 
-  -- if a hint is given, see if that one is free instead
-  if hint and (t[hint] == nil or t[hint].inUse == false) then
+  -- if a hint is given, see if that one is free instead, as long as it's < maxIDs
+  if hint and hint > 0 and hint <= maxIDs and (t[hint] == nil or t[hint].inUse == false) then
     id = hint
   end
 
@@ -214,7 +214,7 @@
   for _, t in pairs(self.buttonTypes) do
     if t.subtype._idTbl then
       for _, tbl in pairs(t.subtype._idTbl) do
-        if tbl.button then tbl.button:DisplayID(tbl.button:GetID()) end
+        if tbl.button then tbl.button:DisplayID(true) end
       end
     end
   end
@@ -225,7 +225,7 @@
   for _, t in pairs(self.buttonTypes) do
     if t.subtype._idTbl then
       for _, tbl in pairs(t.subtype._idTbl) do
-        if tbl.button then tbl.button:DisplayID(nil) end
+        if tbl.button then tbl.button:DisplayID(false) end
       end
     end
   end
@@ -248,10 +248,12 @@
 
 function ReAction.prototype:BarUnlocked()
   self:TempShow(true)
+  self:DisplayID(true)
 end
 
 function ReAction.prototype:BarLocked()
   self:TempShow(false)
+  self:DisplayID(false)
 end
 
 function ReAction.prototype:PlaceButton(parent, point, x, y, sz)