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
|