Thread Tools Display Modes
07-10-15, 09:03 PM   #1
meribold
A Murloc Raider
 
meribold's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2013
Posts: 5
Getting the player character's hair color

Is it possible to query which hair color the player's character is currently using? I haven't even found anything that returns this information while interacting with a barber shop.
  Reply With Quote
07-10-15, 09:22 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
If the cost is 0, that's the current color.

(There may be another way, but that's how you can tell.)
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-11-15, 09:18 AM   #3
meribold
A Murloc Raider
 
meribold's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2013
Posts: 5
Originally Posted by Leatrix View Post
You could use this while the barbershop is open:
Code:
/run print(GetBarberShopStyleInfo(2))
The fourth return will be true if the currently showing hair color matches the one that your character is using, otherwise it will be false. You can get more information here.
I will test that again when I get home, but iirc the first return value of GetBarberShopStyleInfo(2) was nil when I tried it. So I can only find out if the current hair color matches the one selected at the barber shop, but still don't know which one that is.
  Reply With Quote
07-11-15, 07:51 PM   #4
meribold
A Murloc Raider
 
meribold's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2013
Posts: 5
/run print(GetBarberShopStyleInfo(2)) returns
Code:
nil nil 111734 true
[Edit] 111734 is the cost of changing the hair color; it doesn't matter if the used hair color is the same as the selected one. The 4th return value is true if the hair colors are the same. Nothing indicates the actual color, though.

Last edited by meribold : 07-11-15 at 07:55 PM.
  Reply With Quote
07-12-15, 06:51 AM   #5
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Does this help? See the code example at the bottom. For the second link, see if it works similarly to the first.
  Reply With Quote
07-12-15, 09:52 AM   #6
meribold
A Murloc Raider
 
meribold's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2013
Posts: 5
Originally Posted by myrroddin View Post
Does this help? See the code example at the bottom. For the second link, see if it works similarly to the first.
That returns a string indicating what "hair" customization means for your character's race. Either "NORMAL" or "HORNS". The example shows how you get a localized description, e.g., "Hair Style" or "Hair Color".
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Getting the player character's hair color


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