Skip to content

Commit

Permalink
Convert stats to dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschwarzer committed Apr 5, 2024
1 parent b09eccf commit 2ddc773
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
16 changes: 15 additions & 1 deletion components/GlobalDialogs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
</v-card-actions>
</v-card>
</v-dialog>

<v-dialog v-model='showStatsDialog' max-width='1100' scrollable>
<v-card class="pt-3">
<wotw-stats-single-game-stat-view />
</v-card>
</v-dialog>
</div>
</template>

Expand Down Expand Up @@ -76,7 +82,15 @@
get() {
return this.$store.state.electron.showUpdateAvailableDialog
},
}
},
showStatsDialog: {
set(value) {
this.$store.commit('electron/setShowStatsDialog', value)
},
get() {
return this.$store.state.electron.showStatsDialog
},
},
},
methods: {
async downloadAndInstallUpdate() {
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
window.electronApi.on('game.gameFinished', () => {
if (this.settingsLoaded && this.settings['Flags.ShowStatsAfterFinish']) {
this.$router.push({ name: 'electron-stats' })
this.$store.commit('electron/setShowStatsDialog', true)
window.electronApi.invoke('launcher.focusMainWindow')
}
})
Expand Down
9 changes: 6 additions & 3 deletions components/WotwPageToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
My Games
</v-btn>
<template v-if="isElectron">
<v-btn v-if="randoIpcConnected" key="stats" x-large depressed text to="/electron/stats">
<v-btn v-if="randoIpcConnected" key="stats" x-large depressed text @click="showStats">
<v-icon left>mdi-chart-box-outline</v-icon>
Stats
</v-btn>
Expand Down Expand Up @@ -262,7 +262,7 @@
this.remoteTrackerUrlCopying = true
const args = {}
// remote
if (this.remoteTrackerSettings.remote) {
const remoteId = await window.electronApi.invoke('localTracker.expose', {
Expand All @@ -280,7 +280,7 @@
// willow hearts
if(this.remoteTrackerSettings.willowHearts){
args.hearts= 'true'
// hide willow hearts until first is destroyed
if(this.remoteTrackerSettings.hideHeartsUntilFirstHeart){
args.hideHeartsUntilFirst= 'true'
Expand Down Expand Up @@ -317,6 +317,9 @@
openRandoDevtools() {
window.electronApi.invoke('devtools.open')
},
showStats() {
this.$store.commit('electron/setShowStatsDialog', true)
},
},
}
</script>
Expand Down
17 changes: 0 additions & 17 deletions pages/electron/stats.vue

This file was deleted.

4 changes: 4 additions & 0 deletions store/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const state = () => ({
newGameSeedSource: null,
currentSupportBundleName: null,
showUpdateAvailableDialog: false,
showStatsDialog: false,
localTrackerRunning: false,
randoIpcConnected: false,
})
Expand Down Expand Up @@ -96,6 +97,9 @@ export const mutations = {
setShowUpdateAvailableDialog(state, value) {
state.showUpdateAvailableDialog = value
},
setShowStatsDialog(state, value) {
state.showStatsDialog = value
},
setUpdateDownloadProgress(state, value) {
state.updateDownloadProgress = value
},
Expand Down

0 comments on commit 2ddc773

Please sign in to comment.