frontal and back depression

This commit is contained in:
tresabhi committed 2026-10-11 00:47:00 -05:00
1 parent 95318d0a99
commit 62da186a25
4 files changed
+53 -1

No files matched your search

+4
View File
@@ -58,6 +58,10 @@
"dispersion_angle": "Dispersion angle",
"gun_depression": "Gun depression",
"gun_elevation": "Gun elevation",
"gun_frontal_depression": "Frontal depression",
"gun_frontal_elevation": "Frontal elevation",
"gun_rear_depression": "Rear depression",
"gun_rear_elevation": "Rear elevation",
"azimuth_left": "Azimuth left",
"azimuth_right": "Azimuth right",
"speed_forward": "Speed forward",
@@ -88,7 +88,7 @@ function Group({ group, characteristics }: GroupProps) {
{group.order.map((item) => (
<>
{"toy" in item && <Toy {...item} />}
{"name" in item && characteristics.get(item.name) && (
{"name" in item && characteristics.has(item.name) && (
<Item config={item} value={characteristics.get(item.name)!} />
)}
</>
@@ -523,6 +523,50 @@ export const characteristics = {
},
},
gun_frontal_depression: {
type: CharacteristicType.Number,
should_render({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.front !==
undefined;
},
compute({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.front!.max;
},
},
gun_frontal_elevation: {
type: CharacteristicType.Number,
should_render({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.front !==
undefined;
},
compute({ state, turret, gun }) {
return -state.model.turrets[turret.id].guns[gun.id].pitch!.front!.min;
},
},
gun_rear_depression: {
type: CharacteristicType.Number,
should_render({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.back !==
undefined;
},
compute({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.back!.max;
},
},
gun_rear_elevation: {
type: CharacteristicType.Number,
should_render({ state, turret, gun }) {
return state.model.turrets[turret.id].guns[gun.id].pitch!.back !==
undefined;
},
compute({ state, turret, gun }) {
return -state.model.turrets[turret.id].guns[gun.id].pitch!.back!.min;
},
},
azimuth_left: {
type: CharacteristicType.Number,
should_render({ state, turret }) {
@@ -140,6 +140,10 @@ export const characteristicsGroups: CharacteristicsGroup[] = [
order: [
{ name: "gun_depression", decimals: 0, units: "deg" },
{ name: "gun_elevation", decimals: 0, units: "deg" },
{ name: "gun_frontal_depression", decimals: 1, units: "deg" },
{ name: "gun_frontal_elevation", decimals: 1, units: "deg" },
{ name: "gun_rear_depression", decimals: 1, units: "deg" },
{ name: "gun_rear_elevation", decimals: 1, units: "deg" },
{ name: "azimuth_left", decimals: 0, units: "deg" },
{ name: "azimuth_right", decimals: 0, units: "deg" },