25 - Display Rank and Renown Rank in xp and rp labels
This tiny modification adds current rank and renown rank in xp label and rp label.
Modified labels will look like these:
R:19 123456/234567 (52.63%)
RR:16 4567/9876 (64.24%)
=== Patch ===
In WaaaghBar_Stats.lua change OnPlayerRenownUpdated and OnPlayerExperienceUpdated as follow (will provide a diff if requested, but I don't think it's necessary) :)
function Stats.OnPlayerRenownUpdated()
local curRenownRank = GameData.Player.Renown.curRank
local curRenownEarned = GameData.Player.Renown.curRenownEarned
local curRenownNeeded = GameData.Player.Renown.curRenownNeeded
local curRenownPrcent = curRenownEarned / curRenownNeeded * 100
Stats.Rnw:SetText(towstring(string.format("RR %i: %i / %i (%.2f%%)", curRenownRank, curRenownEarned, curRenownNeeded, curRenownPrcent)))
end
function Stats.OnPlayerExperienceUpdated()
local curRank = GameData.Player.level
local curExperienceEarned = GameData.Player.Experience.curXpEarned
local curExperienceNeeded = GameData.Player.Experience.curXpNeeded
local curExperiencePrcent = curExperienceEarned / curExperienceNeeded * 100
Stats.Exp:SetText(towstring(string.format("R %i: %i / %i (%.2f%%)", curRank, curExperienceEarned, curExperienceNeeded, curExperiencePrcent)))
end
| User | When | Change |
|---|---|---|
| Elder82 | Thu, 09 Oct 2008 08:29:03 | Changed description:This tiny modification adds current rank and renown rank in xp label and rp label. Modified labels will look like these: - R:19 123456/234567 + R:19 123456/234567 (52.63%) - RR:16 4567/9876 + RR:16 4567/9876 (64.24%) === Patch === |
| Elder82 | Thu, 09 Oct 2008 08:26:37 | Create |
- 8 comments
- 8 comments
Facts
- Last updated on
- 25 Oct 2008
- Reported on
- 09 Oct 2008
- Status
- New - Issue has not had initial review yet.
- Type
- Patch - Source code patch for review
- Priority
- Medium - Normal priority.
- #8
Elder82 Sun, 26 Oct 2008 10:44:51I was thinking about tooltips: I wanted to give different tooltips to the two elements in Stats module, but I can't find a way. WindowRegisterCoreEventHandler(Stats.Exp.name, "OnMouseOver", "WaaaghBar.Stats.OnXpMouseOver") does not seem to work. :(
Adding the tooltip to the module gives the same tooltip for xp and rp, so we should put in the same tooltip informations about xp (eg, rested xp) and rp (rank and title): I don't really like this... :(
Have anybody found a way to do this, apart from creating two separate modules?
- #7
Killbert Sat, 25 Oct 2008 17:16:04Note for Ben Logan:
I don't think your function is returning the right result. Your example shows the user with rank 23 and 3.64% into rank 24. It then shows the person having a rank of 23.4. I believe that should be 23.04 as 3.64% in decimal is 0.0364
I changed the function to this instead:
This would give 23.04.
- #6
phliptrip Wed, 22 Oct 2008 16:57:28I'd love to see this added soon.
- #5
encaitar Tue, 21 Oct 2008 21:36:14Didn't like the rank taking up space in the bar itself, so made a tooltip. This also gives the renown rank title (this is your default title if you do not select another).
Add to Stats.Intialize ...
And add the function ...
- #4
benlogan Mon, 13 Oct 2008 07:14:52To fix the percentage etc not being changed, all you have to do is widen it. The initial value of 200 isnt enuff.
Open up WaaghBar_Stats.lua and at lines 5 & 6you should fine this
Just add the new function (Stats.Convert) below the OnPlayerRenownUpdated function.
Should like something like this
- #3
debichu Sun, 12 Oct 2008 20:44:01Super! Thanks, it works flawlessly!
- #2
Elder82 Sun, 12 Oct 2008 09:53:05ops, that depends on the fact that the width of each module is currently fixed, stated at module creation. To enlarge it, go at the beginning of the same file (WaaaghBar_Stats.lua), lines 5-6, in function Stats.Initialize(), and change the first number inside the two calls to Stats.Waaagh:NewElement to a bigger size (it is the second parameter of the function call, the one between "Exp" and L"Exp") ^_^
I did not really noticed that, probably because when I tested it I had smaller numbers for xp :P
Hope in the future the size of an element will be variable size... but currently I don't know how to do that :(
- #1
debichu Sun, 12 Oct 2008 01:42:56Nice little thing.
Except. It's not completely showing percentage.
Screenshot:
Is it me who needs to adjust the width used by these two (if so, how?) or is this little "patch" not complete?