From 66a4131a96ad772719415854ad53fd4cf3350a2e Mon Sep 17 00:00:00 2001 From: Pawel Date: Fri, 22 Apr 2016 05:09:06 +0200 Subject: [PATCH] v1.11 - SuperVillain support --- TDButtons.lua | 29 +++++++++++++++++++++++++++++ TDDps.lua | 12 ++++++------ TDDps.toc | 4 ++-- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/TDButtons.lua b/TDButtons.lua index 450be05..5134658 100644 --- a/TDButtons.lua +++ b/TDButtons.lua @@ -125,11 +125,14 @@ function TDButton_Fetch() TDButton_SpellsGlowing = {}; local isBartender = IsAddOnLoaded('Bartender4'); local isElv = IsAddOnLoaded('ElvUI'); + local isSv = IsAddOnLoaded('SVUI_ActionBars'); if (isBartender) then TDButton_FetchBartender4(); elseif (isElv) then TDButton_FetchElvUI(); + elseif (isSv) then + TDButton_FetchSuperVillain(); else TDButton_FetchBlizzard(); end @@ -237,6 +240,32 @@ function TDButton_FetchElvUI() end ---------------------------------------------- +-- Button spells on SuperVillain +---------------------------------------------- +function TDButton_FetchSuperVillain() + local ret = false; + for x = 1, 10 do + for i = 1, 12 do + local button = _G['SVUI_ActionBar' .. x .. 'Button' .. i]; + if button then + local spellId = button:GetSpellId(); + if spellId then + local actionName, _ = GetSpellInfo(spellId); + if actionName then + if TDButton_Spells[actionName] == nil then + TDButton_Spells[actionName] = {}; + end + ret = true; + tinsert(TDButton_Spells[actionName], button); + end + end + end + end + end + return ret; +end + +---------------------------------------------- -- Button spells on Bartender4 ---------------------------------------------- function TDButton_FetchBartender4() diff --git a/TDDps.lua b/TDDps.lua index 03808ef..8c254b2 100644 --- a/TDDps.lua +++ b/TDDps.lua @@ -69,26 +69,26 @@ end ---------------------------------------------- function TDDps_EnableAddon(mode) print(_tdInfo .. TDDpsName .. ': Enabling'); - + if _TD['DPS_NextSpell'] == nil then print(_tdError .. TDDpsName .. ': No addon selected, cannot enable'); return; end - + if _TD['DPS_Enabled'] == 1 then return; end - + _TD['DPS_Mode'] = mode; TDButton_Fetch(); - + if _TD['DPS_OnEnable'] then _TD['DPS_OnEnable'](); end TDDps_Frame:SetScript('OnUpdate', TDDps_OnUpdate); - + _TD['DPS_Enabled'] = 1; print(_tdSuccess .. TDDpsName .. ': Enabled'); end @@ -99,7 +99,7 @@ end function TDDps_InvokeNextSpell() -- invoke spell check local oldSkill = DPS_Skill; - + DPS_Skill = _TD['DPS_NextSpell'](); if (oldSkill ~= DPS_Skill or oldSkill == nil) and DPS_Skill ~= nil then diff --git a/TDDps.toc b/TDDps.toc index 5ba0b02..c793f1a 100644 --- a/TDDps.toc +++ b/TDDps.toc @@ -1,10 +1,10 @@ ## Title: TDDps ## Notes: Rotation helper framework. -## Version: 1.10 +## Version: 1.11 ## Author: Kaminaris ## Interface: 60200 ## SavedVariables: TDDps_Options -## OptionalDependencies: Bartender4, ElvUI, ButtonForge +## OptionalDependencies: Bartender4, ElvUI, ButtonForge, SVUI_ActionBars Libs\LibStub\LibStub.lua Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml -- 1.7.9.5