Add saves manager button to NaN detected screen
This commit is contained in:
parent
3671a072a1
commit
43790603d4
3 changed files with 36 additions and 56 deletions
|
@ -53,18 +53,19 @@ export default {
|
||||||
.container > * {
|
.container > * {
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style>
|
||||||
.danger {
|
.danger {
|
||||||
|
position: relative;
|
||||||
border: solid 2px var(--danger);
|
border: solid 2px var(--danger);
|
||||||
padding-right: 0;
|
border-right-width: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger::after {
|
.danger::after {
|
||||||
|
position: absolute;
|
||||||
content: "!";
|
content: "!";
|
||||||
color: white;
|
color: white;
|
||||||
background: var(--danger);
|
right: -13px;
|
||||||
padding: 2px;
|
|
||||||
margin-left: 6px;
|
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -98,18 +98,4 @@ export default {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
|
||||||
border: solid 2px var(--danger);
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.danger::after {
|
|
||||||
content: "!";
|
|
||||||
color: white;
|
|
||||||
background: var(--danger);
|
|
||||||
padding: 2px;
|
|
||||||
margin-left: 6px;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,27 +1,31 @@
|
||||||
<template>
|
<template>
|
||||||
<Modal :show="show">
|
<div v-frag>
|
||||||
<div slot="header" class="nan-modal-header">
|
<Modal :show="show">
|
||||||
<h2>NaN value detected!</h2>
|
<div slot="header" class="nan-modal-header">
|
||||||
</div>
|
<h2>NaN value detected!</h2>
|
||||||
<div slot="body">
|
|
||||||
<div>Attempted to assign NaN value to "{{ property }}" (previously {{ format(previous) }}). Auto-saving has been {{ autosave ? 'enabled' : 'disabled' }}. Check the console for more details, and consider sharing it with the developers on discord.</div>
|
|
||||||
<br>
|
|
||||||
<div>
|
|
||||||
<a :href="discordLink" class="nan-modal-discord-link">
|
|
||||||
<img src="images/discord.png" class="nan-modal-discord" />
|
|
||||||
{{ discordName }}
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<div slot="body">
|
||||||
<Toggle title="Autosave" :value="autosave" @change="setAutosave" />
|
<div>Attempted to assign NaN value to "{{ property }}" (previously {{ format(previous) }}). Auto-saving has been {{ autosave ? 'enabled' : 'disabled' }}. Check the console for more details, and consider sharing it with the developers on discord.</div>
|
||||||
</div>
|
<br>
|
||||||
<div slot="footer" class="nan-footer">
|
<div>
|
||||||
<button @click="setZero" class="button">Set to 0</button>
|
<a :href="discordLink" class="nan-modal-discord-link">
|
||||||
<button @click="setOne" class="button">Set to 1</button>
|
<img src="images/discord.png" class="nan-modal-discord" />
|
||||||
<button @click="setPrev" class="button" v-if="previous && previous.neq(0) && previous.neq(1)">Set to previous</button>
|
{{ discordName }}
|
||||||
<button @click="ignore" class="button danger">Ignore</button>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
<br>
|
||||||
|
<Toggle title="Autosave" :value="autosave" @change="setAutosave" />
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="nan-footer">
|
||||||
|
<button @click="toggleSavesManager" class="button">Open Saves Manager</button>
|
||||||
|
<button @click="setZero" class="button">Set to 0</button>
|
||||||
|
<button @click="setOne" class="button">Set to 1</button>
|
||||||
|
<button @click="setPrev" class="button" v-if="previous && previous.neq(0) && previous.neq(1)">Set to previous</button>
|
||||||
|
<button @click="ignore" class="button danger">Ignore</button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
<SavesManager :show="showSaves" @closeDialog="toggleSavesManager" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -33,7 +37,7 @@ export default {
|
||||||
name: 'NaNScreen',
|
name: 'NaNScreen',
|
||||||
data() {
|
data() {
|
||||||
const { discordName, discordLink } = modInfo;
|
const { discordName, discordLink } = modInfo;
|
||||||
return { discordName, discordLink, format };
|
return { discordName, discordLink, format, showSaves: false };
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
show() {
|
show() {
|
||||||
|
@ -67,6 +71,9 @@ export default {
|
||||||
},
|
},
|
||||||
setAutosave(autosave) {
|
setAutosave(autosave) {
|
||||||
player.autosave = autosave;
|
player.autosave = autosave;
|
||||||
|
},
|
||||||
|
toggleSavesManager() {
|
||||||
|
this.showSaves = !this.showSaves;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -97,18 +104,4 @@ export default {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.danger {
|
|
||||||
border: solid 2px var(--danger);
|
|
||||||
padding-right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.danger::after {
|
|
||||||
content: "!";
|
|
||||||
color: white;
|
|
||||||
background: var(--danger);
|
|
||||||
padding: 2px;
|
|
||||||
margin-left: 6px;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in a new issue