feat: zooming in

This commit is contained in:
tresabhi committed 2024-12-12 16:03:34 -06:00
1 parent 0c54905384
commit 143c84f52f
4 files changed
+136 -39

No files matched your search

@@ -78,8 +78,26 @@ export enum TankopediaRelativeAgainst {
All,
}
export enum ShootingRangeZoom {
Arcade,
Zoom0,
Zoom1,
Zoom2,
}
export const SHOOTING_RANGE_ZOOM_COEFFICIENTS: Record<
ShootingRangeZoom,
number
> = {
[ShootingRangeZoom.Arcade]: 1,
[ShootingRangeZoom.Zoom0]: 1 / 8,
[ShootingRangeZoom.Zoom1]: 1 / 16,
[ShootingRangeZoom.Zoom2]: 1 / 25,
};
interface TankopediaEphemeral {
shot?: Shot;
shootingRangeZoom: ShootingRangeZoom;
skills: Record<string, number>;
relativeAgainst: TankopediaRelativeAgainst;
controlsEnabled: boolean;
@@ -110,6 +128,7 @@ export const TankopediaEphemeral = createContextualStore(
(model: ModelDefinition) => {
return create<TankopediaEphemeral>()(
subscribeWithSelector<TankopediaEphemeral>(() => ({
shootingRangeZoom: ShootingRangeZoom.Arcade,
relativeAgainst: TankopediaRelativeAgainst.Class,
editStatic: false,
skills: createDefaultSkills(skillDefinitions),