feat: start of custom renders

This commit is contained in:
tresabhi committed 2024-12-14 22:32:28 -06:00
1 parent b38c732983
commit bc9c9ad4e7
4 files changed
+86 -6

No files matched your search

@@ -35,7 +35,11 @@ const ARCADE_MODE_DISTANCE = 19;
const ARCADE_MODE_ANGLE = degToRad(10);
const ARCADE_MODE_FOV = 54;
export function Controls() {
interface ControlsProps {
naked?: boolean;
}
export function Controls({ naked }: ControlsProps) {
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
const display = TankopediaEphemeral.use((state) => state.display);
const duelStore = Duel.useStore();
@@ -82,7 +86,7 @@ export function Controls() {
antagonistModelDefinition.turret_origin.y +
antagonistTurretModelDefinition.gun_origin.y;
const [autoRotate, setAutoRotate] = useState(
display !== TankopediaDisplay.ShootingRange,
display !== TankopediaDisplay.ShootingRange && !naked,
);
const gunHeight =
protagonistHullOrigin.y +
@@ -31,10 +31,11 @@ import { TankModel } from './components/TankModel';
interface TankSandboxProps {
thicknessRange: ThicknessRange;
naked?: boolean;
}
export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
({ thicknessRange }, ref) => {
({ thicknessRange, naked }, ref) => {
const mutateTankopediaEphemeral = TankopediaEphemeral.useMutation();
const canvas = useRef<HTMLCanvasElement>(null);
const hasImprovedVerticalStabilizer = useEquipment(122);
@@ -179,10 +180,15 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
draft.highlightArmor = undefined;
});
}}
style={{ userSelect: 'none' }}
style={{
userSelect: 'none',
width: naked ? 640 : '100%',
height: naked ? 480 : '100%',
outline: naked ? '1rem red solid' : undefined,
}}
>
<Controls />
<SceneProps />
<Controls naked={naked} />
{!naked && <SceneProps />}
{display !== TankopediaDisplay.StaticArmor && <TankModel />}
<ShotDisplay />
<ArmorPlateDisplay />