Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions apps/discord-bot/src/commands/arcade/modes/overall-arcade.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import { Arcade } from "@statsify/schemas";
import { LocalizeFunction } from "@statsify/discord";
import { Table } from "#components";
import { arcadeWins } from "../wins.js";
import { arrayGroup } from "@statsify/util";

interface OverallArcadeTableProps {
Expand All @@ -19,30 +20,7 @@ interface OverallArcadeTableProps {
export const OverallArcadeTable = ({ stats, t }: OverallArcadeTableProps) => {
const rowSize = 3;

const games: [string, number][] = [
["Blocking Dead", stats.blockingDead.wins],
["Bounty Hunters", stats.bountyHunters.wins],
["Dragon Wars", stats.dragonWars.wins],
["Dropper", stats.dropper.wins],
["Ender Spleef", stats.enderSpleef.wins],
["Farm Hunt", stats.farmHunt.wins],
["Football", stats.football.wins],
["Galaxy Wars", stats.galaxyWars.wins],
["Hide And Seek", stats.hideAndSeek.overall.wins],
["Hole In The Wall", stats.holeInTheWall.wins],
["Hypixel Says", stats.hypixelSays.wins],
["Mini Walls", stats.miniWalls.wins],
["Party Games", stats.partyGames.wins],
["Pixel Painters", stats.pixelPainters.wins],
["Pixel Party", stats.pixelParty.overall.wins],
["Seasonal", stats.seasonal.totalWins],
["Throw Out", stats.throwOut.wins],
["Zombies", stats.zombies.overall.wins],
];

games.sort((a, b) => b[1] - a[1]);

const rows = arrayGroup(games, rowSize);
const rows = arrayGroup(arcadeWins(stats), rowSize);

const colors = ["§d", "§b", "§a", "§e", "§6", "§c"];

Expand Down
36 changes: 36 additions & 0 deletions apps/discord-bot/src/commands/arcade/wins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) Statsify
*
* This source code is licensed under the GNU GPL v3 license found in the
* LICENSE file in the root directory of this source tree.
* https://github.com/Statsify/statsify/blob/main/LICENSE
*/

import { Arcade } from "@statsify/schemas";

export function arcadeWins(stats: Arcade): [string, number][] {
const games: [string, number][] = [
["Blocking Dead", stats.blockingDead.wins],
["Bounty Hunters", stats.bountyHunters.wins],
["Dragon Wars", stats.dragonWars.wins],
["Dropper", stats.dropper.wins],
["Ender Spleef", stats.enderSpleef.wins],
["Farm Hunt", stats.farmHunt.wins],
["Football", stats.football.wins],
["Galaxy Wars", stats.galaxyWars.wins],
["Hide And Seek", stats.hideAndSeek.overall.wins],
["Hole In The Wall", stats.holeInTheWall.wins],
["Hypixel Says", stats.hypixelSays.wins],
["Mini Walls", stats.miniWalls.wins],
["Party Games", stats.partyGames.wins],
["Pixel Painters", stats.pixelPainters.wins],
["Pixel Party", stats.pixelParty.overall.wins],
["Seasonal", stats.seasonal.totalWins],
["Throw Out", stats.throwOut.wins],
["Zombies", stats.zombies.overall.wins],
];

games.sort((a, b) => b[1] - a[1]);

return games;
}
Loading
Loading