When you're setting up an avatar, the glasses and animal ears should have a "none" option the way that the other items (for example, ponytails) do. This should be the case in the tutorial setup and in the normal user detail modal.
_edit by Alys:_ ~Mustaches need a "none" option too.~ UPDATE: that's fixed.
Hi, @lemoness ! Could you assign this for me? I'm not familiarized with the underlying technologies, but I can, at least, try. A bounty hunter here, and the bounty is a humble hacktoberfest T-Shirt :smile: !
@edgardmota Thank you! Please go ahead! You're welcome to comment here if you have any questions or run into any trouble.
I'm also adding mustaches to the list of things that need a "none" option. We recently added a none option for beards, but mustaches need their own. The user's setting for that is stored in preferences.hair.mustache.
The code for the beards might be a good place for you to look to get a start on working out how to fix this. :)
Thanks, @Alys, I'll do my best and I'll ask for help if I get in trouble...
The mustache problem is being fixed in https://github.com/HabitRPG/habitica/pull/9604
The fix for the mustache is on staging and working well.
Strictly speaking, the animal ears and glasses are fixed too because they don't need a "none" option - when you're wearing one you can just tap it to unequip it, the same as you can for equipment (and in fact those items are equipment even though they also appear in the Edit Avatar section).
However since they do appear in that section, it does seem confusing that they don't have a "none" option because all the other avatar customisations have one. A new user who doesn't yet know about equipment won't realise they can tap on the item to dequip it. So I'm reopening this but I'm reducing it to a minor priority.
I can implement the solution for the rest of them :)
Yay, it's yours! :)
I was just wondering, if I do a pull, will I already see your mustache solution? As it's only on staging, I wasn't sure.
Yes, the staging website uses the code in the develop branch, so pulling will put that solution in your local install."
Okay, I'm fairly stuck on this one. Too many different options in equipment vs costume, I think. Still trying, but might still take a good while. Any hints/pokes in the right direction appreciated. Sorry!
Don't be sorry! As you say, it's complex.
Considering glasses:
The current code is:
https://github.com/HabitRPG/habitica/blob/9545f692efdbea7ff4980c0c7ce20534585363e2/website/client/components/creatorIntro.vue#L203-L206
and:
https://github.com/HabitRPG/habitica/blob/9545f692efdbea7ff4980c0c7ce20534585363e2/website/client/components/creatorIntro.vue#L1022-L1036
So the glasses are blackTopFrame, etc. If you're wearing the black one as a Costume piece, that's stored in your user data as:
"items.gear.costume.eyewear": "eyewear_special_blackTopFrame"
If you're wearing it as Battle Gear, it's:
"items.gear.equipped.eyewear": "eyewear_special_blackTopFrame"
If you weren't using any eyewear, you'd see these in your data:
"items.gear.costume.eyewear": "eyewear_base_0"
"items.gear.equipped.eyewear": "eyewear_base_0"
I.e., there's a special "equipment piece" called eyewear_base_0 which is equipped when the user is not actually wearing eyewear. (Similar things are done for weapons, shields, etc. E.g., weapon_base_0, shield_base_0 when you're not using a weapon or shield.)
So what will probably fix this issue is adding a blank option to the start of the eyewear list (e.g., using the empty head image from the Flower screen), and then make it so that when you click the blank option, it "equips" the eyewear_base_0 gear piece (in the same way that clicking the black glasses would equip eyewear_special_blackTopFrame).
It might be enough to just add eyewear_base_0 to the keys array in that second piece of code and add a bit of extra code to deal with the fact that eyewear_base_0 and eyewear_special_blackTopFrame / blackTopFrame use slightly different naming schemes. It might turn out to be more complex than that though, since that eyewear_base_0 item doesn't exist in the same way as the actual glasses do. Don't be afraid to adjust the existing code if needed (for example, it might be simplest to change the current keys array so that it contains the items spelt out in full (use eyewear_special_blackTopFrame instead of blackTopFrame) - eyewear_base_0 would then be consistent if placed directly in the array. But there might be a better way to do this so don't feel that you have to follow that suggestion!
One possible complexity is that ideally we still want people to be able to un-equip the glasses by clicking on them again (so the user has a choice for unequipping: click the equipped item or click the blank item). If you clicked on the blank icon to "equip" eyewear_base_0 and then you clicked on the blank icon again, you'd want to make sure that the code did not "un-equip" eyewear_base_0 since that would be a meaningless change and might result in an error message. Or it might just work perfectly - I'm just guessing now. :) It's something to test though.
The Animal Ears work similarly. They are considered "head accessories". Sample data:
"items.gear.costume.headAccessory": "headAccessory_base_0",
"items.gear.costume.headAccessory": "headAccessory_special_cactusEars",
"items.gear.equipped.headAccessory": "headAccessory_base_0",
"items.gear.equipped.headAccessory": "headAccessory_special_cactusEars",
Tell me if that doesn't make sense!
@Feywood Hi there, are you still working on this issue? Please let us know. Thank you!
Hi @beffymaroo I'll have to drop this one. Too much on my plate. Sorry!
@Feywood Thanks for the update!
This has been fixed in https://github.com/HabitRPG/habitica/pull/11539