mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: integrated tank definitions
This commit is contained in:
1 parent
adb0bb2e69
commit
2aefe3f9e3
26 files changed
+475
-273
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import { Button, Text } from '@radix-ui/themes';
|
||||
import { ComponentProps } from 'react';
|
||||
import { asset } from '../core/blitzkrieg/asset';
|
||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitzkrieg/tankDefinitions';
|
||||
|
||||
interface ModuleButtonProps
|
||||
extends Omit<ComponentProps<typeof Button>, 'type'> {
|
||||
type: string;
|
||||
tier: Tier;
|
||||
selected?: boolean;
|
||||
}
|
||||
|
||||
export function ModuleButtons({
|
||||
type,
|
||||
tier,
|
||||
selected,
|
||||
style,
|
||||
...props
|
||||
}: ModuleButtonProps) {
|
||||
return (
|
||||
<Button
|
||||
radius="medium"
|
||||
color={selected ? undefined : 'gray'}
|
||||
variant={selected ? 'solid' : 'soft'}
|
||||
style={{
|
||||
padding: 0,
|
||||
width: 48,
|
||||
height: 40,
|
||||
position: 'relative',
|
||||
...style,
|
||||
}}
|
||||
{...props}
|
||||
>
|
||||
<img
|
||||
src={asset(`icons/modules/${type}.webp`)}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
transform: 'translate(calc(-50% + 2px), calc(-50% + 2px))',
|
||||
}}
|
||||
/>
|
||||
<Text
|
||||
size="1"
|
||||
weight="bold"
|
||||
style={{
|
||||
zIndex: 1,
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
right: 8,
|
||||
textAlign: 'right',
|
||||
}}
|
||||
>
|
||||
{TIER_ROMAN_NUMERALS[tier]}
|
||||
</Text>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
TANK_ICONS,
|
||||
TANK_ICONS_COLLECTOR,
|
||||
TANK_ICONS_PREMIUM,
|
||||
} from '../../../core/blitzkrieg/definitions/tanks';
|
||||
} from '../../../core/blitzkrieg/tankDefinitions';
|
||||
import { theme } from '../../../stitches.config';
|
||||
|
||||
export enum TreeTypeEnum {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Tier } from '../core/blitzkrieg/definitions/tanks';
|
||||
import { Tier } from '../core/blitzkrieg/tankDefinitions';
|
||||
import { theme } from '../stitches.config';
|
||||
|
||||
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
||||
|
||||
Reference in new issue
Block a user