HabitRPG / habitica

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

Key to the Kennels is not showing for users who are eligible #9243

Closed lemoness closed 6 years ago

lemoness commented 6 years ago

Key to the Kennels is not showing for users who are eligible. It should be restored to the Market.

Alys commented 6 years ago

When the Key to the Kennels has been used, the player should be redirected to the Inventory > Stable page so that they can confirm that the Key was successful.

borisabramovich86 commented 6 years ago

Hey, can I work on this one?

lemoness commented 6 years ago

@borisabramovich86 That would be very helpful, thank you! Let us know if you have any questions.

I've updated the labels on this ticket.

borisabramovich86 commented 6 years ago

@Alys @lemoness @SabreCat

Hey, so from looking at Key to the Kennels documentation, I see that there are a few scenarios (Like release pets, release both etc).

I see those options in the API, but not in the site client. from what I understand:

  1. You buy the key
  2. It appears in your inventory in the Special section (?) Or do is it used the moment you buy it?
  3. there is supposed to be a modal showing the usage options.

I can't find the key item anywhere, so I added

case 'pet_key': {
      itemInfo = {
        key: 'pet_key',
        purchaseType: 'pet_key',
        class: 'pet_key',
        text: i18n.t('petKeyName'),
        notes: i18n.t('petKeyPop'),
        value: user.stats.lvl < 100 ? 4 : 0,
        currency: 'gems',
        path: 'special.pet_key',
        pinType: 'pet_key',
        locked: !user.achievements.beastMaster,
      };
      break;
    }

here https://github.com/HabitRPG/habitica/blob/12fd79059b09f258bf9f7d54415180f03a2c8ba8/website/common/script/libs/getItemInfo.js#L304

and added the item to the special items here https://github.com/HabitRPG/habitica/blob/12fd79059b09f258bf9f7d54415180f03a2c8ba8/website/client/components/shops/market/index.vue#L515

if (this.user.achievements.beastMaster) {
            let keyItem = getItemInfo(this.user, 'pet_key');

            specialItems.push({
              showCount: false,
              ...keyItem,
            });
          }

So if you can elaborate some more on what is expected, I'll really appreciate it. Thanks! :)

screen shot 2017-11-05 at 9 57 59 am

screen shot 2017-11-05 at 9 58 05 am

Alys commented 6 years ago

@borisabramovich86 Your code ideas look good to me although I'm not as familiar with our new website code as the other admins so listen to them not me if they give feedback. :)

However I can tell you for sure that the key is used the moment you buy it (it does not appear in your inventory after purchase). There is a modal showing the usage options, with buttons to choose which option you want.

These are the strings that were used on the old website and they still exists in the locales/en files so you can reuse them in your PR:

"petKeyName": "Key to the Kennels",

"petKeyBegin": "Key to the Kennels: Experience <%= title %> Once More!",

"petKeyInfo2": "Use the Key to the Kennels to reset your non-quest collectible pets and/or mounts to zero. (Quest-only and Rare pets and mounts are not affected.)",

"petKeyInfo3": "There are three Keys to the Kennels: Release Pets Only (4 Gems), Release Mounts Only (4 Gems), or Release Both Pets and Mounts (6 Gems). Using a Key lets you stack the Beast Master and Mount Master achievements. The Triad Bingo achievement will only stack if you use the \"Release Both Pets and Mounts\" key and have collected all 90 pets a second time. Show the world just how much of collection master you are! But choose wisely, because once you use a Key and open the kennel or stable doors, you won't be able to get them back without collecting them all again...",

"petKeyInfo4": "There are three Keys to the Kennels: Release Pets Only (4 Gems), Release Mounts Only (4 Gems), or Release Both Pets and Mounts. Using a Key lets you stack the Beast Master and Mount Master achievements. The Triad Bingo achievement will only stack if you use the \"Release Both Pets and Mounts\" key and have collected all 90 pets a second time. Show the world just how much of collection master you are! But choose wisely, because once you use a Key and open the kennel or stable doors, you won't be able to get them back without collecting them all again...",

petKeyInfo3 is shown if you do not own all 90 pets and mounts; petKeyInfo4 is shown if you do.

These files contain the code that does the actual releasing of pets and mounts:

negue commented 6 years ago

@borisabramovich86 Could you create a PR for your changes then we can test & review them easier

borisabramovich86 commented 6 years ago

@negue Hey, I'll try to create one this week. I haven't finished working on this one yet, but I hope to finish in the next few days, If that's ok. When I'm done, I'll create a PR, no problem.

Alys commented 6 years ago

@borisabramovich86 How are you going with this? It's a highly requested feature so if you're having any trouble with it, let us know what you're up to and we'll be happy to help. You'd be welcome to submit a PR if you have code that you'd like us to look at, even if it isn't finished.

borisabramovich86 commented 6 years ago

@Alys Hey, sorry for the delay, but unfortunately I won't be able to continue with this ticket. :/

All I have right now is the code I showed in the comments above.

I think it's also not so clear If the options for the release (pet, mount, both) appear in the item Buy Modal, or another Modal that comes after it?

Again, sorry for the delay.

DazoTrove commented 6 years ago

@borisabramovich86 The Wikia page for Key to the Kennels explains the three options and has some screenshots from before the redesign. I think the options should either be displayed as part of the Buy Modal since they have different costs, or should be three separate items on the Market page.

Today I just completed the Triad Bingo achievement and looked for the Key to the Kennels in the Market and Wikia page and found this issue.

Alys commented 6 years ago

@borisabramovich86 No worries, thanks for letting us know!

@DazoTrove Thanks for adding those notes! That's useful.

TheHollidayInn commented 6 years ago

@lemoness or @Tressley Can we get direction on this for the UI/UX. There are three Key to Kennels (technically speaking). Can you let us know how to present this? 2 comments above shows the options.

Tressley commented 6 years ago

@TheHollidayInn -- I have an idea on how to handle this, but I still need to review with the team. Will update when I get a clearer direction.

Alys commented 6 years ago

I'm reopening this for bug fixes to the change currently in staging:

TheHollidayInn commented 6 years ago

This should be removed on staging, and I'll continue the fixes in a new PR.

Alys commented 6 years ago

I've made text changes in https://github.com/HabitRPG/habitica/commit/9b19477e2f24ddf4d259004dece8bcd426061b13

For reference, this is the commit that disabled the user interface elements for this new code: https://github.com/HabitRPG/habitica/commit/3000e2b72cfae3a0033a497aadabf207c231f495