From bd1abc70d2567f625f4a22e91365fb3133fddd5c Mon Sep 17 00:00:00 2001 From: Scott Ingram Date: Sat, 18 Mar 2023 11:31:24 -0700 Subject: [PATCH 1/3] Create README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..97b5fde --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# FloFlyout +wow addon to provide custom flyout menus - created by Boboseb From 856e0ce85e6c8d006e3cd0aacd6a63f6bda6ae72 Mon Sep 17 00:00:00 2001 From: Scott Ingram Date: Sat, 18 Mar 2023 21:42:24 -0700 Subject: [PATCH 2/3] fix for issue #1 - errors when empty flyouts exist on bars --- FloFlyout.lua | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/FloFlyout.lua b/FloFlyout.lua index 79f1bda..77f007f 100755 --- a/FloFlyout.lua +++ b/FloFlyout.lua @@ -70,6 +70,10 @@ local L = FLOFLYOUT_L10N_STRINGS -- Functions ------------------------------------------------------------------------------- +function isEmpty(s) + return s == nil or s == '' +end + function FloFlyout.ReadCmd(line) local cmd, arg1, arg2 = strsplit(' ', line or "", 3); @@ -228,7 +232,7 @@ function FloFlyoutFrame_OnEvent(self, event, ...) if event == "SPELL_UPDATE_COOLDOWN" then local i = 1 local button = _G[self:GetName().."Button"..i] - while (button and button:IsShown() and button.spellID) do + while (button and button:IsShown() and not isEmpty(button.spellID)) do SpellFlyoutButton_UpdateCooldown(button) i = i+1 button = _G[self:GetName().."Button"..i] @@ -437,11 +441,11 @@ local function Opener_PreClick(self, button, down) local buttonList = { FloFlyoutFrame:GetChildren() } table.remove(buttonList, 1) for i, buttonRef in ipairs(buttonList) do - if spellList[i] then - buttonRef.spellID = spellList[i] - buttonRef.actionType = typeList[i] - local icon = FloFlyout:GetTexture(typeList[i], spellList[i]) - _G[buttonRef:GetName().."Icon"]:SetTexture(icon) + buttonRef.spellID = spellList[i] + buttonRef.actionType = typeList[i] + local icon = FloFlyout:GetTexture(typeList[i], spellList[i]) + _G[buttonRef:GetName().."Icon"]:SetTexture(icon) + if true or not isEmpty(spellList[i]) then SpellFlyoutButton_UpdateCooldown(buttonRef) SpellFlyoutButton_UpdateState(buttonRef) SpellFlyoutButton_UpdateUsable(buttonRef) @@ -588,15 +592,17 @@ function FloFlyout:CreateOpener(name, idFlyout, actionId, direction, actionButto _classicUI.LayoutActionButton(opener, typeActionButton) opener:SetScale(actionButton:GetScale()) end - if actionButton:GetSize() and actionButton:IsRectValid() then - opener:SetAllPoints(actionButton) - else - local spacerName = "ActionBarButtonSpacer"..tostring(actionButton.index) - local children = {actionButton:GetParent():GetChildren()} - for _, child in ipairs(children) do - if child:GetName() == spacerName then - opener:SetAllPoints(child) - break; + if actionButton then + if actionButton:GetSize() and actionButton:IsRectValid() then + opener:SetAllPoints(actionButton) + else + local spacerName = "ActionBarButtonSpacer"..tostring(actionButton.index) + local children = {actionButton:GetParent():GetChildren()} + for _, child in ipairs(children) do + if child:GetName() == spacerName then + opener:SetAllPoints(child) + break; + end end end end From b017a22c0a9b948ab984fcc512de407b8f34af0d Mon Sep 17 00:00:00 2001 From: Scott Ingram Date: Sat, 18 Mar 2023 22:06:17 -0700 Subject: [PATCH 3/3] FIX for fix for issue #1 - oops, left in a debug clause --- FloFlyout.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FloFlyout.lua b/FloFlyout.lua index 77f007f..8150f74 100755 --- a/FloFlyout.lua +++ b/FloFlyout.lua @@ -445,7 +445,7 @@ local function Opener_PreClick(self, button, down) buttonRef.actionType = typeList[i] local icon = FloFlyout:GetTexture(typeList[i], spellList[i]) _G[buttonRef:GetName().."Icon"]:SetTexture(icon) - if true or not isEmpty(spellList[i]) then + if not isEmpty(spellList[i]) then SpellFlyoutButton_UpdateCooldown(buttonRef) SpellFlyoutButton_UpdateState(buttonRef) SpellFlyoutButton_UpdateUsable(buttonRef)