diff Buttons.lua @ 10:f3a7bfebc283

Version 0.33
author Flick <flickerstreak@gmail.com>
date Tue, 20 Mar 2007 21:37:38 +0000
parents c05fd3e18b4f
children 2735edcf9ab7
line wrap: on
line diff
--- a/Buttons.lua	Tue Mar 20 21:35:57 2007 +0000
+++ b/Buttons.lua	Tue Mar 20 21:37:38 2007 +0000
@@ -4,6 +4,7 @@
 --
 
 local AceOO = AceLibrary("AceOO-2.0")
+local ReBound = AceLibrary("ReBound-1.0")
 
 local Action = AceOO.Class(
   ReAction, 
@@ -20,7 +21,7 @@
 )
 
 
-ReAction:AddButtonType( "Action",    Action,    120 )
+ReAction:AddButtonType( "Action",     Action,    120 )
 ReAction:AddButtonType( "Pet Action", PetAction, 10  )
 
 
@@ -34,8 +35,10 @@
   ids = { },
   selfcast = nil,
   keyBindLoc = "TOPRIGHT",
+  keyBindRightLoc = "RIGHT",
   stackCountLoc = "BOTTOMRIGHT",
   showKeyBind = true,
+  showKeyBindRight = false,
   showStackCount = true,
   showMacroText = true,
   showBorder = true,
@@ -123,6 +126,7 @@
           end
         end,
         validate = { "default", "none", "alt", "ctrl", "shift", "right-click" },
+        order = 101
       },
 
       opacity = {
@@ -206,6 +210,23 @@
           },
 
         },
+        order = 102,
+      },
+
+      displaysep = {
+        type = "header",
+        name = "   ",
+        desc = "   ",
+        order = 103,
+      },
+
+      showkeybind = {
+        type = "toggle",
+        name = "Show Hotkey",
+        desc = "Toggle show/hide hot key labels",
+        get  = function() return config.showKeyBind end,
+        set  = function() config.showKeyBind = not config.showKeyBind ; refresh() end,
+        order = 104,
       },
 
       keyloc = {
@@ -214,24 +235,39 @@
         desc = "Sets hotkey location",
         get  = function() return config.keyBindLoc end,
         set  = function(loc) config.keyBindLoc = loc ; refresh() end,
+        hidden = function() return not config.showKeyBind end,
         validate = labelPlacementOptions,
+        order = 105,
       },
       
-      stackloc = {
-        type = "text",
-        name = "Stack Count Location",
-        desc = "Sets stack count location",
-        get  = function() return config.stackCountLoc end,
-        set  = function(loc) config.stackCountLoc = loc ; refresh() end,
-        validate = labelPlacementOptions,
+      showKeyBindRight = {
+        type = "toggle",
+        name = "Show Right-click Hotkey",
+        desc = "Toggle show/hide right-click hot key labels",
+        get  = function() return config.showKeyBindRight end,
+        set  = function() config.showKeyBindRight = not config.showKeyBindRight ; refresh() end,
+        order = 106,
       },
 
-      showkeybind = {
+      rightkeyloc = {
+        type = "text",
+        name = "Right-click Hotkey Location",
+        desc = "Sets right-click hotkey location",
+        get  = function() return config.keyBindRightLoc end,
+        set  = function(loc) config.keyBindRightLoc = loc ; refresh() end,
+        hidden = function() return not config.showKeyBindRight end,
+        validate = labelPlacementOptions,
+        order = 107,
+      },
+      
+      colorhotkeys = {
         type = "toggle",
-        name = "Show Hotkey",
-        desc = "Toggle show/hide hot key labels",
-        get  = function() return config.showKeyBind end,
-        set  = function() config.showKeyBind = not config.showKeyBind ; refresh() end,
+        name = "Colorize Hotkeys",
+        desc = "Toggles coloring hotkeys based on the modifier key. Out-of-range coloring is always enabled.",
+        get  = function() return config.keyBindColorCode end,
+        set  = function() config.keyBindColorCode = not config.keyBindColorCode ; refresh() end,
+        hidden = function() return not config.showKeyBind and not config.showKeyBindRight end,
+        order = 109,
       },
 
       showstackcount = {
@@ -240,6 +276,18 @@
         desc = "Toggle show/hide stack count labels",
         get  = function() return config.showStackCount end,
         set  = function() config.showStackCount = not config.showStackCount ; refresh() end,
+        order = 110,
+      },
+
+      stackloc = {
+        type = "text",
+        name = "Stack Count Location",
+        desc = "Sets stack count location",
+        get  = function() return config.stackCountLoc end,
+        set  = function(loc) config.stackCountLoc = loc ; refresh() end,
+        hidden = function() return not config.showStackCount end,
+        validate = labelPlacementOptions,
+        order = 111,
       },
 
       showmacrotext = {
@@ -248,6 +296,7 @@
         desc = "Toggle show/hide macro name labels",
         get  = function() return config.showMacroText end,
         set  = function() config.showMacroText = not config.showMacroText ; refresh() end,
+        order = 112,
       },
 
       hidecooldown = {
@@ -256,6 +305,7 @@
         desc = "Hides all cooldown displays on buttons. Toggling this on does not hide currently running cooldowns.",
         get  = function() return config.hideCooldown end,
         set  = function() config.hideCooldown = not config.hideCooldown ; refresh() end,
+        order = 114,
       },
 
       hideglobalcooldown = {
@@ -264,14 +314,8 @@
         desc = "Disables the global cooldown from being displayed on buttons.",
         get  = function() return config.hideGlobalCooldown end,
         set  = function() config.hideGlobalCooldown = not config.hideGlobalCooldown ; refresh() end,
-      },
-
-      colorhotkeys = {
-        type = "toggle",
-        name = "Colorize Hotkeys",
-        desc = "Toggles coloring hotkeys based on the modifier key. Out-of-range coloring is always enabled.",
-        get  = function() return config.keyBindColorCode end,
-        set  = function() config.keyBindColorCode = not config.keyBindColorCode ; refresh() end,
+        hidden = function() return not config.hideCooldown end,
+        order = 115,
       },
 
       --[[
@@ -355,11 +399,7 @@
   
   self:SetupDisplay("ReActionButton"..id)
   self:SetupAction()
-
-  -- register button with ReBound for keybinding
-  if ReBound then
-    ReBound:AddKeybindTarget(self:GetActionFrame())
-  end
+  ReBound:Register(self:GetActionFrame())
 end
 
 function PetAction.prototype:init( id )
@@ -367,10 +407,6 @@
   
   self:SetupDisplay("ReActionPetButton"..id)
   self:SetupAction()
-
-  -- register button with ReBound for keybinding
-  if ReBound then
-    ReBound:AddKeybindTarget(self:GetActionFrame())
-  end
+  ReBound:Register(self:GetActionFrame())
 end