mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: shell numbers
This commit is contained in:
1 parent
77ac1453f3
commit
a9e88f6943
3 files changed
+16
-9
No files matched your search
@@ -13,7 +13,10 @@ import { useState } from 'react';
|
|||||||
import { ModuleButton } from '../../../../../../components/ModuleButton';
|
import { ModuleButton } from '../../../../../../components/ModuleButton';
|
||||||
import { SmallTankIcon } from '../../../../../../components/SmallTankIcon';
|
import { SmallTankIcon } from '../../../../../../components/SmallTankIcon';
|
||||||
import { resolveNearPenetration } from '../../../../../../core/blitz/resolveNearPenetration';
|
import { resolveNearPenetration } from '../../../../../../core/blitz/resolveNearPenetration';
|
||||||
import { SHELL_NAMES } from '../../../../../../core/blitzkrieg/tankDefinitions';
|
import {
|
||||||
|
SHELL_NAMES,
|
||||||
|
TIER_ROMAN_NUMERALS,
|
||||||
|
} from '../../../../../../core/blitzkrieg/tankDefinitions';
|
||||||
import { mutateDuel, useDuel } from '../../../../../../stores/duel';
|
import { mutateDuel, useDuel } from '../../../../../../stores/duel';
|
||||||
import { useTankopediaTemporary } from '../../../../../../stores/tankopedia';
|
import { useTankopediaTemporary } from '../../../../../../stores/tankopedia';
|
||||||
import { TankSearch } from '../../../components/TankSearch';
|
import { TankSearch } from '../../../components/TankSearch';
|
||||||
@@ -39,6 +42,7 @@ export function AntagonistBar() {
|
|||||||
shell={shell.icon}
|
shell={shell.icon}
|
||||||
rowChild
|
rowChild
|
||||||
first={index === 0}
|
first={index === 0}
|
||||||
|
discriminator={`${index + 1}`}
|
||||||
key={shell.id}
|
key={shell.id}
|
||||||
last={index === antagonist.gun.shells.length - 1}
|
last={index === antagonist.gun.shells.length - 1}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -141,7 +145,9 @@ export function AntagonistBar() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
selected={antagonist.turret.id === turret.id}
|
selected={antagonist.turret.id === turret.id}
|
||||||
tier={turret.tier}
|
discriminator={
|
||||||
|
TIER_ROMAN_NUMERALS[turret.tier]
|
||||||
|
}
|
||||||
type="module"
|
type="module"
|
||||||
module="turret"
|
module="turret"
|
||||||
/>
|
/>
|
||||||
@@ -164,7 +170,7 @@ export function AntagonistBar() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
selected={antagonist.gun.id === gun.id}
|
selected={antagonist.gun.id === gun.id}
|
||||||
tier={gun.tier}
|
discriminator={TIER_ROMAN_NUMERALS[gun.tier]}
|
||||||
type="module"
|
type="module"
|
||||||
module="gun"
|
module="gun"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Flex, Heading } from '@radix-ui/themes';
|
|||||||
import { use } from 'react';
|
import { use } from 'react';
|
||||||
import { ModuleButton } from '../../../../../components/ModuleButton';
|
import { ModuleButton } from '../../../../../components/ModuleButton';
|
||||||
import { equipmentDefinitions } from '../../../../../core/blitzkrieg/equipmentDefinitions';
|
import { equipmentDefinitions } from '../../../../../core/blitzkrieg/equipmentDefinitions';
|
||||||
|
import { TIER_ROMAN_NUMERALS } from '../../../../../core/blitzkrieg/tankDefinitions';
|
||||||
import { mutateDuel, useDuel } from '../../../../../stores/duel';
|
import { mutateDuel, useDuel } from '../../../../../stores/duel';
|
||||||
import {
|
import {
|
||||||
mutateTankopediaTemporary,
|
mutateTankopediaTemporary,
|
||||||
@@ -34,7 +35,7 @@ export function Configure() {
|
|||||||
selected={protagonist.turret.id === thisTurret.id}
|
selected={protagonist.turret.id === thisTurret.id}
|
||||||
type="module"
|
type="module"
|
||||||
module="turret"
|
module="turret"
|
||||||
tier={thisTurret.tier}
|
discriminator={TIER_ROMAN_NUMERALS[thisTurret.tier]}
|
||||||
first={index === 0}
|
first={index === 0}
|
||||||
last={index === protagonist.tank.turrets.length - 1}
|
last={index === protagonist.tank.turrets.length - 1}
|
||||||
rowChild
|
rowChild
|
||||||
@@ -58,7 +59,7 @@ export function Configure() {
|
|||||||
key={thisGun.id}
|
key={thisGun.id}
|
||||||
type="module"
|
type="module"
|
||||||
module="gun"
|
module="gun"
|
||||||
tier={thisGun.tier}
|
discriminator={TIER_ROMAN_NUMERALS[thisGun.tier]}
|
||||||
selected={protagonist.gun.id === thisGun.id}
|
selected={protagonist.gun.id === thisGun.id}
|
||||||
first={index === 0}
|
first={index === 0}
|
||||||
last={index === protagonist.turret.guns.length - 1}
|
last={index === protagonist.turret.guns.length - 1}
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
import { Button, Text } from '@radix-ui/themes';
|
import { Button, Text } from '@radix-ui/themes';
|
||||||
import { ComponentProps } from 'react';
|
import { ComponentProps } from 'react';
|
||||||
import { asset } from '../core/blitzkrieg/asset';
|
import { asset } from '../core/blitzkrieg/asset';
|
||||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitzkrieg/tankDefinitions';
|
|
||||||
|
|
||||||
type ModuleButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {
|
type ModuleButtonProps = Omit<ComponentProps<typeof Button>, 'type'> & {
|
||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
first?: boolean;
|
first?: boolean;
|
||||||
last?: boolean;
|
last?: boolean;
|
||||||
rowChild?: boolean;
|
rowChild?: boolean;
|
||||||
|
discriminator?: string;
|
||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
type: 'module';
|
type: 'module';
|
||||||
module: string;
|
module: string;
|
||||||
tier: Tier;
|
|
||||||
}
|
}
|
||||||
| {
|
| {
|
||||||
type: 'shell';
|
type: 'shell';
|
||||||
@@ -30,6 +29,7 @@ export function ModuleButton({
|
|||||||
first = false,
|
first = false,
|
||||||
last = false,
|
last = false,
|
||||||
rowChild,
|
rowChild,
|
||||||
|
discriminator,
|
||||||
...props
|
...props
|
||||||
}: ModuleButtonProps) {
|
}: ModuleButtonProps) {
|
||||||
return (
|
return (
|
||||||
@@ -74,7 +74,7 @@ export function ModuleButton({
|
|||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{props.type === 'module' && (
|
{discriminator !== undefined && (
|
||||||
<Text
|
<Text
|
||||||
size="1"
|
size="1"
|
||||||
weight="bold"
|
weight="bold"
|
||||||
@@ -86,7 +86,7 @@ export function ModuleButton({
|
|||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{TIER_ROMAN_NUMERALS[props.tier]}
|
{discriminator}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in new issue
Block a user