Skip to content

Commit 395a3e2

Browse files
committed
Updating experience module.
1 parent 15643eb commit 395a3e2

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

Elements/Experience.lua

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,24 @@ local function getOptions()
7272
desc = L["shortXPDesc"],
7373
order = 220,
7474
},
75+
onlyPer = {
76+
type = "toggle",
77+
name = L["onlyPer"],
78+
desc = L["onlyPerDesc"],
79+
order = 230,
80+
},
7581
dispHeader = {
7682
type = "header",
7783
name = L["DispSet"],
7884
order = 275,
7985
},
86+
secText = {
87+
type = "input",
88+
name = L["SecText"],
89+
desc = L["SecTextDesc"],
90+
width = "double",
91+
order = 300,
92+
},
8093
useGlobalFont = {
8194
type = "toggle",
8295
name = L["UseGblFont"],
@@ -248,7 +261,9 @@ end
248261

249262
function Experience:Refresh()
250263
local p_level = UnitLevel("player")
251-
if (p_level < 90) then
264+
if (p_level < 110) then
265+
local sec_text = db.secText
266+
252267
--get data
253268
local exp_cur = UnitXP("player")
254269
local exp_max = UnitXPMax("player")
@@ -303,14 +318,25 @@ function Experience:Refresh()
303318
exp_rest_per = ""
304319
end
305320

306-
if (db.showPer) then
321+
if (db.showPer and not db.onlyPer) then
307322
exp_cur_per = "("..exp_cur_per.."%%) "
323+
elseif (db.onlyPer) then
324+
exp_cur_per = exp_cur_per.."%%"
308325
else
309326
exp_cur_per = ""
310327
end
311328

329+
if string.len(sec_text) > 0 then
330+
local color = SLDataText:GetColor()
331+
sec_text = "|cff" .. color .. sec_text .. "|r "
332+
end
333+
312334
--post it
313-
self.string:SetFormattedText(exp_cur_per..""..exp_cur.." / "..exp_max .."".. exp_rest_per)
335+
if (db.onlyPer) then
336+
self.string:SetFormattedText(sec_text..exp_cur_per)
337+
else
338+
self.string:SetFormattedText(sec_text..exp_cur_per..""..exp_cur.." / "..exp_max .."".. exp_rest_per)
339+
end
314340

315341
SLDataText:UpdateModule(self)
316342
end

Locale/enUS.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ L["showPer"] = "XP Percentage"
105105
L["showPerDesc"] = "When enabled, module will show the XP in percent."
106106
L["shortXP"] = "Short XP"
107107
L["shortXPDesc"] = "When enabled, module will show the XP in a short version. (11,33M instead of 11333444)."
108+
L["onlyPer"] = "Only Percentage"
109+
L["onlyPerDesc"] = "When enabled, module will show only the percentage portion of the XP."
108110

109111
-- Bag Options
110112
L["Bag"] = "Bag"

0 commit comments

Comments
 (0)