2021-06-15 23:46:34 -05:00
|
|
|
<template>
|
2022-01-13 22:25:47 -06:00
|
|
|
<Modal :model-value="isOpen">
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
<template v-slot:header>
|
|
|
|
<div class="game-over-modal-header">
|
2022-01-13 22:25:47 -06:00
|
|
|
<img class="game-over-modal-logo" v-if="logo" :src="logo" :alt="title" />
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
<div class="game-over-modal-title">
|
|
|
|
<h2>Congratulations!</h2>
|
|
|
|
<h4>You've beaten {{ title }} v{{ versionNumber }}: {{ versionTitle }}</h4>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:body="{ shown }">
|
|
|
|
<div v-if="shown">
|
|
|
|
<div>It took you {{ timePlayed }} to beat the game.</div>
|
|
|
|
<br />
|
|
|
|
<div>
|
|
|
|
Please check the Discord to discuss the game or to check for new content
|
|
|
|
updates!
|
|
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<div>
|
2022-02-27 16:55:43 -06:00
|
|
|
<a :href="discordLink" class="game-over-modal-discord-link">
|
2022-01-24 22:25:34 -06:00
|
|
|
<span class="material-icons game-over-modal-discord">discord</span>
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
{{ discordName }}
|
|
|
|
</a>
|
|
|
|
</div>
|
2022-02-27 16:55:43 -06:00
|
|
|
<Toggle title="Autosave" v-model="autosave" />
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:footer>
|
|
|
|
<div class="game-over-footer">
|
|
|
|
<button @click="keepGoing" class="button">Keep Going</button>
|
|
|
|
<button @click="playAgain" class="button danger">Play Again</button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</Modal>
|
2021-06-15 23:46:34 -05:00
|
|
|
</template>
|
|
|
|
|
2022-01-13 22:25:47 -06:00
|
|
|
<script setup lang="ts">
|
2022-03-03 21:39:48 -06:00
|
|
|
import Modal from "components/Modal.vue";
|
|
|
|
import { hasWon } from "data/projEntry";
|
|
|
|
import projInfo from "data/projInfo.json";
|
|
|
|
import player from "game/player";
|
|
|
|
import { formatTime } from "util/bignum";
|
|
|
|
import { loadSave, newSave } from "util/save";
|
2022-02-27 16:55:43 -06:00
|
|
|
import { computed, toRef } from "vue";
|
|
|
|
import Toggle from "./fields/Toggle.vue";
|
2021-06-15 23:46:34 -05:00
|
|
|
|
2022-03-02 20:12:56 -06:00
|
|
|
const { title, logo, discordName, discordLink, versionNumber, versionTitle } = projInfo;
|
2022-01-13 22:25:47 -06:00
|
|
|
|
|
|
|
const timePlayed = computed(() => formatTime(player.timePlayed));
|
|
|
|
const isOpen = computed(() => hasWon.value && !player.keepGoing);
|
2022-02-27 16:55:43 -06:00
|
|
|
const autosave = toRef(player, "autosave");
|
2022-01-13 22:25:47 -06:00
|
|
|
|
|
|
|
function keepGoing() {
|
|
|
|
player.keepGoing = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function playAgain() {
|
|
|
|
loadSave(newSave());
|
|
|
|
}
|
2021-06-15 23:46:34 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.game-over-modal-header {
|
2022-02-27 16:55:43 -06:00
|
|
|
display: flex;
|
2021-06-15 23:46:34 -05:00
|
|
|
margin: -20px;
|
|
|
|
margin-bottom: 0;
|
2021-09-04 16:51:41 -05:00
|
|
|
background: var(--raised-background);
|
2022-02-27 16:55:43 -06:00
|
|
|
align-items: center;
|
2021-06-15 23:46:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-modal-header * {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
margin: 0;
|
2021-06-15 23:46:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-modal-logo {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
height: 4em;
|
2021-06-15 23:46:34 -05:00
|
|
|
width: 4em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-modal-title {
|
2022-02-27 16:55:43 -06:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
padding: 10px 0;
|
2021-06-15 23:46:34 -05:00
|
|
|
margin-left: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-footer {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
display: flex;
|
2021-06-15 23:46:34 -05:00
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-footer button {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
margin: 0 10px;
|
2021-06-15 23:46:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-modal-discord-link {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-06-15 23:46:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.game-over-modal-discord {
|
First pass at typescript support
Oh man did this end up requiring a *ton* of other work as well.
There's still a few typing issues I still can't quite work out,
and others I'd like to improve when I have time. In fact, this version
doesn't even really work, it has a stack overflow error caused by
a tooltip for some reason have a tree inside it, which in turn has
another tooltip, etc. There's also 17 errors that I *really* feel like
shouldn't be there, but they are, and 113 warnings - mostly using !
to assert that things are non-null. Lots of work left to do, to sum up.
The reason I'm committing this now is because I really need to get to
work on my game jam, and since it won't use a tree or really many of
TMT-X's features, I can get away with using a broken engine :)
2021-08-16 23:30:54 -05:00
|
|
|
margin: 0;
|
|
|
|
margin-right: 4px;
|
2021-06-15 23:46:34 -05:00
|
|
|
}
|
|
|
|
</style>
|