From: Aleksi Blinnikka Date: Fri, 4 May 2018 12:50:24 +0000 (+0300) Subject: Add Azerite Bar X-Git-Url: https://www.aleksib.fi/git/wowui.git/commitdiff_plain/2cb3a289b5b6b45db36f6d9c722be8a30aedb3e2?ds=sidebyside Add Azerite Bar Hide default status tracking bars, this includes rep tracking bars. To be added later if needed. --- diff --git a/OmaAB/AzeriteBar.lua b/OmaAB/AzeriteBar.lua new file mode 100644 index 0000000..11d6704 --- /dev/null +++ b/OmaAB/AzeriteBar.lua @@ -0,0 +1,38 @@ +-- AzeriteBar.lua +local _; +local width = 300; +local running = false; +local frame = CreateFrame("Frame", "OmaAzeriteBar", UIParent); + +frame:SetScript("OnEvent", function() + frame:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, 8); + frame:SetWidth(width); + frame:SetHeight(8); + frame.base = frame:CreateTexture(nil, "BACKGROUND"); + frame.base:SetAllPoints(); + frame.base:SetColorTexture(0, 0, 0, 0.5); + frame.bar = frame:CreateTexture(nil, "BORDER"); + frame.bar:SetPoint("TOPLEFT", frame.base, "TOPLEFT"); + frame.bar:SetPoint("BOTTOMLEFT", frame.base, "BOTTOMLEFT"); + frame.bar:SetColorTexture(ARTIFACT_BAR_COLOR:GetRGB()); + frame.text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight"); + frame.text:SetPoint("BOTTOM"); + frame.text:Hide(); + + frame:SetScript("OnEvent", function() + -- from FrameXML/AzeriteBar.lua + local azeriteItem = C_AzeriteItem.FindActiveAzeriteItem(); + if not azeriteItem then return end + + local xp, totalxp = C_AzeriteItem.GetAzeriteItemXPInfo(azeriteItem); + frame.bar:SetWidth(xp/totalxp*width); + frame.text:SetFormattedText("%d / %d", xp, totalxp); + end); + frame:UnregisterAllEvents(); + frame:RegisterEvent("PLAYER_ENTERING_WORLD"); + frame:RegisterEvent("AZERITE_ITEM_EXPERIENCE_CHANGED"); + -- from FrameXML/MainMenuBar.lua + frame:SetScript("OnEnter", function(frame) frame.text:Show(); end); + frame:SetScript("OnLeave", function(frame) frame.text:Hide(); end); +end); +frame:RegisterEvent("PLAYER_LOGIN"); diff --git a/OmaAB/BagBar.txt b/OmaAB/BagBar.txt deleted file mode 100644 index e69de29..0000000 diff --git a/OmaAB/ExpBar.lua b/OmaAB/ExpBar.lua index 01febef..5584213 100644 --- a/OmaAB/ExpBar.lua +++ b/OmaAB/ExpBar.lua @@ -1,21 +1,18 @@ -- ExpBar.lua -if true then return end local _; local min = math.min; local IsResting = IsResting; local UnitXP, UnitXPMax, GetXPExhaustion = UnitXP, UnitXPMax, GetXPExhaustion; local CTimerAfter = C_Timer.After; -local ExhaustionToolTipText = ExhaustionToolTipText; -local GameTooltip = nil; local width = 300; local running = false; -local frame = CreateFrame("Frame", "OmaExpBar", UIParent); +local frame = CreateFrame("Frame", "OmaArtifactBar", UIParent); local function expBar() - frame:SetPoint("CENTER"); + frame:SetPoint("BOTTOM"); frame:SetWidth(width); - frame:SetHeight(10); + frame:SetHeight(8); frame.base = frame:CreateTexture(nil, "BACKGROUND"); frame.base:SetAllPoints(); frame.base:SetColorTexture(0, 0, 0, 0.5); @@ -77,12 +74,9 @@ local function expBar() frame:SetScript("OnLeave", function(frame) frame.text:Hide(); end); end -frame:RegisterEvent("PLAYER_LOGIN"); frame:SetScript("OnEvent", function(self, event) - if event == "PLAYER_LOGIN" then - GameTooltip = _G["GameTooltip"]; - if UnitLevel("player") < 120 and not IsXPUserDisabled() then - return expBar(); - end + if UnitLevel("player") < 120 and not IsXPUserDisabled() then + return expBar(); end end); +frame:RegisterEvent("PLAYER_LOGIN"); diff --git a/OmaAB/HideBlizzard.lua b/OmaAB/HideBlizzard.lua index 4b57e97..616d1a7 100644 --- a/OmaAB/HideBlizzard.lua +++ b/OmaAB/HideBlizzard.lua @@ -11,7 +11,9 @@ local function hide() barHolder:SetHeight(20); function barHolder:OnStatusBarsUpdated() end; local xpbars = _G["StatusTrackingBarManager"]; - xpbars:SetParent(barHolder); + xpbars:UnregisterAllEvents(); + xpbars:Hide(); + --xpbars:SetParent(barHolder); UpdateMicroButtonsParent(barHolder); MoveMicroButtons("TOP", UIParent, "TOP", -120, 0); diff --git a/OmaAB/OmaAB.toc b/OmaAB/OmaAB.toc index ebd6451..22ef8bd 100644 --- a/OmaAB/OmaAB.toc +++ b/OmaAB/OmaAB.toc @@ -7,4 +7,5 @@ HideBlizzard.lua Bindings.xml ExpBar.lua +AzeriteBar.lua ActionBars.lua