2021-05-22 15:29:06 -05:00
|
|
|
<template>
|
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
|
|
|
<Modal :show="show" @close="$emit('closeDialog', 'Options')">
|
|
|
|
<template v-slot:header>
|
|
|
|
<div class="header">
|
|
|
|
<h2>Options</h2>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:body>
|
|
|
|
<Select
|
|
|
|
title="Theme"
|
|
|
|
:options="themes"
|
|
|
|
:value="theme"
|
|
|
|
@change="setTheme"
|
|
|
|
default="classic"
|
|
|
|
/>
|
|
|
|
<Select
|
|
|
|
title="Show Milestones"
|
|
|
|
:options="msDisplayOptions"
|
|
|
|
:value="msDisplay"
|
|
|
|
@change="setMSDisplay"
|
|
|
|
default="all"
|
|
|
|
/>
|
|
|
|
<Toggle
|
|
|
|
title="Offline Production"
|
|
|
|
:value="offlineProd"
|
|
|
|
@change="toggleOption('offlineProd')"
|
|
|
|
/>
|
|
|
|
<Toggle title="Autosave" :value="autosave" @change="toggleOption('autosave')" />
|
|
|
|
<Toggle title="Pause game" :value="paused" @change="togglePaused" />
|
|
|
|
<Toggle title="Show TPS" :value="showTPS" @change="toggleOption('showTPS')" />
|
|
|
|
<Toggle
|
|
|
|
title="Hide Maxed Challenges"
|
|
|
|
:value="hideChallenges"
|
|
|
|
@change="toggleOption('hideChallenges')"
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</Modal>
|
2021-05-22 15:29:06 -05:00
|
|
|
</template>
|
|
|
|
|
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
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from "vue";
|
|
|
|
import themes, { Themes } from "@/data/themes";
|
|
|
|
import { camelToTitle } from "@/util/common";
|
|
|
|
import { mapState } from "@/util/vue";
|
|
|
|
import player from "@/game/player";
|
|
|
|
import { MilestoneDisplay } from "@/game/enums";
|
2021-05-22 15:29:06 -05:00
|
|
|
|
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
|
|
|
export default defineComponent({
|
|
|
|
name: "Options",
|
|
|
|
props: {
|
|
|
|
show: Boolean
|
|
|
|
},
|
|
|
|
emits: ["closeDialog"],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
themes: Object.keys(themes).map(theme => ({
|
|
|
|
label: camelToTitle(theme),
|
|
|
|
value: theme
|
|
|
|
})),
|
|
|
|
msDisplayOptions: ["all", "last", "configurable", "incomplete", "none"].map(option => ({
|
|
|
|
label: camelToTitle(option),
|
|
|
|
value: option
|
|
|
|
}))
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState(["autosave", "offlineProd", "showTPS", "hideChallenges", "theme", "msDisplay"]),
|
|
|
|
paused() {
|
|
|
|
return player.devSpeed === 0;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleOption(option: string) {
|
|
|
|
player[option] = !player[option];
|
|
|
|
},
|
|
|
|
setTheme(theme: Themes) {
|
|
|
|
player.theme = theme;
|
|
|
|
},
|
|
|
|
setMSDisplay(msDisplay: MilestoneDisplay) {
|
|
|
|
player.msDisplay = msDisplay;
|
|
|
|
},
|
|
|
|
togglePaused() {
|
|
|
|
player.devSpeed = this.paused ? 1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-05-22 15:29:06 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2021-06-20 23:29:55 -05:00
|
|
|
.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-bottom: -10px;
|
2021-05-22 15:29:06 -05:00
|
|
|
}
|
|
|
|
</style>
|