Add saves manager button to NaN detected screen

This commit is contained in:
thepaperpilot 2021-07-02 08:48:34 -05:00
parent 3671a072a1
commit 43790603d4
3 changed files with 36 additions and 56 deletions

View file

@ -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>

View file

@ -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>

View file

@ -1,4 +1,5 @@
<template> <template>
<div v-frag>
<Modal :show="show"> <Modal :show="show">
<div slot="header" class="nan-modal-header"> <div slot="header" class="nan-modal-header">
<h2>NaN value detected!</h2> <h2>NaN value detected!</h2>
@ -16,12 +17,15 @@
<Toggle title="Autosave" :value="autosave" @change="setAutosave" /> <Toggle title="Autosave" :value="autosave" @change="setAutosave" />
</div> </div>
<div slot="footer" class="nan-footer"> <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="setZero" class="button">Set to 0</button>
<button @click="setOne" class="button">Set to 1</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="setPrev" class="button" v-if="previous && previous.neq(0) && previous.neq(1)">Set to previous</button>
<button @click="ignore" class="button danger">Ignore</button> <button @click="ignore" class="button danger">Ignore</button>
</div> </div>
</Modal> </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>