Thread Tools Display Modes
12-25-08, 07:48 AM   #1
Bris
A Deviate Faerie Dragon
Join Date: Dec 2008
Posts: 12
Exclamation Need help with modifying a simple exp addon!

I think the addon called PlayerExpBar is just perfect, except that you dont have an option for showing the remaining XP like this: 1343 k xp.

Could someone modify it a bit, so it will show the xp like that? You don't need to put any option for that or anything, but just to make its show the xp like that. Thanks.

(What a messy post, if you didn't understand something, just tell me )

Last edited by Bris : 12-27-08 at 06:01 AM.
  Reply With Quote
12-25-08, 09:15 PM   #2
Sepioth
A Molten Giant
AddOn Author - Click to view addons
Join Date: Apr 2005
Posts: 894
You want it to actually show XP left until next level right ..?

Last edited by Sepioth : 12-25-08 at 09:22 PM.
  Reply With Quote
12-26-08, 08:54 AM   #3
Bris
A Deviate Faerie Dragon
Join Date: Dec 2008
Posts: 12
Originally Posted by Sepioth View Post
You want it to actually show XP left until next level right ..?
It shows the XP left for next level but I want it to show it like "445k xp" instead of "445345"
  Reply With Quote
12-26-08, 11:03 AM   #4
Zirconium176
A Murloc Raider
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 7
Code:
"XP To Go: " .. (needXP - currXP) / 1000 .. "k" ..
Just skimmed through the code, not sure if modifying that line will change what you need, but I hope this gives you an idea of what to do.
  Reply With Quote
12-26-08, 02:09 PM   #5
questarey
A Defias Bandit
Join Date: Sep 2008
Posts: 2
You can also download xperl. At player options there is an option to show exp under your portrait. It shows up in xxxxk like you want
  Reply With Quote
12-26-08, 03:15 PM   #6
Psoewish
A Scalebane Royal Guard
 
Psoewish's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2008
Posts: 447
Originally Posted by questarey View Post
You can also download xperl. At player options there is an option to show exp under your portrait. It shows up in xxxxk like you want
Downloading a complete unitframe package just to show your remaining xp in short notation seems a bit silly to me.
This shouldn't be hard to edit at all, for someone that can code that is :P
  Reply With Quote
12-26-08, 04:31 PM   #7
Sepioth
A Molten Giant
AddOn Author - Click to view addons
Join Date: Apr 2005
Posts: 894
Originally Posted by Bris View Post
It shows the XP left for next level but I want it to show it like "445k xp" instead of "445345"
I didn't notice the option to show have it show how much xp remaining to your next level. It does show xp you have already gained/max xp needed for next level.

Anyway to abbreviate the text to show 445k / 500k instead of 445358 / 500000 all you need to do is edit a few things.

Open the PlayerExpBar.lua file.

-- Search for the following line function PlayerExpBar:PEB_handlePlayerEvent()

-- A few lines down you will see (%d/%d). Change that to (%dk/%dk) or (%dK/%dK) depending if you want upper or lowercase k.

-- Keep following that line and look for this UnitXP("player"),UnitXPMax("player")) ); change it to this UnitXP("player")/1000,UnitXPMax("player")/1000) );. Basically you will be adding /1000 right after the two instances of ("player") in that line.

-- Go down a few lines. You will see the exact same thing as the above two steps. DO the exact same thing. Change the (%d/%d). and add the /1000 after the two instances of ("player")

-- You can add the XP part too after the k you added after the %d.

Any troubles let me know. I'll try to help you any way I can.

Last edited by Sepioth : 12-26-08 at 04:34 PM.
  Reply With Quote
12-26-08, 04:34 PM   #8
Bris
A Deviate Faerie Dragon
Join Date: Dec 2008
Posts: 12
Originally Posted by Zirconium176 View Post
Code:
"XP To Go: " .. (needXP - currXP) / 1000 .. "k" ..
Just skimmed through the code, not sure if modifying that line will change what you need, but I hope this gives you an idea of what to do.
didn't find that line, can you tell me the number of this row?

Sepioth I have PlayerXPBarVersion = "2.3.1"; do you have an older or newer one?

Last edited by Bris : 12-26-08 at 04:37 PM.
  Reply With Quote
12-26-08, 04:47 PM   #9
Sepioth
A Molten Giant
AddOn Author - Click to view addons
Join Date: Apr 2005
Posts: 894
Originally Posted by Bris View Post
didn't find that line, can you tell me the number of this row?

Sepioth I have PlayerXPBarVersion = "2.3.1"; do you have an older or newer one?
I downloaded the version you linked above in you original post.
  Reply With Quote
12-27-08, 06:00 AM   #10
Bris
A Deviate Faerie Dragon
Join Date: Dec 2008
Posts: 12
Oh weird, PlayerXPBar is not the same as PlayerExpBar Well I don't remember where I downloaded it in the first place but I uploaded the version that I have: click.
  Reply With Quote
12-27-08, 01:49 PM   #11
Bris
A Deviate Faerie Dragon
Join Date: Dec 2008
Posts: 12
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need help with modifying a simple exp addon!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off