mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: functionality
This commit is contained in:
1 parent
cffd37c6f1
commit
fdf8580f5f
3 files changed
+14
-4
No files matched your search
+9
-1
@@ -1,10 +1,12 @@
|
||||
import { asset } from "@blitzkit/core";
|
||||
import { Box, Flex, Heading, Switch, Text } from "@radix-ui/themes";
|
||||
import { useLocale } from "../../../../hooks/useLocale";
|
||||
import { Duel } from "../../../../stores/duel";
|
||||
import { ConfigurationChildWrapper } from "./ConfigurationChildWrapper";
|
||||
|
||||
export function Equalizer() {
|
||||
const { strings } = useLocale();
|
||||
const equalize = Duel.use((state) => state.protagonist.equalize);
|
||||
|
||||
return (
|
||||
<ConfigurationChildWrapper>
|
||||
@@ -13,6 +15,11 @@ export function Equalizer() {
|
||||
</Heading>
|
||||
|
||||
<Box
|
||||
onClick={() => {
|
||||
Duel.mutate((draft) => {
|
||||
draft.protagonist.equalize = !draft.protagonist.equalize;
|
||||
});
|
||||
}}
|
||||
width="100%"
|
||||
style={{
|
||||
cursor: "pointer",
|
||||
@@ -24,6 +31,7 @@ export function Equalizer() {
|
||||
}}
|
||||
>
|
||||
<Flex
|
||||
align="center"
|
||||
width="100%"
|
||||
justify="between"
|
||||
p="4"
|
||||
@@ -35,7 +43,7 @@ export function Equalizer() {
|
||||
<Text>
|
||||
{strings.website.tools.tankopedia.configuration.equalizer.equalize}
|
||||
</Text>
|
||||
<Switch />
|
||||
<Switch checked={equalize} />
|
||||
</Flex>
|
||||
</Box>
|
||||
</ConfigurationChildWrapper>
|
||||
|
||||
@@ -2,9 +2,9 @@ import {
|
||||
createDefaultProvisions,
|
||||
type ProvisionDefinitions,
|
||||
type TankDefinition,
|
||||
} from '@blitzkit/core';
|
||||
import type { DuelMember } from '../../stores/duel';
|
||||
import { genericDefaultEquipmentMatrix } from '../../stores/duel/constants';
|
||||
} from "@blitzkit/core";
|
||||
import type { DuelMember } from "../../stores/duel";
|
||||
import { genericDefaultEquipmentMatrix } from "../../stores/duel/constants";
|
||||
|
||||
export function tankToDuelMember(
|
||||
tank: TankDefinition,
|
||||
@@ -26,5 +26,6 @@ export function tankToDuelMember(
|
||||
track: tank.tracks.at(-1)!,
|
||||
turret,
|
||||
assaultDistance: (gun.assault_ranges?.ranges[0].distance ?? 0) / 2,
|
||||
equalize: false,
|
||||
} satisfies DuelMember;
|
||||
}
|
||||
@@ -36,6 +36,7 @@ export interface DuelMember {
|
||||
camouflage: boolean;
|
||||
cooldownBooster: number;
|
||||
assaultDistance: number;
|
||||
equalize: boolean;
|
||||
}
|
||||
|
||||
export interface DuelStore {
|
||||
|
||||
Reference in new issue
Block a user