-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathGlobalDialogs.vue
120 lines (112 loc) · 3.57 KB
/
GlobalDialogs.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<template>
<div>
<v-dialog :value='currentSupportBundleName !== null' max-width='600' persistent>
<v-card>
<div class='pa-6'>
<h1 class='text-center'>Uh oh!</h1>
<h3 class='text-center mb-4'>Something went oribly wrong</h3>
<div>
It seems like the game crashed... We collected some information and important files that would help us
to find the issue. Please reach out to one of the developers on our Discord and send them the file.
</div>
<div class='text-center my-8'>
<code class='title'>{{ currentSupportBundleName }}</code>
</div>
<div class='d-flex justify-end'>
<v-btn text depressed @click='currentSupportBundleName = null'>
Close
</v-btn>
<v-btn depressed color='accent' class='ml-2' @click='showSupportBundleInExplorer'>
Show in Explorer
</v-btn>
</div>
</div>
<img class='crash-ori' src='~/assets/images/ori_sus.png' alt=''>
</v-card>
</v-dialog>
<v-dialog v-model='showUpdateAvailableDialog' max-width='500' persistent>
<v-card>
<v-card-title>Update available ({{ latestVisibleVersion }})</v-card-title>
<v-card-text>
An update for the randomizer is ready to be downloaded and installed.
We recommend to always play on the latest version.
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn text class='mr-1' @click='showUpdateAvailableDialog = false'>
Cancel
</v-btn>
<v-btn text class='mr-1' @click='forceLaunch'>
Launch anyway
</v-btn>
<v-btn depressed color='accent' @click='downloadAndInstallUpdate'>
Install update
</v-btn>
</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>
<script>
import { mapGetters } from 'vuex'
export default {
name: 'GlobalDialogs',
computed: {
...mapGetters('version', [
'latestVisibleVersion',
]),
currentSupportBundleName: {
set(value) {
this.$store.commit('electron/setCurrentSupportBundleName', value)
},
get() {
return this.$store.state.electron.currentSupportBundleName
},
},
showUpdateAvailableDialog: {
set(value) {
this.$store.commit('electron/setShowUpdateAvailableDialog', value)
},
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() {
await this.$store.dispatch('electron/downloadAndInstallUpdate')
await this.$router.push({path: '/electron'})
},
async forceLaunch() {
await this.$store.dispatch('electron/launch', {
forceLaunch: true,
})
},
showSupportBundleInExplorer() {
window.electronApi.invoke('crash.showSupportBundleInExplorer', this.currentSupportBundleName)
},
}
}
</script>
<style lang='scss' scoped>
.crash-ori {
position: absolute;
bottom: 0;
left: 0;
width: 96px;
transform: scaleX(-1);
}
</style>