Commit 702873ba authored by Merathilis's avatar Merathilis

I decided to remove my own ProgressBar. Use the ElvUI ones (Azerite, Rep) Layout Update.

parent 1d492a13
......@@ -161,7 +161,7 @@ local function SetupChat()
E.db["chat"]["tabFontOutline"] = "OUTLINE"
E.db["chat"]["tabFontSize"] = 10
MER:SetMoverPosition("RightChatMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -153, 50)
MER:SetMoverPosition("RightChatMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -157, 50)
MER:SetMoverPosition("LeftChatMover", "BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 10, 50)
E:StaggeredUpdateAll(nil, true)
......@@ -223,7 +223,7 @@ function MER:SetupLayout()
E.db["general"]["minimap"]["icons"]["ticket"]["scale"] = 0.75
E.db["general"]["minimap"]["resetZoom"]["enable"] = true
E.db["general"]["minimap"]["resetZoom"]["time"] = 5
E.db["general"]["minimap"]["size"] = 140
E.db["general"]["minimap"]["size"] = 144
E.db["general"]["minimap"]["locationFontSize"] = 10
E.db["general"]["minimap"]["locationFontOutline"] = "OUTLINE"
E.db["general"]["minimap"]["locationFont"] = "Merathilis Expressway"
......@@ -632,7 +632,6 @@ function MER:SetupLayout()
E.private["general"]["namefont"] = "Merathilis Expressway"
E.private["general"]["dmgfont"] = "Merathilis Expressway"
E.db["tooltip"]["healthBar"]["font"] = "Merathilis Expressway"
E.db["databars"]["experience"]["enable"] = false
E.db["databars"]["experience"]["mouseover"] = false
E.db["databars"]["experience"]["height"] = 146
......@@ -640,41 +639,46 @@ function MER:SetupLayout()
E.db["databars"]["experience"]["width"] = 8
E.db["databars"]["experience"]["textFormat"] = "NONE"
E.db["databars"]["experience"]["orientation"] = "VERTICAL"
E.db["databars"]["experience"]["hideAtMaxLevel"] = true
E.db["databars"]["experience"]["hideAtMaxLevel"] = false
E.db["databars"]["experience"]["hideInVehicle"] = true
E.db["databars"]["experience"]["hideInCombat"] = false
E.db["databars"]["reputation"]["enable"] = false
E.db["databars"]["reputation"]["enable"] = true
E.db["databars"]["reputation"]["mouseover"] = false
E.db["databars"]["reputation"]["height"] = 146
E.db["databars"]["reputation"]["textSize"] = 10
E.db["databars"]["reputation"]["width"] = 8
E.db["databars"]["reputation"]["textFormat"] = "NONE"
E.db["databars"]["reputation"]["orientation"] = "VERTICAL"
E.db["databars"]["reputation"]["height"] = 12
E.db["databars"]["reputation"]["font"] = "Merathilis Expressway"
E.db["databars"]["reputation"]["textSize"] = 9
E.db["databars"]["reputation"]["width"] = 401
E.db["databars"]["reputation"]["textFormat"] = "CURPERCREM"
E.db["databars"]["reputation"]["orientation"] = "HORIZONTAL"
E.db["databars"]["reputation"]["hideInVehicle"] = true
E.db["databars"]["reputation"]["hideInCombat"] = false
E.db["databars"]["reputation"]["hideInCombat"] = true
E.db["databars"]["honor"]["enable"] = false
E.db["databars"]["honor"]["height"] = 155
E.db["databars"]["honor"]["textSize"] = 11
E.db["databars"]["honor"]["hideOutsidePvP"] = true
E.db["databars"]["honor"]["hideInCombat"] = false
E.db["databars"]["azerite"]["enable"] = false
E.db["databars"]["azerite"]["height"] = 146
E.db["databars"]["azerite"]["textSize"] = 11
E.db["databars"]["azerite"]["width"] = 8
E.db["databars"]["azerite"]["enable"] = true
E.db["databars"]["azerite"]["height"] = 12
E.db["databars"]["azerite"]["font"] = "Merathilis Expressway"
E.db["databars"]["azerite"]["textSize"] = 9
E.db["databars"]["azerite"]["width"] = 401
E.db["databars"]["azerite"]["hideInVehicle"] = true
E.db["databars"]["azerite"]["hideInCombat"] = false
E.db["databars"]["azerite"]["orientation"] = "VERTICAL"
E.db["databars"]["azerite"]["hideInCombat"] = true
E.db["databars"]["azerite"]["mouseover"] = false
E.db["databars"]["azerite"]["orientation"] = "HORIZONTAL"
E.db["databars"]["azerite"]["textFormat"] = "CURPERCREM"
E.db["tooltip"]["healthBar"]["font"] = "Merathilis Expressway"
E.db["tooltip"]["font"] = "Merathilis Expressway"
E.db["tooltip"]["fontOutline"] = "NONE"
E.db["tooltip"]["headerFontSize"] = 12
E.db["tooltip"]["textFontSize"] = 11
E.db["tooltip"]["smallTextFontSize"] = 11
MER:SetMoverPosition("ArtifactBarMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -10, 50)
MER:SetMoverPosition("AzeriteBarMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -10, 50)
MER:SetMoverPosition("AzeriteBarMover", "TOP", E.UIParent, "TOP", 0, -46)
MER:SetMoverPosition("TotemBarMover", "BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 503, 12)
MER:SetMoverPosition("HonorBarMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -531, 21)
MER:SetMoverPosition("ExperienceBarMover", "BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 1, 50)
MER:SetMoverPosition("ReputationBarMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -19, 50)
MER:SetMoverPosition("ReputationBarMover", "TOP", E.UIParent, "TOP", 0, -59)
MER:SetMoverPosition("MinimapMover", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -10, 51)
MER:SetMoverPosition("mUI_RaidMarkerBarAnchor", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -277, 178)
......@@ -825,7 +829,7 @@ function MER:SetupActionbars(layout)
if layout == "dps" then
MER:SetMoverPosition("ElvAB_1", "BOTTOM", E.UIParent, "BOTTOM", 0, 144)
MER:SetMoverPosition("ElvAB_2", "BOTTOM", E.UIParent, "BOTTOM", 0, 183)
MER:SetMoverPosition("ElvAB_3", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -442, 50)
MER:SetMoverPosition("ElvAB_3", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", -446, 50)
MER:SetMoverPosition("ElvAB_4", "BOTTOMRIGHT", E.UIParent, "BOTTOMRIGHT", 0, 367)
MER:SetMoverPosition("ElvAB_5", "BOTTOMLEFT", E.UIParent, "BOTTOMLEFT", 438, 50)
MER:SetMoverPosition("ElvAB_6", "BOTTOM", E.UIParent, "BOTTOM", 0, 19)
......
......@@ -139,8 +139,6 @@ L["MISC_REPUTATION"] = "Ruf"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Ruf"
L["MISC_PARAGON_NOTIFY"] = "Maximaler Ruf - Belohnung abholen."
L["Progress Bar"] = "Fortschrittsleiste"
L["Shows Azerite/Honor/XP/Rep."] = "Zeigt Azerite/Ehre/EP/Ruf"
L["Skip Azerite Animation"] = "Überspringe Azerite Animation"
-- Tooltip
......
......@@ -142,8 +142,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -141,8 +141,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -141,8 +141,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -137,8 +137,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -139,8 +139,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -139,8 +139,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -139,8 +139,6 @@ L["MISC_REPUTATION"] = "Reputation"
L["MISC_PARAGON"] = "Paragon"
L["MISC_PARAGON_REPUTATION"] = "Paragon Reputation"
L["MISC_PARAGON_NOTIFY"] = "Max Reputation - Receive Reward."
L["Progress Bar"] = true
L["Shows Azerite/Honor/XP/Rep."] = true
L["Skip Azerite Animation"] = true
-- Tooltip
......
......@@ -37,12 +37,6 @@ local CreateFrame = CreateFrame
-- GLOBALS:
function module:StyleBackdrops()
-- Artifact
local artifact = _G["ElvUI_ArtifactBar"]
if artifact then
artifact:Styling()
end
--Azerite
local azerite = _G["ElvUI_AzeriteBar"]
if azerite then
......@@ -67,162 +61,13 @@ function module:StyleBackdrops()
reputation:Styling()
end
end
C_Timer_After(1, module.StyleBackdrops)
local function UpdateBar(bar)
local rest = bar.restBar
if rest then rest:Hide() end
if UnitLevel('player') < _G.MAX_PLAYER_LEVEL then
local xp, mxp, rxp = UnitXP('player'), UnitXPMax('player'), GetXPExhaustion()
bar:SetStatusBarColor(79/250, 167/250, 74/250)
bar:SetMinMaxValues(0, mxp)
bar:SetValue(xp)
bar:Show()
if rxp then
rest:SetMinMaxValues(0, mxp)
rest:SetValue(min(xp + rxp, mxp))
rest:Show()
end
if IsXPUserDisabled() then bar:SetStatusBarColor(.7, 0, 0) end
elseif C_AzeriteItem_HasActiveAzeriteItem() then
local azeriteItemLocation = C_AzeriteItem_FindActiveAzeriteItem()
local xp, totalLevelXP = C_AzeriteItem_GetAzeriteItemXPInfo(azeriteItemLocation)
bar:SetStatusBarColor(.9, .8, .6)
bar:SetMinMaxValues(0, totalLevelXP)
bar:SetValue(xp)
bar:Show()
else
bar:Hide()
end
end
local function UpdateTooltip(bar)
GameTooltip:SetOwner(_G.Minimap, 'ANCHOR_NONE')
GameTooltip:SetPoint('TOPRIGHT', _G.Minimap, 'TOPLEFT', -4, -(E.db.general.minimap.size/8*E.mult)-6)
GameTooltip:AddLine(MER.Title..L["Progress Bar"], 1, 1, 1)
GameTooltip:AddLine(' ')
local r, g, b = unpack(E["media"].rgbvaluecolor)
if UnitLevel('player') < _G.MAX_PLAYER_LEVEL then
GameTooltip:AddLine(LEVEL..' '..UnitLevel('player'), r, g, b)
local xp, mxp, rxp = UnitXP('player'), UnitXPMax('player'), GetXPExhaustion()
GameTooltip:AddDoubleLine(XP, xp..' / '..mxp..' ('..floor(xp/mxp*100)..'%)', 1, 1, 1, 1, 1, 1)
if rxp then
GameTooltip:AddDoubleLine(TUTORIAL_TITLE26, '+'..rxp..' ('..floor(rxp/mxp*100)..'%)', 1, 1, 1, 1, 1, 1)
end
if IsXPUserDisabled() then GameTooltip:AddLine('|cffff0000'..XP..LOCKED) end
end
if C_AzeriteItem_HasActiveAzeriteItem() then
local azeriteItemLocation = C_AzeriteItem_FindActiveAzeriteItem()
local azeriteItem = Item:CreateFromItemLocation(azeriteItemLocation)
local xp, totalLevelXP = C_AzeriteItem_GetAzeriteItemXPInfo(azeriteItemLocation)
local currentLevel = C_AzeriteItem_GetPowerLevel(azeriteItemLocation)
azeriteItem:ContinueWithCancelOnItemLoad(function()
local azeriteItemName = azeriteItem:GetItemName()
if UnitLevel('player') < _G.MAX_PLAYER_LEVEL then
GameTooltip:AddLine(' ')
end
GameTooltip:AddLine(azeriteItemName..' ('..format(SPELLBOOK_AVAILABLE_AT, currentLevel)..')', 247/255, 225/255, 171/255)
GameTooltip:AddDoubleLine(ARTIFACT_POWER, BreakUpLargeNumbers(xp)..' / '..BreakUpLargeNumbers(totalLevelXP)..' ('..floor(xp/totalLevelXP*100)..'%)', 1, 1, 1, 1, 1, 1)
end)
end
if GetWatchedFactionInfo() then
local name, standing, barMin, barMax, value, factionID = GetWatchedFactionInfo()
local friendID, _, _, _, _, _, friendTextLevel, _, nextFriendThreshold = GetFriendshipReputation(factionID)
local currentRank, maxRank = GetFriendshipReputationRanks(friendID)
local standingtext
if friendID then
if maxRank > 0 then
name = name..' ('..currentRank..' / '..maxRank..')'
end
if not nextFriendThreshold then
value = barMax - 1
end
standingtext = friendTextLevel
else
if standing == _G.MAX_REPUTATION_REACTION then
barMax = barMin + 1e3
value = barMax - 1
end
standingtext = GetText('FACTION_STANDING_LABEL'..standing, UnitSex('player'))
end
GameTooltip:AddLine(' ')
GameTooltip:AddLine(name, 62/250, 175/250, 227/250)
if C_Reputation_IsFactionParagon(factionID) then
local currentValue, threshold = C_Reputation_GetFactionParagonInfo(factionID)
local paraCount = floor(currentValue/threshold)
currentValue = mod(currentValue, threshold)
GameTooltip:AddDoubleLine(L["MISC_PARAGON"]..' ('..paraCount..')', currentValue..' / '..threshold..' ('..floor(currentValue/threshold*100)..'%)', 1, 1, 1, 1, 1, 1)
else
GameTooltip:AddDoubleLine(standingtext, value - barMin..' / '..barMax - barMin..' ('..floor((value - barMin)/(barMax - barMin)*100)..'%)', 1, 1, 1, 1, 1, 1)
end
end
if IsWatchingHonorAsXP() then
local current, barMax, level = UnitHonor('player'), UnitHonorMax('player'), UnitHonorLevel('player')
GameTooltip:AddLine(' ')
GameTooltip:AddLine(HONOR, 177/250, 19/250, 0)
GameTooltip:AddDoubleLine(LEVEL..' ('..level..')', current..' / '..barMax..' ('..floor(current/barMax*100)..'%)', 1, 1, 1, 1, 1, 1)
end
GameTooltip:Show()
end
local function OnLeave()
GameTooltip:Hide()
end
function module:SetupScript(bar)
bar.eventList = {
'PLAYER_XP_UPDATE',
'PLAYER_LEVEL_UP',
'UPDATE_EXHAUSTION',
'PLAYER_ENTERING_WORLD',
'UPDATE_FACTION',
'ARTIFACT_XP_UPDATE',
'UNIT_INVENTORY_CHANGED',
'ENABLE_XP_GAIN',
'DISABLE_XP_GAIN',
'AZERITE_ITEM_EXPERIENCE_CHANGED',
'HONOR_XP_UPDATE',
}
for _, event in pairs(bar.eventList) do
bar:RegisterEvent(event)
end
bar:SetScript('OnEvent', UpdateBar)
bar:SetScript('OnEnter', UpdateTooltip)
bar:SetScript('OnLeave', OnLeave)
end
function module:Initialize()
module.db = E.db.mui.databars
MER:RegisterDB(self, "databars")
if module.db.progressbar ~= true or E.private.general.minimap.enable ~= true then return end
local bar = CreateFrame('StatusBar', nil, _G.Minimap)
bar:SetPoint('BOTTOM', _G.Minimap, 'TOP', 0, 1)
bar:SetSize(E.db.general.minimap.size*E.mult, 3)
bar:SetStatusBarTexture(E.media.normTex)
bar:CreateBackdrop(nil, true)
bar:SetHitRectInsets(0, 0, -10, -10)
E:RegisterStatusBar(bar)
local resting = CreateFrame('StatusBar', nil, bar)
resting:SetAllPoints()
resting:SetStatusBarTexture(E.media.normTex)
resting:SetStatusBarColor(105/250, 194/250, 221/250, .9)
resting:SetFrameLevel(bar:GetFrameLevel() - 1)
bar.restBar = resting
self:SetupScript(bar)
C_Timer_After(1, module.StyleBackdrops)
end
MER:RegisterModule(module:GetName())
......@@ -20,12 +20,6 @@ local function databarsTable()
type = "header",
name = MER:cOption(L["DataBars"]),
},
progressbar = {
order = 2,
type = "toggle",
name = E.NewSign..L["Progress Bar"],
desc = L["Shows Azerite/Honor/XP/Rep."],
},
},
}
end
......
......@@ -89,9 +89,7 @@ MP.notification = {
paragon = true,
}
MP.databars = {
progressbar = true,
}
MP.databars = {}
MP.datatexts = {
panels = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment