mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
* update bootstrap-vue to 1.0.0-beta.9 - remove all individual bootstrap components and use BootstrapVue into Vue * change modal action names from show::modal to bv::show::modal * check if drops are undefined * fix modal widths - sellModal now using input instead of dropbox * upgrade to bootstrap 4.0beta * include package-lock changes * fix app menu dropdown position * upgrade bootstrap to beta2 (was missing grid offset and other fixes) - refix header menu position * fix tags popup (auto width to max not working) - fix filter panel width (adding width: 100% works until max-width) * show hide logo on different screensize (new css breakpoints - http://getbootstrap.com/docs/4.0/utilities/display/ ) * fix package-lock? * fix active button style / app header toggle button * fix package-lock ! * update package lock after merge - new mixin "openedItemRows" to save the "show more/show less" in stable * mixin naming style * fix buyQuestModal marginTop * fix customMenuDropdown position * fix userDropdown items
106 lines
3.5 KiB
Vue
106 lines
3.5 KiB
Vue
<template lang="pug">
|
|
b-modal#restore(:title="$t('fixValues')", :hide-footer='true' size='lg')
|
|
p {{ $t('fixValuesText1') }}
|
|
p {{ $t('fixValuesText2') }}
|
|
.form-horizontal
|
|
h3 {{ $t('stats') }}
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('health') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', step="any", data-for='stats.hp', v-model='restoreValues.stats.hp')
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('experience') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', step="any", data-for='stats.exp', v-model='restoreValues.stats.exp')
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('gold') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', step="any", data-for='stats.gp', v-model='restoreValues.stats.gp')
|
|
//input.form-control(type='number', step="any", data-for='stats.gp', v-model='restoreValues.stats.gp',disabled)
|
|
//-p.alert
|
|
small {{ $t('disabledWinterEvent') }}
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('mana') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', step="any", data-for='stats.mp', v-model='restoreValues.stats.mp')
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('level') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', data-for='stats.lvl', v-model='restoreValues.stats.lvl')
|
|
h3 {{ $t('achievements') }}
|
|
.form-group.row
|
|
.col-sm-3
|
|
label.control-label {{ $t('fix21Streaks') }}
|
|
.col-sm-9
|
|
input.form-control(type='number', data-for='achievements.streak', v-model='restoreValues.achievements.streak')
|
|
//- This is causing too many problems for users
|
|
h3 {{ $t('other') }}
|
|
a.btn.btn-sm.btn-warning(ng-controller='FooterCtrl', ng-click='addMissedDay(1)') {{ $t('triggerDay') }}
|
|
.modal-footer
|
|
button.btn.btn-danger(@click='close()') {{ $t('discardChanges') }}
|
|
button.btn.btn-primary(@click='restore()') {{ $t('saveAndClose') }}
|
|
</template>
|
|
|
|
<script>
|
|
import clone from 'lodash/clone';
|
|
import { mapState } from 'client/libs/store';
|
|
|
|
export default {
|
|
data () {
|
|
return {
|
|
restoreValues: {
|
|
stats: {
|
|
hp: 0,
|
|
mp: 0,
|
|
gp: 0,
|
|
exp: 0,
|
|
lvl: 0,
|
|
},
|
|
achievements: {
|
|
streak: 0,
|
|
},
|
|
},
|
|
};
|
|
},
|
|
mounted () {
|
|
this.restoreValues.stats = clone(this.user.stats);
|
|
this.restoreValues.achievements.streak = clone(this.user.achievements.streak);
|
|
},
|
|
computed: {
|
|
...mapState({user: 'user.data'}),
|
|
},
|
|
methods: {
|
|
close () {
|
|
this.$root.$emit('bv::hide::modal', 'restore');
|
|
},
|
|
restore () {
|
|
if (this.restoreValues.stats.lvl < 1) {
|
|
// @TODO:
|
|
// Notification.error(env.t('invalidLevel'), true);
|
|
return;
|
|
}
|
|
|
|
this.user.stats = clone(this.restoreValues.stats);
|
|
this.user.achievements.streak = clone(this.restoreValues.achievements.streak);
|
|
|
|
let settings = {
|
|
'stats.hp': Number(this.restoreValues.stats.hp),
|
|
'stats.exp': Number(this.restoreValues.stats.exp),
|
|
'stats.gp': Number(this.restoreValues.stats.gp),
|
|
'stats.lvl': Number(this.restoreValues.stats.lvl),
|
|
'stats.mp': Number(this.restoreValues.stats.mp),
|
|
'achievements.streak': Number(this.restoreValues.achievements.streak),
|
|
};
|
|
|
|
this.$store.dispatch('user:set', settings);
|
|
this.$root.$emit('bv::hide::modal', 'restore');
|
|
},
|
|
},
|
|
};
|
|
</script>
|