2021-05-22 20:29:06 +00:00
|
|
|
<template>
|
2022-01-14 04:25:47 +00:00
|
|
|
<Modal v-model="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-17 04:30:54 +00:00
|
|
|
<template v-slot:header>
|
|
|
|
<div class="header">
|
|
|
|
<h2>Options</h2>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<template v-slot:body>
|
2022-01-14 04:25:47 +00:00
|
|
|
<Select title="Theme" :options="themes" v-model="theme" />
|
|
|
|
<Select title="Show Milestones" :options="msDisplayOptions" v-model="msDisplay" />
|
|
|
|
<Toggle title="Show TPS" v-model="showTPS" />
|
|
|
|
<Toggle title="Hide Maxed Challenges" v-model="hideChallenges" />
|
|
|
|
<Toggle title="Unthrottled" v-model="unthrottled" />
|
2022-01-25 04:25:34 +00:00
|
|
|
<Toggle :title="offlineProdTitle" v-model="offlineProd" />
|
|
|
|
<Toggle :title="autosaveTitle" v-model="autosave" />
|
|
|
|
<Toggle :title="isPausedTitle" v-model="isPaused" />
|
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>
|
|
|
|
|
2022-01-25 04:25:34 +00:00
|
|
|
<script setup lang="tsx">
|
2022-01-14 04:25:47 +00:00
|
|
|
import Modal from "@/components/system/Modal.vue";
|
|
|
|
import rawThemes from "@/data/themes";
|
|
|
|
import { MilestoneDisplay } from "@/features/milestone";
|
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";
|
2021-09-05 23:53:04 +00:00
|
|
|
import settings from "@/game/settings";
|
2022-01-14 04:25:47 +00:00
|
|
|
import { camelToTitle } from "@/util/common";
|
2022-02-27 19:49:34 +00:00
|
|
|
import { computed, ref, toRefs } from "vue";
|
2022-01-14 04:25:47 +00:00
|
|
|
import Toggle from "../fields/Toggle.vue";
|
|
|
|
import Select from "../fields/Select.vue";
|
2022-01-25 04:25:34 +00:00
|
|
|
import Tooltip from "./Tooltip.vue";
|
2022-02-27 19:49:34 +00:00
|
|
|
import { jsx } from "@/features/feature";
|
2021-05-22 20:29:06 +00:00
|
|
|
|
2022-01-14 04:25:47 +00:00
|
|
|
const isOpen = ref(false);
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
open() {
|
|
|
|
isOpen.value = true;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const themes = Object.keys(rawThemes).map(theme => ({
|
|
|
|
label: camelToTitle(theme),
|
|
|
|
value: theme
|
|
|
|
}));
|
|
|
|
|
|
|
|
// TODO allow features to register options
|
|
|
|
const msDisplayOptions = Object.values(MilestoneDisplay).map(option => ({
|
|
|
|
label: camelToTitle(option),
|
|
|
|
value: option
|
|
|
|
}));
|
|
|
|
|
|
|
|
const { showTPS, hideChallenges, theme, msDisplay, unthrottled } = toRefs(settings);
|
2022-01-25 04:25:34 +00:00
|
|
|
const { autosave, offlineProd } = toRefs(player);
|
2022-01-14 04:25:47 +00:00
|
|
|
const isPaused = computed({
|
|
|
|
get() {
|
2022-02-27 19:49:34 +00:00
|
|
|
return player.devSpeed === 0;
|
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
|
|
|
},
|
2022-01-14 04:25:47 +00:00
|
|
|
set(value: boolean) {
|
2022-02-27 19:49:34 +00:00
|
|
|
player.devSpeed = value ? 0 : null;
|
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
|
|
|
}
|
|
|
|
});
|
2022-01-25 04:25:34 +00:00
|
|
|
|
2022-02-27 19:49:34 +00:00
|
|
|
const offlineProdTitle = jsx(() => (
|
|
|
|
<span>
|
2022-01-25 04:25:34 +00:00
|
|
|
Offline Production<Tooltip display="Save-specific">*</Tooltip>
|
2022-02-27 19:49:34 +00:00
|
|
|
</span>
|
|
|
|
));
|
|
|
|
const autosaveTitle = jsx(() => (
|
|
|
|
<span>
|
2022-01-25 04:25:34 +00:00
|
|
|
Autosave<Tooltip display="Save-specific">*</Tooltip>
|
2022-02-27 19:49:34 +00:00
|
|
|
</span>
|
|
|
|
));
|
|
|
|
const isPausedTitle = jsx(() => (
|
|
|
|
<span>
|
2022-01-25 04:25:34 +00:00
|
|
|
Pause game<Tooltip display="Save-specific">*</Tooltip>
|
2022-02-27 19:49:34 +00:00
|
|
|
</span>
|
|
|
|
));
|
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>
|