From fb249f5413d20caccd817be46a3bb7b51fc357f4 Mon Sep 17 00:00:00 2001 From: Pawel Date: Sun, 3 Apr 2016 16:10:17 +0200 Subject: [PATCH] v1.9 - ButtonForge Support --- TDButtons.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ TDDps.toc | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/TDButtons.lua b/TDButtons.lua index f183086..450be05 100644 --- a/TDButtons.lua +++ b/TDButtons.lua @@ -133,6 +133,12 @@ function TDButton_Fetch() else TDButton_FetchBlizzard(); end + + -- It does not alter original button frames so it needs to be fetched too + if IsAddOnLoaded('ButtonForge') then + TDButton_FetchButtonForge(); + end + print(_tdInfo .. TDDpsName .. ': Fetched action bars!'); end @@ -167,6 +173,44 @@ function TDButton_FetchBlizzard() end ---------------------------------------------- +-- Button spells on original button forge +---------------------------------------------- +function TDButton_FetchButtonForge() + local i = 1; + while true do + local button = _G['ButtonForge' .. i]; + if not button then + break; + end + i = i + 1; + + local type = button:GetAttribute('type'); + if type then + local actionType = button:GetAttribute(type); + local id; + local actionName; + if type == 'macro' then + local id = GetMacroSpell(actionType); + if id then + actionName = GetSpellInfo(id); + end + elseif type == 'item' then + actionName = GetItemInfo(actionType); + elseif type == 'spell' then + actionName = GetSpellInfo(actionType); + end + if actionName then + if TDButton_Spells[actionName] == nil then + TDButton_Spells[actionName] = {}; + end + + tinsert(TDButton_Spells[actionName], button); + end + end + end +end + +---------------------------------------------- -- Button spells on ElvUI ---------------------------------------------- function TDButton_FetchElvUI() diff --git a/TDDps.toc b/TDDps.toc index 0877dce..f59568b 100644 --- a/TDDps.toc +++ b/TDDps.toc @@ -1,10 +1,10 @@ ## Title: TDDps ## Notes: Rotation helper framework. -## Version: 1.8 +## Version: 1.9 ## Author: Kaminaris ## Interface: 60200 ## SavedVariables: TDDps_Options -## OptionalDependencies: Bartender4, ElvUI +## OptionalDependencies: Bartender4, ElvUI, ButtonForge Libs\LibStub\LibStub.lua Libs\AceGUI-3.0\AceGUI-3.0.xml -- 1.7.9.5