WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Carbonite Archive (https://www.wowinterface.com/forums/forumdisplay.php?f=158)
-   -   Trying to Create an ElvUI compatability Addon (https://www.wowinterface.com/forums/showthread.php?t=48351)

Lolaan 10-13-13 05:53 PM

Trying to Create an ElvUI compatability Addon
 
What I'm trying to do is make an addon (or really atm just edit elvui directly; addon to come later) to move the DataTexts and Buff/Config button to the outside of the carbonite map instead of the minimap.

I think it should be as simple as changing the relevant Minimap to use the appropriate NX frame but I tried NXMap1 but it says its a nil value.

Here's the relevant codeblock from ElvUI:

Code:

function LO:CreateMinimapPanels()
        local lminipanel = CreateFrame('Frame', 'LeftMiniPanel', Minimap)
        lminipanel:Point('TOPLEFT', Minimap, 'BOTTOMLEFT', -E.Border, (E.PixelMode and 0 or -3))
        lminipanel:Point('BOTTOMRIGHT', Minimap, 'BOTTOM', -E.Spacing, -((E.PixelMode and 0 or 3) + PANEL_HEIGHT))
        lminipanel:SetTemplate(E.db.datatexts.panelTransparency and 'Transparent' or 'Default', true)
        E:GetModule('DataTexts'):RegisterPanel(lminipanel, 1, 'ANCHOR_BOTTOMLEFT', lminipanel:GetWidth() * 2, -4)
       
        local rminipanel = CreateFrame('Frame', 'RightMiniPanel', Minimap)
        rminipanel:Point('TOPRIGHT', Minimap, 'BOTTOMRIGHT', E.Border, (E.PixelMode and 0 or -3))
        rminipanel:Point('BOTTOMLEFT', lminipanel, 'BOTTOMRIGHT', (E.PixelMode and -1 or 1), 0)
        rminipanel:SetTemplate(E.db.datatexts.panelTransparency and 'Transparent' or 'Default', true)
        E:GetModule('DataTexts'):RegisterPanel(rminipanel, 1, 'ANCHOR_BOTTOM', 0, -4)
       
        if E.db.datatexts.minimapPanels then
                LeftMiniPanel:Show()
                RightMiniPanel:Show()
        else
                LeftMiniPanel:Hide()
                RightMiniPanel:Hide()
        end
       
        local configtoggle = CreateFrame('Button', 'ElvConfigToggle', Minimap)
        configtoggle:Point('TOPLEFT', rminipanel, 'TOPRIGHT', (E.PixelMode and -1 or 1), 0)
        configtoggle:Point('BOTTOMLEFT', rminipanel, 'BOTTOMRIGHT', (E.PixelMode and -1 or 1), 0)
        configtoggle:RegisterForClicks('AnyUp')
        configtoggle:Width(E.ConsolidatedBuffsWidth)
        configtoggle:SetTemplate(E.db.datatexts.panelTransparency and 'Transparent' or 'Default', true)
        configtoggle.text = configtoggle:CreateFontString(nil, 'OVERLAY')
        configtoggle.text:FontTemplate()
        configtoggle.text:SetText('C')
        configtoggle.text:SetPoint('CENTER')
        configtoggle.text:SetJustifyH('CENTER')
        configtoggle:SetScript('OnClick', function(self, btn)
                if btn == 'LeftButton' then
                        E:ToggleConfig()
                else
                        E:BGStats()
                end
        end)
        configtoggle:SetScript('OnEnter', function(self)
                GameTooltip:SetOwner(self, 'ANCHOR_BOTTOMRIGHT', 0, -4)
                GameTooltip:ClearLines()
                GameTooltip:AddDoubleLine(L['Left Click:'], L['Toggle Configuration'], 1, 1, 1)
               
                if E.db.datatexts.battleground then
                        GameTooltip:AddDoubleLine(L['Right Click:'], L['Show BG Texts'], 1, 1, 1)       
                end
                GameTooltip:Show()
        end)
        configtoggle:SetScript('OnLeave', function(self)
                GameTooltip:Hide()
        end)
end


jeffy162 10-13-13 07:52 PM

The problem might be that Carbonite's map is two different sizes: minimized and maximized. I am unsure of how Carbonite differentiates between the two.

Lolaan 10-14-13 08:25 AM

Actually, after mulling on it overnight, I think I'm going to try to detach the appropriate ElvUI frames from the minimap instead and put them into their own area. Should be far more workable than trying to attach everything to Carbonite's map.

Though I wouldn't mind knowing why it didn't work for educational reasons, not very fluent with the wow UI yet.

Chmee 10-14-13 03:32 PM

I suspect that the problem is that the Blizzard api for "attaching buttons to the minimap" applies only to Blizzard's minimap, since the Carbonite "minimap" isn't the same as the Blizzard minimap.


All times are GMT -6. The time now is 07:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI