Add day to save manager

This commit is contained in:
thepaperpilot 2022-12-01 00:10:05 -06:00
parent 3825732e2e
commit 9bdff9332b

View file

@ -59,6 +59,7 @@
<span class="save-version">v{{ save.modVersion }}</span
><br />
<div v-if="currentTime">Last played {{ dateFormat.format(currentTime) }}</div>
<div v-if="progressDisplay"><component :is="progressDisplay" /></div>
</div>
<div class="details" v-else-if="save.error == undefined && isEditing">
<Text v-model="newName" class="editname" @submit="changeName" />
@ -70,9 +71,11 @@
</template>
<script setup lang="ts">
import { main } from "data/projEntry";
import Tooltip from "features/tooltips/Tooltip.vue";
import player from "game/player";
import player, { LayerData } from "game/player";
import { Direction } from "util/common";
import { computeComponent } from "util/vue";
import { computed, ref, toRefs, watch } from "vue";
import DangerButton from "./fields/DangerButton.vue";
import FeedbackButton from "./fields/FeedbackButton.vue";
@ -111,6 +114,12 @@ const currentTime = computed(() =>
isActive.value ? player.time : (save.value && save.value.time) || 0
);
const progressDisplay = computeComponent(
computed(() => {
return `Day ${(save.value?.layers?.main as LayerData<typeof main> | undefined)?.day ?? 1}`;
})
);
function changeName() {
emit("editName", newName.value);
isEditing.value = false;