fix: remove show environment

This commit is contained in:
tresabhi committed 2024-12-19 11:32:53 -06:00
1 parent f726793819
commit a38b5d7ddd
4 files changed
+3 -45

No files matched your search

@@ -39,9 +39,9 @@ import { readStringDVPL } from '../core/blitz/readStringDVPL';
import { readXMLDVPL } from '../core/blitz/readXMLDVPL'; import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL'; import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
import { commitAssets } from '../core/github/commitAssets'; import { commitAssets } from '../core/github/commitAssets';
import { TankParameters } from './blitzkitTankIcons';
import { DATA } from './constants'; import { DATA } from './constants';
import { Avatar } from './skillIcons'; import { Avatar } from './skillIcons';
import { TankParameters } from './tankIcons';
function parseResearchCost(raw: number | string) { function parseResearchCost(raw: number | string) {
if (typeof raw === 'number') { if (typeof raw === 'number') {
@@ -7,9 +7,9 @@ import { readXMLDVPL } from '../core/blitz/readXMLDVPL';
import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL'; import { readYAMLDVPL } from '../core/blitz/readYAMLDVPL';
import { commitAssets } from '../core/github/commitAssets'; import { commitAssets } from '../core/github/commitAssets';
import { FileChange } from '../core/github/commitMultipleFiles'; import { FileChange } from '../core/github/commitMultipleFiles';
import { TankParameters } from './blitzkitTankIcons';
import { DATA } from './constants'; import { DATA } from './constants';
import { VehicleDefinitionList } from './definitions'; import { VehicleDefinitionList } from './definitions';
import { TankParameters } from './tankIcons';
export async function tankModels() { export async function tankModels() {
console.log('Building tank models...'); console.log('Building tank models...');
@@ -29,7 +29,6 @@ import {
Tooltip, Tooltip,
} from '@radix-ui/themes'; } from '@radix-ui/themes';
import { Suspense, useState, type RefObject } from 'react'; import { Suspense, useState, type RefObject } from 'react';
import { ENVIRONMENTS } from '../../../../../constants/lightingEnvironments';
import { Pose, poseEvent } from '../../../../../core/blitzkit/pose'; import { Pose, poseEvent } from '../../../../../core/blitzkit/pose';
import { useEquipment } from '../../../../../hooks/useEquipment'; import { useEquipment } from '../../../../../hooks/useEquipment';
import { useFullScreen } from '../../../../../hooks/useFullScreen'; import { useFullScreen } from '../../../../../hooks/useFullScreen';
@@ -63,9 +62,6 @@ export function Options({ thicknessRange, canvas }: OptionsProps) {
const display = TankopediaEphemeral.use((state) => state.display); const display = TankopediaEphemeral.use((state) => state.display);
const isFullScreen = useFullScreen(); const isFullScreen = useFullScreen();
const showGrid = TankopediaPersistent.use((state) => state.showGrid); const showGrid = TankopediaPersistent.use((state) => state.showGrid);
const showEnvironment = TankopediaPersistent.use(
(state) => state.showEnvironment,
);
const greenPenetration = TankopediaPersistent.use( const greenPenetration = TankopediaPersistent.use(
(state) => state.greenPenetration, (state) => state.greenPenetration,
); );
@@ -75,7 +71,6 @@ export function Options({ thicknessRange, canvas }: OptionsProps) {
const wireframe = TankopediaPersistent.use((state) => state.wireframe); const wireframe = TankopediaPersistent.use((state) => state.wireframe);
const opaque = TankopediaPersistent.use((state) => state.opaque); const opaque = TankopediaPersistent.use((state) => state.opaque);
const fullScreenAvailable = useFullscreenAvailability(); const fullScreenAvailable = useFullscreenAvailability();
const environment = TankopediaPersistent.use((state) => state.environment);
const developerMode = App.use((state) => state.developerMode); const developerMode = App.use((state) => state.developerMode);
const protagonistTank = Duel.use((state) => state.protagonist.tank); const protagonistTank = Duel.use((state) => state.protagonist.tank);
const antagonistGun = Duel.use((state) => state.antagonist.gun); const antagonistGun = Duel.use((state) => state.antagonist.gun);
@@ -517,39 +512,6 @@ export function Options({ thicknessRange, canvas }: OptionsProps) {
> >
Show grid Show grid
</DropdownMenu.CheckboxItem> </DropdownMenu.CheckboxItem>
<DropdownMenu.CheckboxItem
checked={showEnvironment}
onCheckedChange={(checked) => {
mutateTankopediaPersistent((draft) => {
draft.showEnvironment = checked;
});
}}
>
View environment
</DropdownMenu.CheckboxItem>
<DropdownMenu.Sub>
<DropdownMenu.SubTrigger>Lighting</DropdownMenu.SubTrigger>
<DropdownMenu.SubContent>
<DropdownMenu.RadioGroup value={environment}>
{ENVIRONMENTS.map((environment) => (
<DropdownMenu.RadioItem
key={environment}
value={environment}
onClick={() => {
mutateTankopediaPersistent((draft) => {
draft.environment = environment;
});
}}
>
{environment[0].toUpperCase() + environment.slice(1)}
</DropdownMenu.RadioItem>
))}
</DropdownMenu.RadioGroup>
</DropdownMenu.SubContent>
</DropdownMenu.Sub>
</DropdownMenu.Content> </DropdownMenu.Content>
</DropdownMenu.Root> </DropdownMenu.Root>
@@ -21,7 +21,6 @@ import { modelTransformEvent } from '../../../../../../../core/blitzkit/modelTra
import { tankCharacteristics } from '../../../../../../../core/blitzkit/tankCharacteristics'; import { tankCharacteristics } from '../../../../../../../core/blitzkit/tankCharacteristics';
import { Duel } from '../../../../../../../stores/duel'; import { Duel } from '../../../../../../../stores/duel';
import { TankopediaEphemeral } from '../../../../../../../stores/tankopediaEphemeral'; import { TankopediaEphemeral } from '../../../../../../../stores/tankopediaEphemeral';
import { TankopediaPersistent } from '../../../../../../../stores/tankopediaPersistent';
import { TankopediaDisplay } from '../../../../../../../stores/tankopediaPersistent/constants'; import { TankopediaDisplay } from '../../../../../../../stores/tankopediaPersistent/constants';
import { TargetCircle } from './components/TargetCircle'; import { TargetCircle } from './components/TargetCircle';
import { aimTarget } from './constants'; import { aimTarget } from './constants';
@@ -36,9 +35,6 @@ const [modelDefinitions, equipmentDefinitions, provisionDefinitions] =
const emptyVector = new Vector2(); const emptyVector = new Vector2();
export function SceneProps() { export function SceneProps() {
const show = TankopediaPersistent.use(
(state) => state.showGrid && !state.showEnvironment,
);
const targetCircleWrapper = useRef<Group>(null); const targetCircleWrapper = useRef<Group>(null);
const clientTargetCircle = useRef<HTMLDivElement>(null); const clientTargetCircle = useRef<HTMLDivElement>(null);
const serverTargetCircle = useRef<HTMLDivElement>(null); const serverTargetCircle = useRef<HTMLDivElement>(null);
@@ -239,7 +235,7 @@ export function SceneProps() {
return ( return (
<> <>
{show && display !== TankopediaDisplay.ShootingRange && ( {display !== TankopediaDisplay.ShootingRange && (
<mesh rotation={[-Math.PI / 2, 0, 0]}> <mesh rotation={[-Math.PI / 2, 0, 0]}>
<planeGeometry args={[10, 10]} /> <planeGeometry args={[10, 10]} />
<meshStandardMaterial ref={material} map={texture} transparent /> <meshStandardMaterial ref={material} map={texture} transparent />