HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
12k stars 4.09k forks source link

Need different messages for losing and spending Gold/Mana #9222

Open lemoness opened 7 years ago

lemoness commented 7 years ago

Right now, whenever your Gold count goes down, you are told that you "spent" the Gold. This is correct if you buy an item, but inaccurate if your Gold count goes down for any other reason (for example, dying or unticking a completed task). In those cases, a different message should appear, telling you that you "lost" your Gold.

Likewise, there should be a difference with "spending Mana" (when using a skill) and "losing Mana" (when clicking a negative Habit, for example).

Edited to add examples: "You spent X Gold" vs "You lost X Gold" "You spent X Mana" vs "You lost X Mana"

Alys commented 7 years ago

@mtrivera Thank you! it's yours. Comment here if you have questions or find problems.

SabreCat commented 7 years ago

@mtrivera, you can use develop instead of master when following those instructions!

SabreCat commented 7 years ago

@mtrivera: Sorry to hear it! If you get some distance and feel like trying again sometime, the Aspiring Blacksmiths Guild is a good place to go for setup help re: Habitica dev environments.

LunarGem commented 7 years ago

I could try and mess with this.

lemoness commented 7 years ago

@LunarGem Thank you very much! That would be very helpful. Let us know if you have any questions.

I've updated the labels on this issue.

librarianmage commented 6 years ago

@LunarGem How are you doing with this? Would you like some assistance?

LunarGem commented 6 years ago

@MathWhiz You can take it. I guess I overreached myself during an easier section of school. I'll probably give up on most of the issues I've taken that I haven't made significant progress on.

librarianmage commented 6 years ago

Oh, I'm too busy to take it up as well, I just want to make sure that Issues are being worked on. On Sun, Dec 3, 2017 at 8:40 PM LunarGem notifications@github.com wrote:

@MathWhiz https://github.com/mathwhiz You can take it. I guess I overreached myself during an easier section of school. I'll probably give up on most of the issues I've taken that I haven't made significant progress on.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/HabitRPG/habitica/issues/9222#issuecomment-348846160, or mute the thread https://github.com/notifications/unsubscribe-auth/ALz_8-cWeru14qn07Xdryf14xtwGaLY0ks5s81uAgaJpZM4P9C4x .

Alys commented 6 years ago

I've adjusted the labels. Thanks for letting us know @LunarGem @MathWhiz !

fentie commented 6 years ago

It appears regardless of the coding outcome, this will require some extra localized strings. Should this have a type: translations label as well or would that be a separate, linked issue?

Alys commented 6 years ago

@fentie No need for either! :) Localised strings are added to the /en/ directory only, then those files are uploaded to Transifex where the translators fill in all the other languages. Until that's done, the en strings are automatically used by default for all languages. See the _README files in the non-en directories for more details. The "type: translations" label is used for coding issues related to translations or ways that Habitica needs to be modified to make translations easier / more possible.

actuday6418 commented 4 years ago

@Alys, I'd like to work on this. Seems to be a decent beginner's issue. Could you give a quick brief on which direction to take, being new to habitica's code base?

Alys commented 4 years ago

@actuday6418 Actually due to the way that stats change notifications are created, this one is pretty difficult, maybe even impossible without a significant rewrite of part of our code. I realise it might not look like that on the surface so I'm sorry it was misleading!

The good first issue label is a good one to follow for easy issues, although at the moment both of the ones there are in progress or on hold.

The medium level coding is another label to watch. There's some there with the "help wanted" label too (scroll down to find them all). If you see one that looks good, post to it and we'll chat there. :) (Since you're new, you might want to ignore the "Profiles are not displaying avatars or health/mana/experience bars" issue because we want a quick fix for that, so if you're still setting up your local install or getting familiar with the code base, that might not be the best one to start with.)

zachflower commented 1 year ago

Reviving this issue because it seemed like an interesting problem.

Out of curiosity, I took a look at the code path and, because a single event is triggered upon the gain or loss of gold/mana/experience/etc, there isn't really a clear distinction between voluntarily or involuntarily losing something (i.e. "lost" vs. "spent"):

Notification Calculation

https://github.com/HabitRPG/habitica/blob/6bea232d475b78c4b2fd44797fd373b78b99333d/website/client/src/components/notifications.vue#L374-L402

Notification Text Determination

https://github.com/HabitRPG/habitica/blob/6bea232d475b78c4b2fd44797fd373b78b99333d/website/client/src/components/snackbars/notification.vue#L250-L268

@Alys hit the nail on the head that this is a deceptively complex problem that would require a rewrite (and it begs the question if it's worth the effort required).

I'm curious if a copy change would introduce the right amount of ambiguity to at least make the messaging more accurate? Statements similar to You are X gold poorer might accomplish the same goal without necessitating any major rewrites (it was the same approach we took back in the old MUD days for a similar situation).

Thoughts?