feat: added collector tanks to /ownedtanks

This commit is contained in:
TresAbhi committed 2023-07-10 18:16:33 +00:00
1 parent 80ffff322c
commit feeb850ca9
5 files changed
+65 -21

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { TreeType } from '../../components/Tanks/index.js';
import { tankopedia } from './tankopedia.js';
export default async function getTreeType(id: number) {
const entry = (await tankopedia)[id];
if (entry?.is_collectible) return TreeType.Collector;
if (entry?.is_premium) return TreeType.Premium;
return TreeType.TechTree;
}
+8
View File
@@ -2,6 +2,7 @@ export interface TankopediaEntry {
name: string;
nation: string;
is_premium: boolean;
is_collectible: boolean;
tier: number;
cost: { price_credit: number; price_gold: number };
images: { preview: string; normal: string };
@@ -45,6 +46,13 @@ export const TANK_ICONS_PREMIUM: Record<string, string> = {
heavyTank: 'https://i.imgur.com/P3vbmyA.png',
};
export const TANK_ICONS_COLLECTOR: Record<string, string> = {
'AT-SPG': 'https://i.imgur.com/WTjeirB.png',
lightTank: 'https://i.imgur.com/EwhtKkU.png',
mediumTank: 'https://i.imgur.com/u8YDMBh.png',
heavyTank: 'https://i.imgur.com/8xRf3nc.png',
};
export type Tier = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
export const TIER_ROMAN_NUMERALS: Record<Tier, string> = {