Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mech/vehicle/omnivehicle turret fixes & improvements #316

Merged
merged 17 commits into from
Dec 14, 2023

Conversation

lbmaian
Copy link
Contributor

@lbmaian lbmaian commented Dec 7, 2023

Mech turrets:

  • Fix quad mechs to allow both torso and head turrets (they're considered different types of mech turrets).
  • Revamp mech turret code to fix edge cases and allow equipment.
  • Align mech turret/rear-mounting code, both in lib and GUI logic.
  • Drag&drop weapon/equipment retains mech turreted status.
  • Displaced weapon/equipment (when dragging another equipment onto it, requiring reallocation) also retains mech turreted status.
  • Disallow mounting ammo in mech turret. (Technically, I think ammo can be allocated to the turret but shouldn't count for turret tonnage, which functionally should be the same as disallowing turreted ammo.)

Vehicle turrets:

  • Add rear turret tonnage to info bar. To help make it fit in the info bar, turret tonnages are hidden if corresponding turret doesn't exist, and reduce width of some boxes there.
  • Fix error if removing CV turret and adding item without selecting location.
  • Fix regression from b46d085 that inadvertently unset rear turret armor.
  • Fix changing from dual turrets to single turret not removing rear turret location.
  • Fix regression from 2415ab5 and related omnivehicle code that broke turrets on non-omnivehicles on wide CV GUI. Specifically, omnivehicle code didn't properly unset turret max tonnage when disabled, and the wide CV GUI specifically resets them to 0 even for non-omnivehicles.

Omnivehicle turrets:

  • Add rear turret tonnage limit to non-wide GUI.
  • Add turret tonnage limits to info bar, color-coded in same way as total tonnage.
  • Turret tonnage from items now checked against max turret tonnage as part of pre-save/export validation. Also improve this validation error behavior a bit.
  • Avoid unsetting turret tonnage for locked chassis (omni variants).
  • Fix some weird edge cases by ensuring turret tonnage is kept in sync b/w UI and model.
  • Fix omnivehicle rear turret tonnage limit not being saved/loaded.
  • Unlocking omni chassis no longer unchecks omni checkbox and zeros out turret tonnages.
  • Fix right sponson turret not being propagated to omni variants.

Misc omni stuff:

  • Fix wide CV UI not resetting omni variant combobox when loading new vehicle.
  • Fix lock chassis button getting out of sync with omni checkbox (applies for both omnimechs and omnivees).
  • Remove omnivehicle max tonnage code from sponson turrets since they're unrelated to omnivehicles, and some other internal changes.

…s on non-omnivehicles on wide CV GUI

Specifically, omnivehicle code didn't properly unset turret max tonnage when disabled,
and the wide CV GUI specifically resets them to 0 even for non-omnivehicles.

Also remove max tonnage stuff from sponson turrets since they're unrelated to omnivehicles.
Note: non-wide CV omnivehicle code remains incomplete.
Comment out non-functioning crit loc snapshot code
@WEKarnesky
Copy link
Member

Thank you for your submission.
My apologies for the delay, I will be reviewing it later tonight or tomorrow.

@lbmaian
Copy link
Contributor Author

lbmaian commented Dec 9, 2023

Gonna include a couple more turret-related fixes, hold on a bit.

This occurred during the `cmbTurret.setSelectedItem("Single Turret")` call
after the `Load = false`, resulting in a call to `RecalcArmorLocations`.
The fix is to remove these lines since they were redundant with the later
call to `BuildTurretSelector` which properly sets `cmbTurret`.
Omnivehicle turrets:
- Turret tonnage from items now checked against max turret tonnage
- Avoid unsetting turret tonnage for locked chassis (omni variants)
- Ensure turret tonnage is kept in sync b/w UI and model
- Copy rest of related code from wide UI to non-wide UI, including rear turret tonnage support

Also:
- Fix wide UI not resetting omni variant combobox when loading new vehicle
- Fix changing from dual turrets to single turret not removing rear turret location
Also fix base loadout not referring to itself and rename SetTurretx to SetTurretxItems for clarity
Also add rear turret armor and tonnage limit to HTML export
…onnages

Also fix lock chassis button getting out of sync with omni checkbox
… bar

To help make it fit in the info bar, turret tonnages are hidden if
corresponding turret doesn't exist, and reduce width of some boxes there
Also improve validation error behavior a bit
@lbmaian lbmaian changed the title Mech and CV turret fixes Mech/vehicle/omnivehicle turret fixes & improvements Dec 11, 2023
@lbmaian
Copy link
Contributor Author

lbmaian commented Dec 11, 2023

Bundled omnivehicle turret fixes. Ok should be good to go.

@WEKarnesky
Copy link
Member

Sorry I meant to review yesterday, but will do so later today.

@WEKarnesky WEKarnesky merged commit 427ca7c into Solaris-Skunk-Werks:develop Dec 14, 2023
1 check passed
@lbmaian lbmaian deleted the turret branch December 14, 2023 16:02
@lbmaian
Copy link
Contributor Author

lbmaian commented Dec 14, 2023

Thanks for merging. I'll have another PR upcoming with more fixes (unrelated to turrets!) in a day or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants