fix: display/hide detailed runes

This commit is contained in:
Valentin Kaelin 2023-09-21 14:12:11 +02:00
parent 889360fbed
commit 8060766638
No known key found for this signature in database
GPG key ID: B389A4E3DFF8E414
4 changed files with 17 additions and 11 deletions

View file

@ -395,9 +395,9 @@ export default {
return return
} }
this.displayOrHideRunes(player.perks) this.displayRunes(player.perks)
}, },
...mapActions('cdragon', ['displayOrHideRunes']), ...mapActions('cdragon', ['displayRunes']),
}, },
} }
</script> </script>

View file

@ -83,15 +83,15 @@ export default {
methods: { methods: {
close() { close() {
this.displayOrHideRunes({}) this.hideRunes({})
}, },
handleEscape(e) { handleEscape(e) {
if (e.key === 'Esc' || e.key === 'Escape') { if (e.key === 'Esc' || e.key === 'Escape') {
this.displayOrHideRunes({}) this.hideRunes({})
} }
}, },
createCDragonAssetUrl, createCDragonAssetUrl,
...mapActions('cdragon', ['displayOrHideRunes']), ...mapActions('cdragon', ['hideRunes']),
}, },
} }
</script> </script>

View file

@ -282,11 +282,11 @@ export default {
}, },
selectRunes(player) { selectRunes(player) {
if (!player.perks) return if (!player.perks) return
this.displayOrHideRunes(player.perks) this.displayRunes(player.perks)
}, },
getPrimarRune, getPrimarRune,
getSecondaryRune, getSecondaryRune,
...mapActions('cdragon', ['displayOrHideRunes']), ...mapActions('cdragon', ['displayRunes']),
}, },
} }
</script> </script>

View file

@ -14,18 +14,24 @@ export const state = {
} }
export const mutations = { export const mutations = {
DISPLAY_HIDE_RUNES(state, selectedRunes) { DISPLAY_RUNES(state, selectedRunes) {
state.runesOpen = !state.runesOpen state.runesOpen = true
state.selectedRunes = selectedRunes state.selectedRunes = selectedRunes
}, },
HIDE_RUNES(state) {
state.runesOpen = false
},
SET_RUNES(state, runes) { SET_RUNES(state, runes) {
state.runes = runes state.runes = runes
}, },
} }
export const actions = { export const actions = {
displayOrHideRunes({ commit }, selectedRunes) { displayRunes({ commit }, selectedRunes) {
commit('DISPLAY_HIDE_RUNES', selectedRunes) commit('DISPLAY_RUNES', selectedRunes)
},
hideRunes({ commit }) {
commit('HIDE_RUNES')
}, },
async getRunes({ commit, getters }) { async getRunes({ commit, getters }) {
if (getters.runesLoaded) { if (getters.runesLoaded) {