File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed
Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff 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" ],
248261
249262function 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
Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ L["showPer"] = "XP Percentage"
105105L [" showPerDesc" ] = " When enabled, module will show the XP in percent."
106106L [" shortXP" ] = " Short XP"
107107L [" 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
110112L [" Bag" ] = " Bag"
You can’t perform that action at this time.
0 commit comments