From fc37752b4dcc88a141023ed5124f94d2d2eaaf0b Mon Sep 17 00:00:00 2001 From: Vae Date: Tue, 31 Jan 2023 10:15:25 -1000 Subject: [PATCH] Support for NDui --- ConRO.toc | 2 +- buttons.lua | 42 ++++++++++++++++++++++++++++++++++++++++++ core.lua | 2 +- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/ConRO.toc b/ConRO.toc index 2059c46..4b3293f 100644 --- a/ConRO.toc +++ b/ConRO.toc @@ -1,6 +1,6 @@ ## Title:-|cffFFFFFFConRO|r- Conflict Rotation Optimizer ## Notes: Rotation helper framework. -## Version: 10.0.26 +## Version: 10.0.27 ## Author: Vae ## Interface: 100005 ## SavedVariables: ConROPreferences diff --git a/buttons.lua b/buttons.lua index b99703e..cc80922 100644 --- a/buttons.lua +++ b/buttons.lua @@ -2145,6 +2145,10 @@ function ConRO:Fetch() self:FetchDominos(); end + if IsAddOnLoaded('NDui') then + self:FetchNDui(); + end + if IsAddOnLoaded('DiabolicUI') then self:FetchDiabolic(); end @@ -2193,6 +2197,10 @@ function ConRO:FetchDef() self:DefFetchDominos(); end + if IsAddOnLoaded('NDui') then + self:DefFetchNDui(); + end + if IsAddOnLoaded('DiabolicUI') then self:DefFetchDiabolic(); end @@ -2288,6 +2296,40 @@ function ConRO:DefFetchDominos() end end +function ConRO:FetchNDui() + for i = 1, 8 do + for b = 1, 12 do + local button = _G['NDui_ActionBar' .. i .. 'Button' .. b]; + local hotkey; + if i == 1 then + hotkey = 'ActionButton' .. i .. ':HOTKEY'; + else + hotkey = 'ActionBar' .. i .. 'Button' .. b .. ':HOTKEY'; + end + if button then + self:AddStandardButton(button, hotkey); + end + end + end +end + +function ConRO:DefFetchNDui() + for i = 1, 8 do + for b = 1, 12 do + local button = _G['NDui_ActionBar' .. i .. 'Button' .. b]; + local hotkey; + if i == 1 then + hotkey = 'ActionButton' .. i .. ':HOTKEY'; + else + hotkey = 'ActionBar' .. i .. 'Button' .. b .. ':HOTKEY'; + end + if button then + self:DefAddStandardButton(button, hotkey); + end + end + end +end + function ConRO:FetchButtonForge() local i = 1; while true do diff --git a/core.lua b/core.lua index 2c08ed7..368b703 100644 --- a/core.lua +++ b/core.lua @@ -2957,7 +2957,7 @@ function ConRO:MeleeSpec() [12] = 'DemonHunter', [13] = 'Evoker', ]] - if classId == 1 or classId == 2 or classId == 3 or classId == 4 or classId == 5 or classId == 6 or classId == 7 or classId == 8 or classId == 10 or classId == 11 or classId == 12 or classId == 13 then + if classId == 1 or classId == 2 or classId == 3 or classId == 4 or classId == 5 or classId == 6 or classId == 7 or classId == 8 or classId == 9 or classId == 10 or classId == 11 or classId == 12 or classId == 13 then return true; end return false;