Skip to content

Commit

Permalink
Diamond
Browse files Browse the repository at this point in the history
  • Loading branch information
YoctoProductions committed Dec 26, 2024
1 parent 24005e0 commit 46e24db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client/src/redux/account/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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', '');
Expand All @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion client/src/ui/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ interface Stats {
xp: number;
kills: number;
games: number;
coins: number
coins: number;
totaldiamonds: number;
playtime: number;
}
interface AccountData {
Expand Down Expand Up @@ -124,6 +125,7 @@ export default function Profile() {
<Card title="Total Playtime" text={data.totalStats ? secondsToTime(data.totalStats.playtime) : 0} />
<Card title="Stabs" text={data.totalStats ? numberWithCommas(data.totalStats.kills) : 0} />
<Card title="Skins Owned" text={data.account.skins.owned.length} />
<Card title="Skins Owned" text={data.totalStats ? numberWithCommas(data.totalStats.totaldiamonds) : 0} />
</div>

{data.dailyStats && data.dailyStats.length &&
Expand Down

0 comments on commit 46e24db

Please sign in to comment.