From 1c3e98678f11ee33c2f413ad3b73b4a7ce8b7a49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:56:45 -0600 Subject: [PATCH] feat: fixed camo --- scripts/buildAssets/definitions.ts | 2 ++ .../components/Miscellaneous.tsx | 34 ++++++++++--------- src/core/blitzkrieg/tankDefinitions.ts | 1 + 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/scripts/buildAssets/definitions.ts b/scripts/buildAssets/definitions.ts index 0b87de030..41a7c5f08 100644 --- a/scripts/buildAssets/definitions.ts +++ b/scripts/buildAssets/definitions.ts @@ -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, diff --git a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Miscellaneous.tsx b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Miscellaneous.tsx index 68b10978a..a7cb600e9 100644 --- a/src/app/tools/tankopedia/[id]/components/Characteristics/components/Miscellaneous.tsx +++ b/src/app/tools/tankopedia/[id]/components/Characteristics/components/Miscellaneous.tsx @@ -41,22 +41,24 @@ export function Miscellaneous() { Miscellaneous - { - mutateTankopediaTemporary((draft) => { - draft.camouflage = !camouflage; - }); - }} - /> + {!tank.fixedCamouflage && ( + { + mutateTankopediaTemporary((draft) => { + draft.camouflage = !camouflage; + }); + }} + /> + )} 0} diff --git a/src/core/blitzkrieg/tankDefinitions.ts b/src/core/blitzkrieg/tankDefinitions.ts index 6df4c7093..3cadb52a7 100644 --- a/src/core/blitzkrieg/tankDefinitions.ts +++ b/src/core/blitzkrieg/tankDefinitions.ts @@ -34,6 +34,7 @@ export interface Crew { } export interface TankDefinition { id: number; + fixedCamouflage?: boolean; crew: Crew[]; health: number; nation: string;