How do I get started on that?
It's kinda tiresome for me to go in the GW2 UI lua files and change them manually every time the addon is updated.
I'll paste the changes below so you guys have a more precise idea of what I have to do every time:
This is part of GW2_UI
Lua Code:
local function gw_OnEvent(self, event, name)
if loaded then
return
end
if event ~= "PLAYER_LOGIN" then
return
end
loaded = true
-- setup our frame pool
GW.Pools = CreatePoolCollection()
-- disable Move Anything bag handling
disableMABags()
-- hook debug output if relevant
local dev_dbg_tab = GetSetting("DEV_DBG_CHAT_TAB")
if dev_dbg_tab and dev_dbg_tab > 0 and _G["ChatFrame" .. dev_dbg_tab] then
print("hooking Debug to chat tab #" .. dev_dbg_tab)
dbgTab = dev_dbg_tab
GW.AlertTestsSetup()
GW.inDebug = true
else
GW.inDebug = false
end
--Create Settings window
GW.LoadSettings()
GW.DisplaySettings()
--Create hud art
GW.LoadHudArt()
--Create experiencebar
GW.LoadXPBar()
if GetSetting("FONTS_ENABLED") then
GW.LoadFonts()
end
if GetSetting("CASTINGBAR_ENABLED") then
GW.LoadCastingBar()
end
if GetSetting("MINIMAP_ENABLED") then
GW.LoadMinimap()
end
if GetSetting("QUESTTRACKER_ENABLED") then
GW.LoadQuestTracker()
end
if GetSetting("TOOLTIPS_ENABLED") then
GW.LoadTooltips()
end
if GetSetting("QUESTVIEW_ENABLED") then
GW.LoadQuestview()
end
if GetSetting("CHATFRAME_ENABLED") then
GW.LoadChat()
end
--Create player hud
if GetSetting("HEALTHGLOBE_ENABLED") then
GW.LoadPlayerHud()
end
if GetSetting("POWERBAR_ENABLED") then
GW.LoadPowerBar()
end
if GetSetting("CLASS_POWER") then
GW.LoadClassPowers()
end
if GetSetting("BAGS_ENABLED") then
GW.LoadBag()
GW.LoadBank()
end
if GetSetting("USE_BATTLEGROUND_HUD") then
GW.LoadBattlegrounds()
end
GW.LoadCharacter()
GW.LoadBreathMeter()
--Create unitframes
if GetSetting("FOCUS_ENABLED") then
GW.LoadFocus()
if GetSetting("focus_TARGET_ENABLED") then
GW.LoadTargetOfFocus()
end
end
if GetSetting("TARGET_ENABLED") then
GW.LoadTarget()
if GetSetting("target_TARGET_ENABLED") then
GW.LoadTargetOfTarget()
end
-- move zone text frame
if not IsFrameModified("ZoneTextFrame") then
Debug("moving ZoneTextFrame")
ZoneTextFrame:ClearAllPoints()
ZoneTextFrame:SetPoint("TOP", UIParent, "TOP", 0, -175)
end
-- move error frame
if not IsFrameModified("UIErrorsFrame") then
Debug("moving UIErrorsFrame")
UIErrorsFrame:ClearAllPoints()
UIErrorsFrame:SetPoint("TOP", UIParent, "TOP", 0, -190)
end
end
-- create pet frame
if GetSetting("PETBAR_ENABLED") then
GW.LoadPetFrame()
end
-- create action bars
if GetSetting("ACTIONBARS_ENABLED") then
OnUpdateActionBars = GW.LoadActionBars()
end
-- create buff frame
if GetSetting("PLAYER_BUFFS_ENABLED") then
GW.LoadBuffs()
end
-- create new microbuttons
--[[
if GetSetting('CHATBUBBLES_ENABLED') then
GW.LoadChatBubbles()
end
--]]
GW.LoadMicroMenu()
if GetSetting("GROUP_FRAMES") then
GW.LoadPartyFrames()
GW.LoadRaidFrames()
end
UpdateHudScale()
if (forcedMABags) then
Notice(GwLocalization["DISABLED_MA_BAGS"])
end
l:SetScript("OnUpdate", gw_OnUpdate)
end
This is the changed code:
Lua Code:
local function gw_OnEvent(self, event, name)
if loaded then
return
end
if event ~= "PLAYER_LOGIN" then
return
end
loaded = true
-- setup our frame pool
GW.Pools = CreatePoolCollection()
-- disable Move Anything bag handling
disableMABags()
-- hook debug output if relevant
local dev_dbg_tab = GetSetting("DEV_DBG_CHAT_TAB")
if dev_dbg_tab and dev_dbg_tab > 0 and _G["ChatFrame" .. dev_dbg_tab] then
print("hooking Debug to chat tab #" .. dev_dbg_tab)
dbgTab = dev_dbg_tab
GW.AlertTestsSetup()
GW.inDebug = true
else
GW.inDebug = false
end
--Create Settings window
GW.LoadSettings()
GW.DisplaySettings()
--Create hud art
GW.LoadHudArt()
--Create experiencebar
-- GW.LoadXPBar()
-- if GetSetting("FONTS_ENABLED") then
-- GW.LoadFonts()
-- end
-- if GetSetting("CASTINGBAR_ENABLED") then
-- GW.LoadCastingBar()
-- end
if GetSetting("MINIMAP_ENABLED") then
GW.LoadMinimap()
end
if GetSetting("QUESTTRACKER_ENABLED") then
GW.LoadQuestTracker()
end
-- if GetSetting("TOOLTIPS_ENABLED") then
-- GW.LoadTooltips()
-- end
-- if GetSetting("QUESTVIEW_ENABLED") then
-- GW.LoadQuestview()
-- end
if GetSetting("CHATFRAME_ENABLED") then
GW.LoadChat()
end
--Create player hud
-- if GetSetting("HEALTHGLOBE_ENABLED") then
-- GW.LoadPlayerHud()
-- end
-- if GetSetting("POWERBAR_ENABLED") then
-- GW.LoadPowerBar()
-- end
-- if GetSetting("CLASS_POWER") then
-- GW.LoadClassPowers()
-- end
-- if GetSetting("BAGS_ENABLED") then
-- GW.LoadBag()
-- GW.LoadBank()
-- end
if GetSetting("USE_BATTLEGROUND_HUD") then
GW.LoadBattlegrounds()
end
GW.LoadCharacter()
GW.LoadBreathMeter()
--Create unitframes
if GetSetting("FOCUS_ENABLED") then
GW.LoadFocus()
if GetSetting("focus_TARGET_ENABLED") then
GW.LoadTargetOfFocus()
end
end
if GetSetting("TARGET_ENABLED") then
GW.LoadTarget()
if GetSetting("target_TARGET_ENABLED") then
GW.LoadTargetOfTarget()
end
-- move zone text frame
if not IsFrameModified("ZoneTextFrame") then
Debug("moving ZoneTextFrame")
ZoneTextFrame:ClearAllPoints()
ZoneTextFrame:SetPoint("TOP", UIParent, "TOP", 0, -175)
end
-- move error frame
if not IsFrameModified("UIErrorsFrame") then
Debug("moving UIErrorsFrame")
UIErrorsFrame:SetFont( font, 9, outline )
UIErrorsFrame:ClearAllPoints()
UIErrorsFrame:SetPoint('TOP',UIParent,'TOP',0,-5)
end
end
-- create pet frame
if GetSetting("PETBAR_ENABLED") then
GW.LoadPetFrame()
end
-- create action bars
-- if GetSetting("ACTIONBARS_ENABLED") then
-- OnUpdateActionBars = GW.LoadActionBars()
-- end
-- create buff frame
-- if GetSetting("PLAYER_BUFFS_ENABLED") then
-- GW.LoadBuffs()
-- end
-- create new microbuttons
--[[
if GetSetting('CHATBUBBLES_ENABLED') then
GW.LoadChatBubbles()
end
--]]
-- GW.LoadMicroMenu()
-- if GetSetting("GROUP_FRAMES") then
-- GW.LoadPartyFrames()
-- GW.LoadRaidFrames()
-- end
UpdateHudScale()
if (forcedMABags) then
Notice(GwLocalization["DISABLED_MA_BAGS"])
end
l:SetScript("OnUpdate", gw_OnUpdate)
end
Please notice that, despite GW2 UI having modules, some of the functions I disable aren't available to be disabled through modules, such as the experience bar. I don't like it personally, and I have to disable it manually every time. The fonts are another nuisance.
I also change mainbar\hud.lua in this part:
Original:
Lua Code:
local function selectBg()
if not GetSetting("HUD_SPELL_SWAP") then
return
end
local right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadow"
local left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadow"
_G["GwActionBarHudLEFT"]:SetVertexColor(1, 1, 1, 1)
_G["GwActionBarHudRIGHT"]:SetVertexColor(1, 1, 1, 1)
if UnitIsDeadOrGhost("player") then
right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadow_dead"
left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadow_dead"
end
if UnitAffectingCombat("player") then
right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadowcombat"
left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadowcombat"
_G["GwActionBarHudLEFT"]:SetVertexColor(1, 1, 1, 0.45)
_G["GwActionBarHudRIGHT"]:SetVertexColor(1, 1, 1, 0.45)
for i = 1, 40 do
local _, _, _, _, _, _, _, _, _, spellID = UnitBuff("player", i)
if spellID ~= nil and action_hud_auras[spellID] ~= nil then
left = action_hud_auras[spellID]["left"]
right = action_hud_auras[spellID]["right"]
end
end
end
if currentTexture ~= left then
currentTexture = left
_G["GwActionBarHudLEFT"]:SetTexture(left)
_G["GwActionBarHudRIGHT"]:SetTexture(right)
end
end
Changed:
Lua Code:
local function selectBg()
if not GetSetting("HUD_SPELL_SWAP") then
return
end
local right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadow"
local left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadow"
if UnitIsDeadOrGhost("player") then
right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadow_dead"
left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadow_dead"
end
if UnitAffectingCombat("player") then
right = "Interface\\AddOns\\GW2_UI\\textures\\rightshadowcombat"
left = "Interface\\AddOns\\GW2_UI\\textures\\leftshadowcombat"
for i = 1, 40 do
local _, _, _, _, _, _, _, _, _, spellID = UnitBuff("player", i)
if spellID ~= nil and action_hud_auras[spellID] ~= nil then
left = action_hud_auras[spellID]["left"]
right = action_hud_auras[spellID]["right"]
end
end
end
if currentTexture ~= left then
currentTexture = left
_G["GwActionBarHudLEFT"]:SetTexture(left)
_G["GwActionBarHudRIGHT"]:SetTexture(right)
end
end
I do so because the in-combat texture is too damn bright. Also, if I could have the standard texture (textures\\leftshadow and textures\\rightshadow) on the background at all times, behind the new ones that get added, it would be perfect. But as I see it, the authors coded the frame element to just change its own texture (when entering combat, activating buffs, etc), and not being new frames on their own.
Finally, I also change the XML file:
Original:
Lua Code:
<Frames>
<Frame name="GwActionBarHud" frameStrata="BACKGROUND">
<Size x="1024" y="256"></Size>
<Anchors>
<Anchor point="BOTTOM" relativePoint="BOTTOM" x="0" y="14" />
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLEFT" file="Interface\AddOns\GW2_UI\textures\leftshadow" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHT" file="Interface\AddOns\GW2_UI\textures\rightshadow" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="3" level="BACKGROUND">
<Texture name="$parentLEFTSWIM" file="Interface\AddOns\GW2_UI\textures\leftshadowswim" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHTSWIM" file="Interface\AddOns\GW2_UI\textures\rightshadowswim" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="4" level="BACKGROUND">
<Texture name="$parentLEFTBLOOD" file="Interface\AddOns\GW2_UI\textures\bloodLeft" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHTBLOOD" file="Interface\AddOns\GW2_UI\textures\bloodRight" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="5" level="BACKGROUND">
</Layer>
</Layers>
</Frame>
</Frames>
Changed:
Lua Code:
<Frames>
<Frame name="GwActionBarHud" frameStrata="BACKGROUND">
<Size x="1024" y="256"></Size>
<Anchors>
<Anchor point="BOTTOM" relativePoint="BOTTOM" x="0" y="0" />
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLEFT" file="Interface\AddOns\GW2_UI\textures\leftshadow" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHT" file="Interface\AddOns\GW2_UI\textures\rightshadow" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="3" level="BACKGROUND">
<Texture name="$parentLEFTSWIM" file="Interface\AddOns\GW2_UI\textures\leftshadowswim" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHTSWIM" file="Interface\AddOns\GW2_UI\textures\rightshadowswim" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="4" level="BACKGROUND">
<Texture name="$parentLEFTBLOOD" file="Interface\AddOns\GW2_UI\textures\bloodLeft" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="LEFT" relativePoint="LEFT" x="0" y="0" />
</Anchors>
</Texture>
<Texture name="$parentRIGHTBLOOD" file="Interface\AddOns\GW2_UI\textures\bloodRight" parentKey="Background">
<Size x="512" y="256"></Size>
<Anchors>
<Anchor point="RIGHT" relativePoint="RIGHT" x="0" y="0" />
</Anchors>
</Texture>
</Layer>
<Layer textureSubLevel="5" level="BACKGROUND">
</Layer>
</Layers>
</Frame>
</Frames>
I just changed x and y to be 0 because of how my own UI is organized.
I believe all that stuff should be simple to code around. Where do I get started on an addon that alters the positioning of GW2 UI's frames and disables some of its features?