mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: removed spaced armor visuals
This commit is contained in:
1 parent
40c69382a1
commit
aadcaedae5
8 files changed
+18
-100
No files matched your search
@@ -132,6 +132,7 @@ export function TankDisplay({ duel }: TankDisplayProps) {
|
||||
>
|
||||
<TankModel duel={duel} />
|
||||
<TankArmor duel={duel} />
|
||||
{/* <SpacedArmorDepth duel={duel} /> */}
|
||||
</Suspense>
|
||||
</Canvas>
|
||||
</div>
|
||||
|
||||
@@ -16,9 +16,6 @@ interface OptionsProps {
|
||||
|
||||
export function Options({ isFullScreen, canvas }: OptionsProps) {
|
||||
const showGrid = useTankopedia((state) => state.model.visual.showGrid);
|
||||
const showSpacedArmor = useTankopedia(
|
||||
(state) => state.model.visual.showSpacedArmor,
|
||||
);
|
||||
|
||||
return (
|
||||
<Flex
|
||||
@@ -47,17 +44,6 @@ export function Options({ isFullScreen, canvas }: OptionsProps) {
|
||||
>
|
||||
Show grid
|
||||
</DropdownMenu.CheckboxItem>
|
||||
|
||||
<DropdownMenu.CheckboxItem
|
||||
checked={showSpacedArmor}
|
||||
onCheckedChange={(checked) => {
|
||||
mutateTankopedia((draft) => {
|
||||
draft.model.visual.showSpacedArmor = checked;
|
||||
});
|
||||
}}
|
||||
>
|
||||
Spaced armor
|
||||
</DropdownMenu.CheckboxItem>
|
||||
</DropdownMenu.Content>
|
||||
</DropdownMenu.Root>
|
||||
|
||||
|
||||
+3
-24
@@ -27,9 +27,6 @@ interface ArmorHighlightingProps {
|
||||
export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
const wrapper = useRef<Group>(null);
|
||||
const awaitedModelDefinitions = useModelDefinitions();
|
||||
const showSpacedArmor = useTankopedia(
|
||||
(state) => state.model.visual.showSpacedArmor,
|
||||
);
|
||||
const turretContainer = useRef<Group>(null);
|
||||
const gunContainer = useRef<Group>(null);
|
||||
const initialTankopediaState = useTankopedia.getState();
|
||||
@@ -165,12 +162,7 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined || spaced) return null;
|
||||
|
||||
return (
|
||||
<ArmorMesh
|
||||
@@ -179,7 +171,6 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
duel={duel}
|
||||
key={node.uuid}
|
||||
geometry={(node as Mesh).geometry}
|
||||
isSpaced={spaced ?? false}
|
||||
thickness={thickness}
|
||||
/>
|
||||
);
|
||||
@@ -197,12 +188,7 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined || spaced) return null;
|
||||
|
||||
return (
|
||||
<ArmorMesh
|
||||
@@ -212,7 +198,6 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
key={node.uuid}
|
||||
geometry={(node as Mesh).geometry}
|
||||
position={turretOrigin}
|
||||
isSpaced={spaced ?? false}
|
||||
thickness={thickness}
|
||||
/>
|
||||
);
|
||||
@@ -229,12 +214,7 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined || spaced) return null;
|
||||
|
||||
return (
|
||||
<ArmorMesh
|
||||
@@ -244,7 +224,6 @@ export function ArmorHighlighting({ duel }: ArmorHighlightingProps) {
|
||||
key={node.uuid}
|
||||
geometry={(node as Mesh).geometry}
|
||||
position={turretOrigin.clone().add(gunOrigin)}
|
||||
isSpaced={spaced ?? false}
|
||||
thickness={thickness}
|
||||
/>
|
||||
);
|
||||
|
||||
+5
-23
@@ -34,9 +34,6 @@ interface ExternalModuleMaskProps {
|
||||
export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
const wrapper = useRef<Group>(null);
|
||||
const awaitedModelDefinitions = useModelDefinitions();
|
||||
const showSpacedArmor = useTankopedia(
|
||||
(state) => state.model.visual.showSpacedArmor,
|
||||
);
|
||||
const turretContainer = useRef<Group>(null);
|
||||
const gunContainer = useRef<Group>(null);
|
||||
const initialTankopediaState = useTankopedia.getState();
|
||||
@@ -164,12 +161,7 @@ export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshExternalModuleMask
|
||||
@@ -185,7 +177,7 @@ export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
const isTrack = node.name.startsWith('chassis_track_');
|
||||
const isVisible = isWheel || isTrack;
|
||||
|
||||
if (!isVisible || !showSpacedArmor) return null;
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshExternalModuleMask
|
||||
@@ -209,12 +201,7 @@ export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshExternalModuleMask
|
||||
@@ -237,12 +224,7 @@ export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshExternalModuleMask
|
||||
@@ -260,7 +242,7 @@ export const ExternalModuleMask = memo<ExternalModuleMaskProps>(({ duel }) => {
|
||||
`gun_${gunModelDefinition.model.toString().padStart(2, '0')}`;
|
||||
const isVisible = isCurrentGun;
|
||||
|
||||
if (!isVisible || !showSpacedArmor) return null;
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshExternalModuleMask
|
||||
|
||||
+5
-23
@@ -38,9 +38,6 @@ interface SpacedArmorDepthProps {
|
||||
export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
const wrapper = useRef<Group>(null);
|
||||
const awaitedModelDefinitions = useModelDefinitions();
|
||||
const showSpacedArmor = useTankopedia(
|
||||
(state) => state.model.visual.showSpacedArmor,
|
||||
);
|
||||
const turretContainer = useRef<Group>(null);
|
||||
const gunContainer = useRef<Group>(null);
|
||||
const initialTankopediaState = useTankopedia.getState();
|
||||
@@ -177,12 +174,7 @@ export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshSpacedArmorDepth
|
||||
@@ -200,7 +192,7 @@ export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
const isTrack = node.name.startsWith('chassis_track_');
|
||||
const isVisible = isWheel || isTrack;
|
||||
|
||||
if (!isVisible || !showSpacedArmor) return null;
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshSpacedArmorDepth
|
||||
@@ -222,12 +214,7 @@ export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshSpacedArmorDepth
|
||||
@@ -252,12 +239,7 @@ export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
armorId,
|
||||
);
|
||||
|
||||
if (
|
||||
!isVisible ||
|
||||
thickness === undefined ||
|
||||
(spaced && !showSpacedArmor)
|
||||
)
|
||||
return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshSpacedArmorDepth
|
||||
@@ -277,7 +259,7 @@ export const SpacedArmorDepth = memo<SpacedArmorDepthProps>(({ duel }) => {
|
||||
`gun_${gunModelDefinition.model.toString().padStart(2, '0')}`;
|
||||
const isVisible = isCurrentGun;
|
||||
|
||||
if (!isVisible || !showSpacedArmor) return null;
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<ArmorMeshSpacedArmorDepth
|
||||
|
||||
Reference in new issue
Block a user