From ff14443102e9311bbae038c601f4504c307f85ac Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Wed, 11 Dec 2024 13:58:14 -0600 Subject: [PATCH] Complete the rewrite Renderables no longer get wrapped in computed refs, because JSX.Elements don't like that (desyncs with the DOM) Relatedly, a lot of display functions got fairly simplified, removing unnecessary local components Added `MaybeGetter` utility type for something that may be a getter function or a static value (but not a ref) Made Achievement.vue use a Renderable for the display. The object of components can still be passed to `createAchievement` Made Challenge.vue use a Renderable for the display. The object of components can still be passed to `createChallenge` Fixed some issues introduced by the rewrite that broke particles systems --- src/components/fields/Select.vue | 5 +- src/components/fields/Text.vue | 5 +- src/components/fields/Toggle.vue | 5 +- src/components/layout/Collapsible.vue | 7 +- src/data/common.tsx | 78 +++++++++---------- src/data/layers/aca/c.tsx | 32 ++++---- src/data/layers/aca/f.tsx | 8 +- src/features/VueFeature.vue | 3 +- src/features/achievements/Achievement.vue | 30 +------- src/features/achievements/achievement.tsx | 93 +++++++++++++---------- src/features/bars/bar.tsx | 8 +- src/features/challenges/Challenge.vue | 30 +------- src/features/challenges/challenge.tsx | 91 +++++++++++++--------- src/features/clickables/action.tsx | 66 ++++++++-------- src/features/clickables/clickable.tsx | 42 +++++----- src/features/clickables/repeatable.tsx | 48 +++++------- src/features/clickables/upgrade.tsx | 55 +++++++------- src/features/conversion.ts | 4 +- src/features/feature.ts | 27 ++++--- src/features/grids/grid.tsx | 84 +++++++++++--------- src/features/infoboxes/infobox.tsx | 14 ++-- src/features/particles/Particles.vue | 1 + src/features/particles/particles.tsx | 9 ++- src/features/resources/MainDisplay.vue | 5 +- src/features/tabs/tab.ts | 14 ++-- src/features/tabs/tabFamily.tsx | 25 +++--- src/features/trees/tree.tsx | 16 ++-- src/game/boards/board.tsx | 15 +++- src/game/layers.tsx | 24 +++--- src/game/modifiers.tsx | 51 +++++-------- src/game/requirements.tsx | 16 ++-- src/game/settings.ts | 22 +++--- src/util/computed.ts | 2 + src/util/vue.tsx | 28 ++++--- src/wrappers/marks/mark.tsx | 5 +- src/wrappers/tooltips/tooltip.tsx | 14 ++-- tests/game/modifiers.test.ts | 5 +- 37 files changed, 504 insertions(+), 483 deletions(-) diff --git a/src/components/fields/Select.vue b/src/components/fields/Select.vue index eda049a..30f4eb5 100644 --- a/src/components/fields/Select.vue +++ b/src/components/fields/Select.vue @@ -15,15 +15,16 @@