2021-05-22 20:29:06 +00: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-17 04:30:54 +00: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"
|
|
|
|
/>
|
2021-09-05 23:53:04 +00:00
|
|
|
<Toggle title="Show TPS" :value="showTPS" @change="toggleSettingsOption('showTPS')" />
|
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-17 04:30:54 +00:00
|
|
|
<Toggle
|
2021-09-05 23:53:04 +00:00
|
|
|
title="Hide Maxed Challenges"
|
|
|
|
:value="hideChallenges"
|
|
|
|
@change="toggleSettingsOption('hideChallenges')"
|
|
|
|
/>
|
2021-09-06 00:13:56 +00:00
|
|
|
<Toggle
|
|
|
|
title="Unthrottled"
|
|
|
|
:value="unthrottled"
|
|
|
|
@change="toggleSettingsOption('unthrottled')"
|
|
|
|
/>
|
2021-09-05 23:53:04 +00:00
|
|
|
<Toggle
|
|
|
|
title="Offline Production<tooltip display='Save-specific'>*</tooltip>"
|
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-17 04:30:54 +00:00
|
|
|
:value="offlineProd"
|
2021-09-05 23:53:04 +00:00
|
|
|
@change="togglePlayerOption('offlineProd')"
|
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-17 04:30:54 +00:00
|
|
|
/>
|
|
|
|
<Toggle
|
2021-09-05 23:53:04 +00:00
|
|
|
title="Autosave<tooltip display='Save-specific'>*</tooltip>"
|
|
|
|
:value="autosave"
|
|
|
|
@change="togglePlayerOption('autosave')"
|
|
|
|
/>
|
|
|
|
<Toggle
|
|
|
|
title="Pause game<tooltip display='Save-specific'>*</tooltip>"
|
|
|
|
:value="paused"
|
|
|
|
@change="togglePaused"
|
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-17 04:30:54 +00:00
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</Modal>
|
2021-05-22 20:29:06 +00: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-17 04:30:54 +00:00
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from "vue";
|
|
|
|
import themes, { Themes } from "@/data/themes";
|
|
|
|
import { camelToTitle } from "@/util/common";
|
2021-09-05 23:53:04 +00:00
|
|
|
import { mapPlayer, mapSettings } from "@/util/vue";
|
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-17 04:30:54 +00:00
|
|
|
import player from "@/game/player";
|
|
|
|
import { MilestoneDisplay } from "@/game/enums";
|
2021-09-05 23:53:04 +00:00
|
|
|
import { PlayerData } from "@/typings/player";
|
|
|
|
import settings from "@/game/settings";
|
|
|
|
import { Settings } from "@/typings/settings";
|
2021-05-22 20:29:06 +00: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-17 04:30:54 +00:00
|
|
|
export default defineComponent({
|
|
|
|
name: "Options",
|
|
|
|
props: {
|
|
|
|
show: Boolean
|
|
|
|
},
|
|
|
|
emits: ["closeDialog"],
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
themes: Object.keys(themes).map(theme => ({
|
|
|
|
label: camelToTitle(theme),
|
|
|
|
value: theme
|
|
|
|
})),
|
2021-09-05 23:53:04 +00:00
|
|
|
msDisplayOptions: Object.values(MilestoneDisplay).map(option => ({
|
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-17 04:30:54 +00:00
|
|
|
label: camelToTitle(option),
|
|
|
|
value: option
|
|
|
|
}))
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
2021-09-06 00:13:56 +00:00
|
|
|
...mapSettings(["showTPS", "hideChallenges", "theme", "msDisplay", "unthrottled"]),
|
2021-09-05 23:53:04 +00:00
|
|
|
...mapPlayer(["autosave", "offlineProd"]),
|
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-17 04:30:54 +00:00
|
|
|
paused() {
|
|
|
|
return player.devSpeed === 0;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2021-09-05 23:53:04 +00:00
|
|
|
togglePlayerOption(option: keyof PlayerData) {
|
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-17 04:30:54 +00:00
|
|
|
player[option] = !player[option];
|
|
|
|
},
|
2021-09-05 23:53:04 +00:00
|
|
|
toggleSettingsOption(option: keyof Settings) {
|
|
|
|
settings[option] = !settings[option];
|
|
|
|
},
|
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-17 04:30:54 +00:00
|
|
|
setTheme(theme: Themes) {
|
2021-09-05 23:53:04 +00:00
|
|
|
settings.theme = theme;
|
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-17 04:30:54 +00:00
|
|
|
},
|
|
|
|
setMSDisplay(msDisplay: MilestoneDisplay) {
|
2021-09-05 23:53:04 +00:00
|
|
|
settings.msDisplay = msDisplay;
|
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-17 04:30:54 +00:00
|
|
|
},
|
|
|
|
togglePaused() {
|
|
|
|
player.devSpeed = this.paused ? 1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2021-05-22 20:29:06 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
2021-06-21 04:29:55 +00: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-17 04:30:54 +00:00
|
|
|
margin-bottom: -10px;
|
2021-05-22 20:29:06 +00:00
|
|
|
}
|
2021-09-05 23:53:04 +00:00
|
|
|
|
2021-09-06 00:03:50 +00:00
|
|
|
*:deep() .tooltip-container {
|
2021-09-05 23:53:04 +00:00
|
|
|
display: inline;
|
|
|
|
margin-left: 5px;
|
|
|
|
}
|
2021-05-22 20:29:06 +00:00
|
|
|
</style>
|