mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
clarify change class code and remove incorrect confirmation step (#9099)
- prevent the user seeing a confirmation about paying 3 gems when enabling the class system (which is free) - rename changeClass function to changeClassForUser to avoid confusion with changeClass function - make change class confirmation translatable - changed "gems" to "Gems" in locales string
This commit is contained in:
@@ -36,9 +36,9 @@
|
|||||||
h6(v-once) {{ $t('class') + ': ' }}
|
h6(v-once) {{ $t('class') + ': ' }}
|
||||||
// @TODO: what is classText
|
// @TODO: what is classText
|
||||||
span(v-if='classText') {{ classText }}
|
span(v-if='classText') {{ classText }}
|
||||||
button.btn.btn-danger.btn-xs(@click='changeClass(null)', v-once) {{ $t('changeClass') }}
|
button.btn.btn-danger.btn-xs(@click='changeClassForUser(true)', v-once) {{ $t('changeClass') }}
|
||||||
small.cost 3
|
small.cost 3 {{ $t('gems') }}
|
||||||
span.Pet_Currency_Gem1x.inline-gems
|
// @TODO add icon span.Pet_Currency_Gem1x.inline-gems
|
||||||
hr
|
hr
|
||||||
|
|
||||||
div
|
div
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
|
|
||||||
button.btn.btn-primary(@click='showBailey()', popover-trigger='mouseenter', popover-placement='right', :popover="$t('showBaileyPop')") {{ $t('showBailey') }}
|
button.btn.btn-primary(@click='showBailey()', popover-trigger='mouseenter', popover-placement='right', :popover="$t('showBaileyPop')") {{ $t('showBailey') }}
|
||||||
button.btn.btn-primary(@click='openRestoreModal()', popover-trigger='mouseenter', popover-placement='right', :popover="$t('fixValPop')") {{ $t('fixVal') }}
|
button.btn.btn-primary(@click='openRestoreModal()', popover-trigger='mouseenter', popover-placement='right', :popover="$t('fixValPop')") {{ $t('fixVal') }}
|
||||||
button.btn.btn-primary(v-if='user.preferences.disableClasses == true', @click='changeClass({})',
|
button.btn.btn-primary(v-if='user.preferences.disableClasses == true', @click='changeClassForUser(false)',
|
||||||
popover-trigger='mouseenter', popover-placement='right', :popover="$t('enableClassPop')") {{ $t('enableClass') }}
|
popover-trigger='mouseenter', popover-placement='right', :popover="$t('enableClassPop')") {{ $t('enableClass') }}
|
||||||
|
|
||||||
hr
|
hr
|
||||||
@@ -378,8 +378,8 @@ export default {
|
|||||||
|
|
||||||
this.$router.go('/tasks');
|
this.$router.go('/tasks');
|
||||||
},
|
},
|
||||||
async changeClass () {
|
async changeClassForUser (confirmationNeeded) {
|
||||||
if (!confirm('Are you sure you want to change your class for 3 gems?')) return;
|
if (confirmationNeeded && !confirm(this.$t('changeClassConfirmCost'))) return;
|
||||||
try {
|
try {
|
||||||
changeClass(this.user);
|
changeClass(this.user);
|
||||||
await axios.post('/api/v3/user/change-class');
|
await axios.post('/api/v3/user/change-class');
|
||||||
|
|||||||
@@ -125,6 +125,7 @@
|
|||||||
"mystery": "Mystery",
|
"mystery": "Mystery",
|
||||||
"changeClass": "Change Class, Refund Attribute Points",
|
"changeClass": "Change Class, Refund Attribute Points",
|
||||||
"lvl10ChangeClass": "To change class you must be at least level 10.",
|
"lvl10ChangeClass": "To change class you must be at least level 10.",
|
||||||
|
"changeClassConfirmCost": "Are you sure you want to change your class for 3 Gems?",
|
||||||
"invalidClass":"Invalid class. Please specify 'warrior', 'rogue', 'wizard', or 'healer'.",
|
"invalidClass":"Invalid class. Please specify 'warrior', 'rogue', 'wizard', or 'healer'.",
|
||||||
"levelPopover": "Each level earns you one point to assign to an attribute of your choice. You can do so manually, or let the game decide for you using one of the Automatic Allocation options.",
|
"levelPopover": "Each level earns you one point to assign to an attribute of your choice. You can do so manually, or let the game decide for you using one of the Automatic Allocation options.",
|
||||||
"unallocated": "Unallocated Attribute Points",
|
"unallocated": "Unallocated Attribute Points",
|
||||||
@@ -158,7 +159,7 @@
|
|||||||
"respawn": "Respawn!",
|
"respawn": "Respawn!",
|
||||||
"youDied": "You Died!",
|
"youDied": "You Died!",
|
||||||
"dieText": "You've lost a Level, all your Gold, and a random piece of Equipment. Arise, Habiteer, and try again! Curb those negative Habits, be vigilant in completion of Dailies, and hold death at arm's length with a Health Potion if you falter!",
|
"dieText": "You've lost a Level, all your Gold, and a random piece of Equipment. Arise, Habiteer, and try again! Curb those negative Habits, be vigilant in completion of Dailies, and hold death at arm's length with a Health Potion if you falter!",
|
||||||
"sureReset": "Are you sure? This will reset your character's class and allocated points (you'll get them all back to re-allocate), and costs 3 gems.",
|
"sureReset": "Are you sure? This will reset your character's class and allocated points (you'll get them all back to re-allocate), and costs 3 Gems.",
|
||||||
"purchaseFor": "Purchase for <%= cost %> Gems?",
|
"purchaseFor": "Purchase for <%= cost %> Gems?",
|
||||||
"notEnoughMana": "Not enough mana.",
|
"notEnoughMana": "Not enough mana.",
|
||||||
"invalidTarget": "You can't cast a skill on that.",
|
"invalidTarget": "You can't cast a skill on that.",
|
||||||
|
|||||||
Reference in New Issue
Block a user