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