0c89853 - Remove debug prints
[wowui.git] / OmaAB / ActionBars.lua
index e6637e9..10cd415 100644 (file)
@@ -6,6 +6,7 @@ local ssub = string.sub;
 local GetActionInfo, GetActionTexture = GetActionInfo, GetActionTexture;
 local GetActionLossOfControlCooldown = GetActionLossOfControlCooldown;
 local GetActionCooldown, GetActionCharges = GetActionCooldown, GetActionCharges;
+local GetActionText, GetBindingKey = GetActionText, GetBindingKey;
 local IsConsumableAction, IsStackableAction = IsConsumableAction, IsStackableAction;
 local IsItemAction, GetActionCount = IsItemAction, GetActionCount;
 local IsSpellOverlayed, GetMacroSpell = IsSpellOverlayed, GetMacroSpell;
@@ -15,7 +16,6 @@ local IsCurrentAction, IsAutoRepeatAction = IsCurrentAction, IsAutoRepeatAction;
 local CreateFrame = CreateFrame;
 local RegisterStateDriver = RegisterStateDriver;
 local CooldownFrame_Set, CooldownFrame_Clear = CooldownFrame_Set, CooldownFrame_Clear;
-local CTimerAfter = C_Timer.After;
 local GameTooltip = GameTooltip;
 local GameTooltip_SetDefaultAnchor = GameTooltip_SetDefaultAnchor;
 local COOLDOWN_TYPE_LOSS_OF_CONTROL = COOLDOWN_TYPE_LOSS_OF_CONTROL;
@@ -122,6 +122,8 @@ local chars = {
         ["Vildan"] = {1, 2, 3, 4,},
         ["Gedren"] = {1, 2, 3, 4,},
         ["Gazden"] = {1, 2, 3, 4,},
+        ["Gedran"] = {1, 2, 3, 4,},
+        ["Iled"] = {1, 2, 3, 4,},
     },
 };
 
@@ -523,7 +525,10 @@ local function createActionBar(parent, config)
             secure:SetAttribute("flyoutDirection", config.flyout);
         end
         function secure:ActionChanged(oldslot)
-            if oldslot then activeButtons[oldslot] = nil end
+            if oldslot then
+                activeButtons[oldslot] = nil;
+                self.prev = nil; -- invalidate previous CD when slot changes
+            end
             self.slot = self:GetAttribute("action");
             return updateButton(self, self.slot);
         end
@@ -552,7 +557,7 @@ local function initialize()
 end
 
 local function setupBindings()
-    BINDING_HEADER_OmaAB = "Oma Action Bar";
+    _G["BINDING_HEADER_OmaAB"] = "Oma Action Bar";
     for i = 1,10 do
         _G["BINDING_HEADER_OMAABBLANK"..i] = "Bar "..i;
         for j = 1,12 do