From 46e24db57cd743aec2d90e821c6d9ea923d7c7fb Mon Sep 17 00:00:00 2001 From: Yocto Date: Wed, 25 Dec 2024 20:42:09 -0700 Subject: [PATCH] Diamond --- client/src/redux/account/slice.ts | 8 ++++++++ client/src/ui/Profile.tsx | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/redux/account/slice.ts b/client/src/redux/account/slice.ts index 0a66b9f1..93e7b240 100644 --- a/client/src/redux/account/slice.ts +++ b/client/src/redux/account/slice.ts @@ -7,6 +7,8 @@ export type AccountState = { isLoggedIn: boolean; secret: string; gems: number; + diamonds: number; + totaldiamonds: number; skins: { equipped: number; owned: number[] }; is_v1: boolean; xp: number; @@ -18,6 +20,8 @@ const initialState: AccountState = { secret: '', isLoggedIn: false, gems: 0, + diamonds: 0, + totaldiamonds: 0, skins: { equipped: 1, owned: [1] }, is_v1: false, xp: 0, @@ -94,6 +98,8 @@ const accountSlice = createSlice({ state.username = ''; state.secret = ''; state.gems = 0; + state.diamonds = 0; + state.totaldiamonds = 0; state.isLoggedIn = false; state.skins = { equipped: 1, owned: [1] }; window.phaser_game?.events.emit('tokenUpdate', ''); @@ -107,6 +113,8 @@ const accountSlice = createSlice({ const previousToken = state.secret; state.secret = action.payload.secret; state.gems = action.payload.gems; + state.diamonds = action.payload.diamonds; + state.totaldiamonds = action.payload.totaldiamonds; state.skins = action.payload.skins; state.is_v1 = action.payload.is_v1; state.xp = action.payload.xp; diff --git a/client/src/ui/Profile.tsx b/client/src/ui/Profile.tsx index 55314d31..5a38d0ae 100644 --- a/client/src/ui/Profile.tsx +++ b/client/src/ui/Profile.tsx @@ -12,7 +12,8 @@ interface Stats { xp: number; kills: number; games: number; - coins: number + coins: number; + totaldiamonds: number; playtime: number; } interface AccountData { @@ -124,6 +125,7 @@ export default function Profile() { + {data.dailyStats && data.dailyStats.length &&