From 0e93cc94012437d2cd3a8bfc1f6be4ab58ebf9ea Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 21 Dec 2022 22:05:35 -0600 Subject: [PATCH] Add day progress and modifiers display --- src/data/layers/factory.tsx | 57 +++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index b5a2aa3..11b7f0d 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -26,6 +26,11 @@ import Factory from "./Factory.vue"; import "./styles/factory.css"; import coal from "./coal"; import { createAdditiveModifier, createSequentialModifier } from "game/modifiers"; +import { main } from "data/projEntry"; +import { render } from "util/vue"; +import { createCollapsibleModifierSections } from "data/common"; +import Modal from "components/Modal.vue"; +import { createBar, GenericBar } from "features/bars/bar"; const id = "factory"; @@ -857,16 +862,64 @@ const factory = createLayer(id, () => { compSelected.value = name; } + const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ + { + title: "Energy", + modifier: energy, + base: 0 + } + ]); + const showModifiersModal = ref(false); + const modifiersModal = jsx(() => ( + (showModifiersModal.value = value)} + v-slots={{ + header: () =>

{name} Modifiers

, + body: generalTab + }} + /> + )); + + const dayProgress = createBar(() => ({ + direction: Direction.Right, + width: 600, + height: 25, + progress: () => (main.day.value === day ? 0 : 1), + display: jsx(() => (main.day.value === day ? <>Requirement progress here : "")) + })) as GenericBar; + + watchEffect(() => { + if (main.day.value === day && false) { + main.completeDay(); + } + }); + return { name, day, color, minWidth: 700, - minimizable: false, - style: { overflow: "hidden" }, + generalTabCollapsed, components, display: jsx(() => ( <> +
+ {main.day.value === day + ? `Do something to complete the day` + : `${name} Complete!`}{" "} + -{" "} + +
+ {render(dayProgress)} + {render(modifiersModal)} +