Commit 02d04ee4 authored by Azilroka's avatar Azilroka
Browse files

Quest XP Percent Toggle

parent bac89760
......@@ -32,6 +32,28 @@ local function PostBNToastMove(mover)
_G.BNToastFrame:Point(anchorPoint, mover)
end
function B:QuestXPPercent()
if not E.db.general.questXPPercent then return end
local unitXP, unitXPMax = UnitXP('player'), UnitXPMax('player')
if _G.QuestInfoFrame.questLog then
local selectedQuest = C_QuestLog_GetSelectedQuest()
if C_QuestLog_ShouldShowQuestRewards(selectedQuest) then
local xp = GetQuestLogRewardXP()
if xp and xp > 0 then
local text = _G.MapQuestInfoRewardsFrame.XPFrame.Name:GetText()
if text then _G.MapQuestInfoRewardsFrame.XPFrame.Name:SetFormattedText('%s (|cff4beb2c+%.2f%%|r)', text, (((unitXP + xp) / unitXPMax) - (unitXP / unitXPMax))*100) end
end
end
else
local xp = GetRewardXP()
if xp and xp > 0 then
local text = _G.QuestInfoXPFrame.ValueText:GetText()
if text then _G.QuestInfoXPFrame.ValueText:SetFormattedText('%s (|cff4beb2c+%.2f%%|r)', text, (((unitXP + xp) / unitXPMax) - (unitXP / unitXPMax))*100) end
end
end
end
function B:Initialize()
B.Initialized = true
......@@ -75,25 +97,7 @@ function B:Initialize()
end)
--Add (+X%) to quest rewards experience text
hooksecurefunc('QuestInfo_Display', function()
local unitXP, unitXPMax = UnitXP('player'), UnitXPMax('player')
if _G.QuestInfoFrame.questLog then
local selectedQuest = C_QuestLog_GetSelectedQuest()
if C_QuestLog_ShouldShowQuestRewards(selectedQuest) then
local xp = GetQuestLogRewardXP()
if xp and xp > 0 then
local text = _G.MapQuestInfoRewardsFrame.XPFrame.Name:GetText()
if text then _G.MapQuestInfoRewardsFrame.XPFrame.Name:SetFormattedText('%s (|cff4beb2c+%.2f%%|r)', text, (((unitXP + xp) / unitXPMax) - (unitXP / unitXPMax))*100) end
end
end
else
local xp = GetRewardXP()
if xp and xp > 0 then
local text = _G.QuestInfoXPFrame.ValueText:GetText()
if text then _G.QuestInfoXPFrame.ValueText:SetFormattedText('%s (|cff4beb2c+%.2f%%|r)', text, (((unitXP + xp) / unitXPMax) - (unitXP / unitXPMax))*100) end
end
end
end)
B:SecureHook('QuestInfo_Display', 'QuestXPPercent')
-- MicroButton Talent Alert
local TalentMicroButtonAlert = _G.TalentMicroButtonAlert
......
......@@ -32,6 +32,7 @@ P.general = {
objectiveTracker = true,
resurrectSound = false,
questRewardMostValueIcon = true,
questXPPercent = true,
itemLevel = {
displayCharacterInfo = true,
displayInspectInfo = true,
......@@ -2375,13 +2376,13 @@ E.LayoutMoverPositions = {
ShiftAB = "BOTTOM,ElvUIParent,BOTTOM,0,58",
ElvUF_Raid40Mover = "BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,269",
ElvUF_RaidMover = "BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,269",
ElvUF_PartyMover = "BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,269",
ElvUF_PartyMover = "BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,269",
HonorBarMover = "TOPRIGHT,ElvUIParent,TOPRIGHT,-2,-251",
ReputationBarMover = "TOPRIGHT,ElvUIParent,TOPRIGHT,-2,-243"
},
dpsCaster = {
ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243',
ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97',
ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97',
},
healer = {
ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243',
......
......@@ -860,6 +860,11 @@ E.Options.args.general = {
name = L["Mark Quest Reward"],
desc = L["Marks the most valuable quest reward with a gold coin."],
},
questXPPercent = {
order = 13,
type = 'toggle',
name = L["XP Quest Percent"],
},
itemLevelInfo = {
order = 14,
name = L["Item Level"],
......
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