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:
Alys
2017-09-30 06:57:05 +10:00
committed by Sabe Jones
parent 1d8c126687
commit dc3a02bc2e
2 changed files with 8 additions and 7 deletions

View File

@@ -36,9 +36,9 @@
h6(v-once) {{ $t('class') + ': ' }}
// @TODO: what is classText
span(v-if='classText') {{ classText }} 
button.btn.btn-danger.btn-xs(@click='changeClass(null)', v-once) {{ $t('changeClass') }}
small.cost 3
span.Pet_Currency_Gem1x.inline-gems
button.btn.btn-danger.btn-xs(@click='changeClassForUser(true)', v-once) {{ $t('changeClass') }}
small.cost   3 {{ $t('gems') }}
// @TODO add icon span.Pet_Currency_Gem1x.inline-gems
hr
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='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') }}
hr
@@ -378,8 +378,8 @@ export default {
this.$router.go('/tasks');
},
async changeClass () {
if (!confirm('Are you sure you want to change your class for 3 gems?')) return;
async changeClassForUser (confirmationNeeded) {
if (confirmationNeeded && !confirm(this.$t('changeClassConfirmCost'))) return;
try {
changeClass(this.user);
await axios.post('/api/v3/user/change-class');

View File

@@ -125,6 +125,7 @@
"mystery": "Mystery",
"changeClass": "Change Class, Refund Attribute Points",
"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'.",
"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",
@@ -158,7 +159,7 @@
"respawn": "Respawn!",
"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!",
"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?",
"notEnoughMana": "Not enough mana.",
"invalidTarget": "You can't cast a skill on that.",