From b0ed976a1d37bd041ed0c0812f57caaa98f32027 Mon Sep 17 00:00:00 2001 From: Hikari Date: Sat, 7 Mar 2026 00:21:13 -0800 Subject: [PATCH] feat: add donate/discord nav buttons and fix runestone display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds Donate and Discord link buttons to the resource bar nav. Also fixes a display discrepancy where the resource bar showed resources.runestones (always 0) instead of the actual prestige runestone balance from prestige.runestones. ✨ This feature was implemented with help from Hikari~ 🌸 --- apps/web/src/components/game/GameLayout.tsx | 1 + apps/web/src/components/ui/ResourceBar.tsx | 27 ++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/game/GameLayout.tsx b/apps/web/src/components/game/GameLayout.tsx index 5e43cd4..dcbbc58 100644 --- a/apps/web/src/components/game/GameLayout.tsx +++ b/apps/web/src/components/game/GameLayout.tsx @@ -61,6 +61,7 @@ export const GameLayout = (): React.JSX.Element => {
{ setEditingProfile(true); }} diff --git a/apps/web/src/components/ui/ResourceBar.tsx b/apps/web/src/components/ui/ResourceBar.tsx index 1bd2d73..f305b70 100644 --- a/apps/web/src/components/ui/ResourceBar.tsx +++ b/apps/web/src/components/ui/ResourceBar.tsx @@ -4,6 +4,7 @@ import { RESOURCE_CAP } from "../../engine/tick.js"; interface ResourceBarProps { resources: Resource; + runestones: number; prestigeCount: number; profileUrl: string; onEditProfile: () => void; @@ -26,6 +27,7 @@ const RESOURCE_FULL_TOOLTIP = "This resource is full! Consider spending some or export const ResourceBar = ({ resources, + runestones, prestigeCount, profileUrl, onEditProfile, @@ -34,7 +36,7 @@ export const ResourceBar = ({ onForceSync, }: ResourceBarProps): React.JSX.Element => { const { formatNumber, syncError } = useGame(); - const anyFull = Object.values(resources).some((v) => v >= RESOURCE_CAP); + const anyFull = [resources.gold, resources.essence, resources.crystals].some((v) => v >= RESOURCE_CAP); return ( <>
@@ -56,11 +58,10 @@ export const ResourceBar = ({ Crystals {resources.crystals >= RESOURCE_CAP && FULL}
-
= RESOURCE_CAP ? " resource-full" : ""}`}> +
🔮 - {formatNumber(resources.runestones)} + {formatNumber(runestones)} Runestones - {resources.runestones >= RESOURCE_CAP && FULL}
{prestigeCount > 0 && (
@@ -68,6 +69,24 @@ export const ResourceBar = ({
)}
+ + 💜 Donate + + + 💬 Discord + {syncError !== null ? ( ❌ Save failed