mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-02-17 18:02:45 +00:00
Merge branch 'main' into next
This commit is contained in:
parent
011df9cf2e
commit
6efda5ddce
7 changed files with 77 additions and 12 deletions
|
@ -42,6 +42,26 @@
|
|||
</div>
|
||||
</template>
|
||||
</Modal>
|
||||
<Modal
|
||||
:modelValue="
|
||||
player.ignoreDate === IgnoreDateSettings.AsIntended &&
|
||||
new Date().getMonth() !== 11 &&
|
||||
!main.dismissedIgnoreDateWarning.value
|
||||
"
|
||||
@update:model-value="value => (main.dismissedIgnoreDateWarning.value = !value)"
|
||||
>
|
||||
<template v-slot:header><h2>It's not December</h2></template>
|
||||
<template v-slot:body>
|
||||
<div>
|
||||
This game is intended to be played as an advent calendar, but it is currently
|
||||
not December. In order to allow players to still enjoy this game, there is a
|
||||
field in the options menu to ignore the month and/or day. You can also change
|
||||
that setting here:
|
||||
</div>
|
||||
<Spacer />
|
||||
<Select title="Ignore Date" :options="ignoreDateOptions" v-model="ignoreDate" />
|
||||
</template>
|
||||
</Modal>
|
||||
<Modal
|
||||
:modelValue="main.creditsOpen.value"
|
||||
@update:model-value="value => (main.creditsOpen.value = value)"
|
||||
|
@ -51,10 +71,9 @@
|
|||
</template>
|
||||
<template v-slot:body>
|
||||
<div>
|
||||
<component :is=convertComputable(main.credits) />
|
||||
<component :is="convertComputable(main.credits)" />
|
||||
</div>
|
||||
|
||||
|
||||
<!--<div v-if="main.loreScene.value !== -1">
|
||||
<Scene :day="main.loreScene.value" />
|
||||
<br />
|
||||
|
@ -78,17 +97,20 @@
|
|||
import { main } from "data/projEntry";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import Scene from "data/Scene.vue";
|
||||
import Select from "./fields/Select.vue";
|
||||
import type { GenericLayer } from "game/layers";
|
||||
import { layers } from "game/layers";
|
||||
import player from "game/player";
|
||||
import player, { IgnoreDateSettings } from "game/player";
|
||||
import { convertComputable } from "util/computed";
|
||||
import { computeOptionalComponent } from "util/vue";
|
||||
import { computed, toRef, unref } from "vue";
|
||||
import Layer from "./Layer.vue";
|
||||
import Modal from "./Modal.vue";
|
||||
import Nav from "./Nav.vue";
|
||||
import Spacer from "./layout/Spacer.vue";
|
||||
|
||||
const tabs = toRef(player, "tabs");
|
||||
const ignoreDate = toRef(player, "ignoreDate");
|
||||
const layerKeys = computed(() => Object.keys(layers));
|
||||
const useHeader = projInfo.useHeader;
|
||||
|
||||
|
@ -98,6 +120,12 @@ function gatherLayerProps(layer: GenericLayer) {
|
|||
const { display, minimized, name, color, minimizable, nodes, minimizedDisplay } = layer;
|
||||
return { display, minimized, name, color, minimizable, nodes, minimizedDisplay };
|
||||
}
|
||||
|
||||
const ignoreDateOptions = [
|
||||
{ label: "Don't Ignore", value: IgnoreDateSettings.AsIntended },
|
||||
{ label: "Ignore Month", value: IgnoreDateSettings.IgnoreMonth },
|
||||
{ label: "Ignore Month and Day", value: IgnoreDateSettings.IgnoreDay }
|
||||
];
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
</template>
|
||||
<template v-slot:body>
|
||||
<div v-if="isTab('behaviour')">
|
||||
<Select :title="ignoreDateTitle" :options="ignoreDateOptions" v-model="ignoreDate" />
|
||||
<Toggle v-if="projInfo.enablePausing" :title="isPausedTitle" v-model="isPaused" />
|
||||
<div v-if="canAutoSave">
|
||||
<Toggle :title="autosaveTitle" v-model="autosave" />
|
||||
<FeedbackButton v-if="!autosave" class="button save-button" @click="save()">
|
||||
|
@ -22,7 +24,6 @@
|
|||
<div style="text-align: center" v-else>
|
||||
Auto-saving is disabled while between days
|
||||
</div>
|
||||
<Toggle v-if="projInfo.enablePausing" :title="isPausedTitle" v-model="isPaused" />
|
||||
</div>
|
||||
<div v-if="isTab('appearance')">
|
||||
<Select :title="themeTitle" :options="themes" v-model="theme" />
|
||||
|
@ -41,7 +42,7 @@ import projInfo from "data/projInfo.json";
|
|||
import rawThemes from "data/themes";
|
||||
import { jsx } from "features/feature";
|
||||
import Tooltip from "features/tooltips/Tooltip.vue";
|
||||
import player from "game/player";
|
||||
import player, { IgnoreDateSettings } from "game/player";
|
||||
import settings, { settingFields } from "game/settings";
|
||||
import { camelToTitle } from "util/common";
|
||||
import { save } from "util/save";
|
||||
|
@ -80,13 +81,19 @@ const themes = Object.keys(rawThemes).map(theme => ({
|
|||
value: theme
|
||||
}));
|
||||
|
||||
const ignoreDateOptions = [
|
||||
{ label: "Don't Ignore", value: IgnoreDateSettings.AsIntended },
|
||||
{ label: "Ignore Month", value: IgnoreDateSettings.IgnoreMonth },
|
||||
{ label: "Ignore Month and Day", value: IgnoreDateSettings.IgnoreDay }
|
||||
];
|
||||
|
||||
const settingFieldsComponent = computed(() => {
|
||||
return coerceComponent(jsx(() => (<>{settingFields.map(render)}</>)));
|
||||
});
|
||||
|
||||
const { showTPS, theme, usingLog, alignUnits } = toRefs(settings);
|
||||
|
||||
const { autosave, autoPause } = toRefs(player);
|
||||
const { autosave, autoPause, ignoreDate } = toRefs(player);
|
||||
|
||||
const isPaused = computed({
|
||||
get() {
|
||||
|
@ -107,6 +114,12 @@ const autosaveTitle = jsx(() => (
|
|||
<desc>Automatically save the game every second or when the game is closed.</desc>
|
||||
</span>
|
||||
));
|
||||
const ignoreDateTitle = jsx(() => (
|
||||
<span class="option-title">
|
||||
Ignore Date<Tooltip display="Save-specific">*</Tooltip>
|
||||
<desc>Allow playing the game not as an advent calendar</desc>
|
||||
</span>
|
||||
));
|
||||
const isPausedTitle = jsx(() => (
|
||||
<span class="option-title">
|
||||
Pause game<Tooltip display="Save-specific">*</Tooltip>
|
||||
|
|
|
@ -15,6 +15,11 @@
|
|||
</li>
|
||||
<li class="fix">1.0.2 - Fixed white dye boost showing before unlocking</li>
|
||||
<li class="fix">1.0.2 - Hardcap packing resets to 3</li>
|
||||
<li class="feature">1.0.3 - Added option to ignore date</li>
|
||||
<li class="feature">
|
||||
1.0.4 - Added warning when it's not December to change the ignore date
|
||||
option
|
||||
</li>
|
||||
</ul>
|
||||
</details>
|
||||
</template>
|
||||
|
|
|
@ -50,6 +50,7 @@ import Notif from "components/Notif.vue";
|
|||
import { Visibility } from "features/feature";
|
||||
import Tooltip from "features/tooltips/Tooltip.vue";
|
||||
import { layers } from "game/layers";
|
||||
import player, { IgnoreDateSettings } from "game/player";
|
||||
import Decimal from "util/bignum";
|
||||
import { formatTime } from "util/break_eternity";
|
||||
import { Direction } from "util/common";
|
||||
|
@ -80,8 +81,8 @@ const canOpen = computed(
|
|||
() =>
|
||||
props.layer != null &&
|
||||
Decimal.gte(main.day.value, props.day) &&
|
||||
new Date().getMonth() === 11 &&
|
||||
new Date().getDate() >= props.day
|
||||
(new Date().getMonth() === 10 || player.ignoreDate !== IgnoreDateSettings.AsIntended) &&
|
||||
(new Date().getDate() >= props.day || player.ignoreDate === IgnoreDateSettings.IgnoreDay)
|
||||
);
|
||||
|
||||
const isMastering = main.isMastery;
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
import { createParticles } from "features/particles/particles";
|
||||
import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers";
|
||||
import { isPersistent, Persistent, persistent } from "game/persistence";
|
||||
import { IgnoreDateSettings } from "game/player";
|
||||
import type { Player } from "game/player";
|
||||
import player from "game/player";
|
||||
import { format, formatTime } from "util/bignum";
|
||||
|
@ -86,15 +87,23 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
const day = persistent<number>(1);
|
||||
const hasWon = persistent<boolean>(false);
|
||||
|
||||
const timeUntilNewDay = computed(
|
||||
() => (+new Date(new Date().getFullYear(), 11, day.value) - player.time) / 1000
|
||||
);
|
||||
const timeUntilNewDay = computed(() => {
|
||||
if (player.ignoreDate === IgnoreDateSettings.IgnoreDay) {
|
||||
return 0;
|
||||
} else {
|
||||
const month =
|
||||
player.ignoreDate === IgnoreDateSettings.IgnoreMonth ? new Date().getMonth() : 11;
|
||||
return (+new Date(new Date().getFullYear(), month, day.value) - player.time) / 1000;
|
||||
}
|
||||
});
|
||||
|
||||
const showLoreModal = ref<boolean>(false);
|
||||
const loreScene = ref<number>(-1);
|
||||
const loreTitle = ref<string>("");
|
||||
const loreBody = ref<CoercableComponent | undefined>();
|
||||
|
||||
const dismissedIgnoreDateWarning = ref(false);
|
||||
|
||||
const creditsOpen = ref<boolean>(false);
|
||||
|
||||
// I don't understand how this works
|
||||
|
@ -682,6 +691,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
loreScene,
|
||||
loreTitle,
|
||||
loreBody,
|
||||
dismissedIgnoreDateWarning,
|
||||
particles,
|
||||
showLoreModal,
|
||||
completeDay,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"discordName": "",
|
||||
"discordLink": "",
|
||||
|
||||
"versionNumber": "1.0.2",
|
||||
"versionNumber": "1.0.4",
|
||||
"versionTitle": "Initial Commit",
|
||||
|
||||
"allowGoBack": true,
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
import type { Ref } from "vue";
|
||||
import { reactive, unref } from "vue";
|
||||
|
||||
export enum IgnoreDateSettings {
|
||||
AsIntended,
|
||||
IgnoreMonth,
|
||||
IgnoreDay
|
||||
}
|
||||
|
||||
/** The player save data object. */
|
||||
export interface Player {
|
||||
/** The ID of this save. */
|
||||
|
@ -32,6 +38,7 @@ export interface Player {
|
|||
|
||||
/** Should the game be paused when the player complete a day? */
|
||||
autoPause: boolean;
|
||||
ignoreDate: IgnoreDateSettings;
|
||||
}
|
||||
|
||||
/** A layer's save data. Automatically unwraps refs. */
|
||||
|
@ -61,6 +68,7 @@ const player = reactive<Player>({
|
|||
modID: "",
|
||||
modVersion: "",
|
||||
layers: {},
|
||||
ignoreDate: IgnoreDateSettings.AsIntended,
|
||||
|
||||
autoPause: true
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue