mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-26 18:52:37 +01:00
New method added to displaying locked quest popover message in shop (#10346)
isBuyingDependentOnPrevious () method checks if item.key of quest is in a list of quests whose unlock condition is not dependent on the completition of previous quest.
This commit is contained in:
committed by
Matteo Pagliazzi
parent
6c64a1cd8c
commit
38d78de4b3
@@ -139,7 +139,7 @@
|
||||
h4.popover-content-title(v-else) {{ item.text }}
|
||||
.popover-content-text(v-if='item.locked && item.key === "lostMasterclasser1"') {{ `${$t('questUnlockLostMasterclasser')}` }}
|
||||
.popover-content-text(v-if='item.locked && item.unlockCondition && item.unlockCondition.incentiveThreshold') {{ `${$t('loginIncentiveQuest', {count: item.unlockCondition.incentiveThreshold})}` }}
|
||||
.popover-content-text(v-if='item.locked && item.previous') {{ `${$t('unlockByQuesting', {title: item.previous})}` }}
|
||||
.popover-content-text(v-if='item.locked && item.previous && isBuyingDependentOnPrevious(item)') {{ `${$t('unlockByQuesting', {title: item.previous})}` }}
|
||||
.popover-content-text(v-if='item.lvl > user.stats.lvl') {{ `${$t('mustLvlQuest', {level: item.lvl})}` }}
|
||||
questInfo(v-if='!item.locked', :quest="item")
|
||||
|
||||
@@ -486,6 +486,11 @@ export default {
|
||||
|
||||
this.$root.$emit('bv::show::modal', 'buy-quest-modal');
|
||||
},
|
||||
isBuyingDependentOnPrevious (item) {
|
||||
let questsNotDependentToPrevious = ['moon2', 'moon3'];
|
||||
if (item.key in questsNotDependentToPrevious) return false;
|
||||
return true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user