mirror of
https://github.com/kihashi/stardew_community_checklist.git
synced 2025-10-19 08:03:17 +00:00
Add Reset Button (#113)
* Add reset data mutation * Add delete button * Fix spacing
This commit is contained in:
parent
3fa40bfccf
commit
c9aa194cc1
@ -24,12 +24,10 @@
|
|||||||
</button-checkbox>
|
</button-checkbox>
|
||||||
<p class="help">Hides things that are considered spoilers, as defined below.</p>
|
<p class="help">Hides things that are considered spoilers, as defined below.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="field is-grouped">
|
|
||||||
<div class="control">
|
|
||||||
<label class="label">
|
<label class="label">
|
||||||
Spoilers
|
Spoilers
|
||||||
</label>
|
</label>
|
||||||
</div>
|
<div class="field is-grouped is-grouped-multiline">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" v-model="BundleRewardsSpoilers"/>
|
<input type="checkbox" v-model="BundleRewardsSpoilers"/>
|
||||||
@ -62,7 +60,7 @@
|
|||||||
<h2 class="subtitle">
|
<h2 class="subtitle">
|
||||||
Import and Export Saved Data
|
Import and Export Saved Data
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p class="content">
|
||||||
Use these controls to port data to another device.
|
Use these controls to port data to another device.
|
||||||
Copy the data string from the Export field on the source device and paste it into the Import field
|
Copy the data string from the Export field on the source device and paste it into the Import field
|
||||||
on the target device.
|
on the target device.
|
||||||
@ -85,7 +83,7 @@
|
|||||||
<div class="control">
|
<div class="control">
|
||||||
<input class="input" type="text" placeholder="Enter Saved Data here" v-model="DataToLoad" />
|
<input class="input" type="text" placeholder="Enter Saved Data here" v-model="DataToLoad" />
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="control">
|
||||||
<button class="button is-info" @click="LoadData">
|
<button class="button is-info" @click="LoadData">
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<mdi-upload-icon />
|
<mdi-upload-icon />
|
||||||
@ -95,6 +93,27 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
<section class="section">
|
||||||
|
<div class="container">
|
||||||
|
<h2 class="subtitle">Reset Data</h2>
|
||||||
|
<p class="content">Use this button to reset your data and start a new game.</p>
|
||||||
|
<div class="field">
|
||||||
|
<div class="control">
|
||||||
|
<button class="button is-large is-rounded" :class="DeleteConfirm ? 'is-warning' : 'is-danger'" @click="ConfirmDelete">
|
||||||
|
<span class="icon">
|
||||||
|
<mdi-delete-icon />
|
||||||
|
</span>
|
||||||
|
<span v-if="DeleteConfirm">
|
||||||
|
Are You Sure?
|
||||||
|
</span>
|
||||||
|
<span v-else>
|
||||||
|
Reset Data
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -102,6 +121,7 @@
|
|||||||
import ButtonCheckbox from '@/components/ButtonCheckbox.vue'
|
import ButtonCheckbox from '@/components/ButtonCheckbox.vue'
|
||||||
import 'mdi-vue/ContentCopyIcon'
|
import 'mdi-vue/ContentCopyIcon'
|
||||||
import 'mdi-vue/UploadIcon'
|
import 'mdi-vue/UploadIcon'
|
||||||
|
import 'mdi-vue/DeleteIcon'
|
||||||
export default {
|
export default {
|
||||||
name: 'Settings',
|
name: 'Settings',
|
||||||
components: {
|
components: {
|
||||||
@ -109,7 +129,8 @@ export default {
|
|||||||
},
|
},
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
DataToLoad: ''
|
DataToLoad: '',
|
||||||
|
DeleteConfirm: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -171,6 +192,15 @@ export default {
|
|||||||
this.$store.commit('SetSerializedState', this.DataToLoad)
|
this.$store.commit('SetSerializedState', this.DataToLoad)
|
||||||
alert('Data Loaded!')
|
alert('Data Loaded!')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
ConfirmDelete: function () {
|
||||||
|
if (this.DeleteConfirm) {
|
||||||
|
this.$store.commit('resetData')
|
||||||
|
this.DeleteConfirm = false
|
||||||
|
alert('Data Reset!')
|
||||||
|
} else {
|
||||||
|
this.DeleteConfirm = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,6 +92,9 @@ export default new Vuex.Store({
|
|||||||
Vue.set(state, 'rooms', prestate.rooms)
|
Vue.set(state, 'rooms', prestate.rooms)
|
||||||
Vue.set(state, 'bundles', prestate.bundles)
|
Vue.set(state, 'bundles', prestate.bundles)
|
||||||
Vue.set(state, 'items', prestate.items)
|
Vue.set(state, 'items', prestate.items)
|
||||||
|
},
|
||||||
|
resetData (state) {
|
||||||
|
state.StoredItems = {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user