From 1e5411d279e69278d9ddb3abc059c0fa401c5268 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 20 Oct 2024 05:47:59 -0500 Subject: [PATCH] Remove processedPropType and convert all components to composition API --- src/components/Game.vue | 13 +- src/components/Layer.vue | 94 ++-- src/components/fields/Select.vue | 6 +- src/features/achievements/Achievement.vue | 123 ++--- src/features/bars/Bar.vue | 147 +++--- src/features/challenges/Challenge.vue | 215 ++++----- src/features/clickables/Clickable.vue | 121 ++--- src/features/grids/Grid.vue | 47 +- src/features/grids/GridCell.vue | 62 +-- src/features/infoboxes/Infobox.vue | 72 +-- src/features/particles/Particles.vue | 107 ++--- src/features/tabs/TabButton.vue | 74 ++- src/features/tabs/TabFamily.vue | 137 ++---- src/features/tooltips/Tooltip.vue | 89 ++-- src/features/trees/Tree.vue | 100 ++-- src/features/trees/TreeNode.vue | 72 +-- src/features/upgrades/Upgrade.vue | 132 ++--- src/util/vue.tsx | 43 +- .../game/__snapshots__/modifiers.test.ts.snap | 450 ++++++++++++++++++ 19 files changed, 1058 insertions(+), 1046 deletions(-) diff --git a/src/components/Game.vue b/src/components/Game.vue index 1975696..a1b239f 100644 --- a/src/components/Game.vue +++ b/src/components/Game.vue @@ -29,14 +29,23 @@ import player from "game/player"; import { computed, toRef, unref } from "vue"; import Layer from "./Layer.vue"; import Nav from "./Nav.vue"; +import { deepUnref } from "util/vue"; const tabs = toRef(player, "tabs"); const layerKeys = computed(() => Object.keys(layers)); const useHeader = projInfo.useHeader; function gatherLayerProps(layer: GenericLayer) { - const { display, minimized, name, color, minimizable, nodes, minimizedDisplay } = layer; - return { display, minimized, name, color, minimizable, nodes, minimizedDisplay }; + const { display, name, color, minimizable, minimizedDisplay } = deepUnref(layer); + return { + display, + name, + color, + minimizable, + minimizedDisplay, + minimized: layer.minimized, + nodes: layer.nodes + }; } diff --git a/src/components/Layer.vue b/src/components/Layer.vue index 1857535..7471c66 100644 --- a/src/components/Layer.vue +++ b/src/components/Layer.vue @@ -23,80 +23,48 @@ - diff --git a/src/components/fields/Select.vue b/src/components/fields/Select.vue index 72a31b2..067736f 100644 --- a/src/components/fields/Select.vue +++ b/src/components/fields/Select.vue @@ -16,8 +16,8 @@ diff --git a/src/features/bars/Bar.vue b/src/features/bars/Bar.vue index 4d7bb16..089df09 100644 --- a/src/features/bars/Bar.vue +++ b/src/features/bars/Bar.vue @@ -41,107 +41,68 @@ -