From 50fec808310caad24376327f7f7951971ef4e759 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 23 Apr 2022 21:35:50 -0500 Subject: [PATCH] Add tooltips to various things --- src/data/layers/aca/c.tsx | 31 ++++++++++++++++++++++++++++--- src/data/layers/aca/f.tsx | 6 ++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/data/layers/aca/c.tsx b/src/data/layers/aca/c.tsx index d046e51..65570fb 100644 --- a/src/data/layers/aca/c.tsx +++ b/src/data/layers/aca/c.tsx @@ -30,12 +30,20 @@ import { createResource, displayResource, trackBest } from "features/resources/r import Resource from "features/resources/Resource.vue"; import { createTab } from "features/tabs/tab"; import { createTabFamily } from "features/tabs/tabFamily"; -import { createTree, createTreeNode, GenericTreeNode, TreeBranch } from "features/trees/tree"; +import { addTooltip, TooltipDirection } from "features/tooltips/tooltip"; +import { + createResourceTooltip, + createTree, + createTreeNode, + GenericTreeNode, + TreeBranch +} from "features/trees/tree"; import { createUpgrade } from "features/upgrades/upgrade"; import { createLayer } from "game/layers"; import { createAdditiveModifier, createExponentialModifier, + createModifierSection, createSequentialModifier } from "game/modifiers"; import { persistent } from "game/persistence"; @@ -357,8 +365,8 @@ const layer = createLayer(id, () => { gainResource: points, roundUpCost: true, gainModifier: createSequentialModifier( - createExponentialModifier(2), - createAdditiveModifier(1) + createExponentialModifier(2, "Because I felt like it"), + createAdditiveModifier(1, "Nice modifier") ) })); @@ -404,6 +412,10 @@ const layer = createLayer(id, () => { textDecoration: "underline" } })); + addTooltip(treeNode, { + display: createResourceTooltip(points), + pinnable: true + }); const resetButton = createResetButton(() => ({ conversion, @@ -414,6 +426,19 @@ const layer = createLayer(id, () => { }, resetDescription: "Melt your points into " })); + addTooltip(resetButton, { + display: jsx(() => + createModifierSection( + "Modifiers", + "", + conversion.gainModifier, + conversion.scaling.currentGain(conversion) + ) + ), + pinnable: true, + direction: TooltipDirection.DOWN, + style: "width: 400px; text-align: left" + }); const g = createTreeNode(() => ({ display: "TH", diff --git a/src/data/layers/aca/f.tsx b/src/data/layers/aca/f.tsx index 2067ef8..b32fa09 100644 --- a/src/data/layers/aca/f.tsx +++ b/src/data/layers/aca/f.tsx @@ -9,6 +9,8 @@ import { createParticles } from "features/particles/particles"; import { createReset } from "features/reset"; import MainDisplay from "features/resources/MainDisplay.vue"; import { createResource, displayResource } from "features/resources/resource"; +import { addTooltip } from "features/tooltips/tooltip"; +import { createResourceTooltip } from "features/trees/tree"; import { createLayer } from "game/layers"; import { createMultiplicativeModifier } from "game/modifiers"; import { persistent } from "game/persistence"; @@ -129,6 +131,10 @@ const layer = createLayer(id, () => { return Decimal.gte(main.points.value, 10); } })); + addTooltip(treeNode, { + display: createResourceTooltip(points), + pinnable: true + }); const resetButton = createResetButton(() => ({ conversion,