mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-28 11:01:39 +00:00
Add day progress and modifiers display
This commit is contained in:
parent
8b2161e9df
commit
0e93cc9401
1 changed files with 55 additions and 2 deletions
|
@ -26,6 +26,11 @@ import Factory from "./Factory.vue";
|
||||||
import "./styles/factory.css";
|
import "./styles/factory.css";
|
||||||
import coal from "./coal";
|
import coal from "./coal";
|
||||||
import { createAdditiveModifier, createSequentialModifier } from "game/modifiers";
|
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";
|
const id = "factory";
|
||||||
|
|
||||||
|
@ -857,16 +862,64 @@ const factory = createLayer(id, () => {
|
||||||
compSelected.value = name;
|
compSelected.value = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [
|
||||||
|
{
|
||||||
|
title: "Energy",
|
||||||
|
modifier: energy,
|
||||||
|
base: 0
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const showModifiersModal = ref(false);
|
||||||
|
const modifiersModal = jsx(() => (
|
||||||
|
<Modal
|
||||||
|
modelValue={showModifiersModal.value}
|
||||||
|
onUpdate:modelValue={(value: boolean) => (showModifiersModal.value = value)}
|
||||||
|
v-slots={{
|
||||||
|
header: () => <h2>{name} Modifiers</h2>,
|
||||||
|
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 {
|
return {
|
||||||
name,
|
name,
|
||||||
day,
|
day,
|
||||||
color,
|
color,
|
||||||
minWidth: 700,
|
minWidth: 700,
|
||||||
minimizable: false,
|
generalTabCollapsed,
|
||||||
style: { overflow: "hidden" },
|
|
||||||
components,
|
components,
|
||||||
display: jsx(() => (
|
display: jsx(() => (
|
||||||
<>
|
<>
|
||||||
|
<div>
|
||||||
|
{main.day.value === day
|
||||||
|
? `Do something to complete the day`
|
||||||
|
: `${name} Complete!`}{" "}
|
||||||
|
-{" "}
|
||||||
|
<button
|
||||||
|
class="button"
|
||||||
|
style="display: inline-block;"
|
||||||
|
onClick={() => (showModifiersModal.value = true)}
|
||||||
|
>
|
||||||
|
Check Modifiers
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{render(dayProgress)}
|
||||||
|
{render(modifiersModal)}
|
||||||
|
<Spacer />
|
||||||
<div class="factory-container">
|
<div class="factory-container">
|
||||||
<Factory
|
<Factory
|
||||||
application={app}
|
application={app}
|
||||||
|
|
Loading…
Reference in a new issue