feat: fixed camo

This commit is contained in:
TrèsAbhi committed 2024-02-22 10:56:45 -06:00
1 parent b1a1e07f7d
commit 1c3e98678f
3 files changed
+21 -16

No files matched your search

+2
View File
@@ -440,6 +440,7 @@ export async function definitions(production: boolean) {
}
});
const crew: Crew[] = [];
const fixedCamouflage = tankTags.includes('eventCamouflage_user');
Object.entries(tankDefinition.root.crew).forEach(([key, value]) => {
let entry: Crew;
@@ -478,6 +479,7 @@ export async function definitions(production: boolean) {
tankDefinitions[tankId] = {
id: tankId,
fixedCamouflage: fixedCamouflage ? true : undefined,
crew,
weight: tankDefinition.root.hull.weight,
health: tankDefinition.root.hull.maxHealth,
@@ -41,22 +41,24 @@ export function Miscellaneous() {
<Heading size="4">Miscellaneous</Heading>
<Flex gap="2" align="center">
<GenericTankComponentButton
icon={asset('icons/camo.webp')}
selected={camouflage}
iconStyles={{
top: '50%',
left: '50%',
transform: 'translate(calc(-50% + 4px), calc(-50% + 4px))',
}}
first
last
onClick={() => {
mutateTankopediaTemporary((draft) => {
draft.camouflage = !camouflage;
});
}}
/>
{!tank.fixedCamouflage && (
<GenericTankComponentButton
icon={asset('icons/camo.webp')}
selected={camouflage}
iconStyles={{
top: '50%',
left: '50%',
transform: 'translate(calc(-50% + 4px), calc(-50% + 4px))',
}}
first
last
onClick={() => {
mutateTankopediaTemporary((draft) => {
draft.camouflage = !camouflage;
});
}}
/>
)}
<GenericTankComponentButton
icon={asset('icons/boosters/equipment.webp')}
selected={cooldownBooster > 0}
+1
View File
@@ -34,6 +34,7 @@ export interface Crew {
}
export interface TankDefinition {
id: number;
fixedCamouflage?: boolean;
crew: Crew[];
health: number;
nation: string;