mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: use new tankopedia
This commit is contained in:
1 parent
c5214f8d89
commit
bdc7132337
20 files changed
+78
-74
No files matched your search
@@ -1,11 +1,11 @@
|
||||
import { TreeTypeEnum } from '../../components/Tanks';
|
||||
import { tankopedia } from '../blitzstars/tankopedia';
|
||||
import { tankopedia } from '../blitzkrieg/tankopedia';
|
||||
|
||||
export default async function getTreeType(id: number) {
|
||||
const entry = (await tankopedia)[id];
|
||||
|
||||
if (entry?.is_collectible) return TreeTypeEnum.Collector;
|
||||
if (entry?.is_premium) return TreeTypeEnum.Premium;
|
||||
if (entry.tree_type === 'collector') return TreeTypeEnum.Collector;
|
||||
if (entry.tree_type === 'premium') return TreeTypeEnum.Premium;
|
||||
|
||||
return TreeTypeEnum.TechTree;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { go } from 'fuzzysort';
|
||||
import { TANKS, tankopedia } from '../blitzkrieg/tankopedia';
|
||||
import { UserError } from '../blitzkrieg/userError';
|
||||
import { TANKS, tankopedia } from '../blitzstars/tankopedia';
|
||||
|
||||
export default async function resolveTankId(tank: string | number) {
|
||||
const number = typeof tank === 'string' ? parseInt(tank) : tank;
|
||||
@@ -16,7 +16,7 @@ export default async function resolveTankId(tank: string | number) {
|
||||
cause: `Could not find tank by the name "${tank}".`,
|
||||
});
|
||||
} else {
|
||||
return searchResult[0].obj.tank_id;
|
||||
return searchResult[0].obj.id;
|
||||
}
|
||||
} else {
|
||||
if ((await tankopedia)[number]) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tankopedia } from '../blitzstars/tankopedia';
|
||||
import { tankopedia } from '../blitzkrieg/tankopedia';
|
||||
|
||||
export default async function resolveTankName(tankId: number) {
|
||||
const tankopediaName = (await tankopedia)[tankId]?.name;
|
||||
|
||||
Reference in new issue
Block a user