diff --git a/packages/i18n/strings/en.json b/packages/i18n/strings/en.json index 327c5d704..a7284fa0b 100644 --- a/packages/i18n/strings/en.json +++ b/packages/i18n/strings/en.json @@ -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", diff --git a/packages/website/src/components/TankopediaCharacteristics/index.tsx b/packages/website/src/components/TankopediaCharacteristics/index.tsx index f79154dfa..62f5f128f 100644 --- a/packages/website/src/components/TankopediaCharacteristics/index.tsx +++ b/packages/website/src/components/TankopediaCharacteristics/index.tsx @@ -88,7 +88,7 @@ function Group({ group, characteristics }: GroupProps) { {group.order.map((item) => ( <> {"toy" in item && } - {"name" in item && characteristics.get(item.name) && ( + {"name" in item && characteristics.has(item.name) && ( )} diff --git a/packages/website/src/config/characteristics.ts b/packages/website/src/config/characteristics.ts index 5ae672351..a9b4e069c 100644 --- a/packages/website/src/config/characteristics.ts +++ b/packages/website/src/config/characteristics.ts @@ -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 }) { diff --git a/packages/website/src/config/characteristicsGroups.ts b/packages/website/src/config/characteristicsGroups.ts index aa52f49f0..fdd8ab7c9 100644 --- a/packages/website/src/config/characteristicsGroups.ts +++ b/packages/website/src/config/characteristicsGroups.ts @@ -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" },