seblindfors / ConsolePort

ConsolePort - Game Controller Addon for World of Warcraft
Artistic License 2.0
172 stars 40 forks source link

Expose db.Atlas.SetFutureButtonStyle() function #24

Closed Blazeflack closed 7 years ago

Blazeflack commented 7 years ago

Any chance you could expose this particular function (or your entire API if you wish) to other addons? A user pointed out a compatibility issue between ConsolePort and ElvUI regarding GameMenu.

I'm adding code to ElvUI which will check for ConsolePort and then refrain from skinning the GameMenu frame. I'd like to be able to make the ElvUI button match your other buttons on that frame.

seblindfors commented 7 years ago

I already expose the addon table for ConsolePort extensions. You can use ConsolePort:GetData() or ConsolePort:GetData().Atlas for that particular table.

Now that you mention it, I've been getting a few complaints about incompatibility with ElvUI action bars. I'm suspecting it has to do either with the default action bars being disabled and not updating properly or a custom action page driver on your end. This is what I'm using to replicate the Blizzard bars:

-- Only use the state driver to let the pager know an update has happend
RegisterStateDriver(Pager, "actionpage", "[vehicleui] 1; [possessbar] 2; [overridebar] 3; [shapeshift] 4; [bar:2] 5; [bar:3] 6; [bar:4] 7; [bar:5] 8; [bar:6] 9; [bonusbar:1] 10; [bonusbar:2] 11; [bonusbar:3] 12; [bonusbar:4] 13; 14") 
-- Calculate the new action page or offset
Pager:SetAttribute("_onstate-actionpage", [[
    if HasVehicleActionBar() then
        newstate = GetVehicleBarIndex()
    elseif HasOverrideActionBar() then
        newstate = GetOverrideBarIndex()
    elseif HasTempShapeshiftActionBar() then
        newstate = GetTempShapeshiftBarIndex()
    elseif GetBonusBarOffset() > 0 then
        newstate = GetBonusBarOffset()+6
    else
        newstate = GetActionBarPage()
    end
    for header in pairs(headers) do
        header:SetAttribute("actionpage", newstate)
    end
]])
Blazeflack commented 7 years ago

I guess I missed the line that exposed it, sorry about that.

We disable ActionBarController as it interferes with our own ActionBars. We update the "actionpage" attribute on MainMenuBarArtFrame so that /dump MainMenuBarArtFrame:GetAttribute("actionpage") always returns the expected value as per the thread here: http://www.tukui.org/forums/topic.php?id=35332#post-230436

Blazeflack commented 7 years ago

Feel free to open a ticket if there is a compatibility issue that requires changes in ElvUI.

I'm closing this one.