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
}
this.displayOrHideRunes(player.perks)
this.displayRunes(player.perks)
},
...mapActions('cdragon', ['displayOrHideRunes']),
...mapActions('cdragon', ['displayRunes']),
},
}
</script>

View file

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

View file

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

View file

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