diff --git a/src/components/Settings.vue b/src/components/Settings.vue new file mode 100644 index 0000000..c91792c --- /dev/null +++ b/src/components/Settings.vue @@ -0,0 +1,133 @@ + + + + + diff --git a/src/components/bundles/BundleItems.vue b/src/components/bundles/BundleItems.vue index 1b181e4..c299c13 100644 --- a/src/components/bundles/BundleItems.vue +++ b/src/components/bundles/BundleItems.vue @@ -7,7 +7,7 @@ {{bundle.name}} {{bundle.items_required}} -
+
{{bundle.reward}}
@@ -16,7 +16,7 @@ {{bundle.room.name}} {{bundle.room.items_required}} -
+
{{bundle.room.reward}}
@@ -41,6 +41,9 @@ export default { computed: { bundle: function () { return this.$store.getters.GetBundleById(this.$route.params.id) + }, + hideBundleItems: function () { + return this.$store.state.HideSpoilers && this.$store.state.BundleRewardsSpoilers } }, components: { diff --git a/src/components/item_card/ItemCard.vue b/src/components/item_card/ItemCard.vue index 0503f0c..1675dd7 100644 --- a/src/components/item_card/ItemCard.vue +++ b/src/components/item_card/ItemCard.vue @@ -6,7 +6,7 @@

-
+
{{item.source}}
@@ -14,10 +14,10 @@
@@ -36,6 +36,17 @@ export default { SeasonList }, name: 'item-card', + computed: { + showItemDesc: function () { + return !(this.$store.state.HideSpoilers && this.$store.state.ItemInfoSpoilers) + }, + showSeasonList: function () { + return !(this.$store.state.HideSpoilers && this.$store.state.SeasonsSpoilers) + }, + showSkillList: function () { + return !(this.$store.state.HideSpoilers && this.$store.state.SkillsSpoilers) + } + }, props: { item: { type: Object, diff --git a/src/router/index.js b/src/router/index.js index d8e34e6..cb958d7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,7 @@ import Welcome from '@/components/Welcome' import Bundles from '@/components/bundles/Bundles' import BundleItems from '@/components/bundles/BundleItems' import Search from '@/components/search/Search' +import Settings from '@/components/Settings' import Changelog from '@/components/changelog/Changelog' Vue.use(Router) @@ -42,6 +43,11 @@ export default new Router({ name: 'Inventory', path: '/inventory' }, + { + name: 'Settings', + path: '/settings', + component: Settings + }, { path: '/changelog', component: Changelog diff --git a/src/store/index.js b/src/store/index.js index 60551c7..8c284c7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -21,7 +21,13 @@ prestate.items = loadItems(prestate.bundles, prestate.skills, prestate.seasons) export default new Vuex.Store({ state: { - StoredItems: {} + StoredItems: {}, + HideSpoilers: false, + HideCompleted: false, + BundleRewardsSpoilers: true, + ItemInfoSpoilers: true, + SeasonsSpoilers: true, + SkillsSpoilers: true }, plugins: [ createPersistedState({ @@ -46,6 +52,24 @@ export default new Vuex.Store({ UndoRedeemItem (state, BundleItem) { Vue.delete(state.StoredItems, BundleItem.id) }, + toggleSpoilers (state) { + state.HideSpoilers = !state.HideSpoilers + }, + toggleCompleted (state) { + state.HideCompleted = !state.HideCompleted + }, + toggleBundleRewards (state) { + state.BundleRewardsSpoilers = !state.BundleRewardsSpoilers + }, + toggleItemInfo (state) { + state.ItemInfoSpoilers = !state.ItemInfoSpoilers + }, + toggleSeasons (state) { + state.SeasonsSpoilers = !state.SeasonsSpoilers + }, + toggleSkills (state) { + state.SkillsSpoilers = !state.SkillsSpoilers + }, initState (state) { Vue.set(state, 'seasons', prestate.seasons) Vue.set(state, 'skills', prestate.skills)