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

Adds extra QoL features to maintain weapon menu + fixes 2 bugs there. #409

Conversation

Bence7661
Copy link

@Bence7661 Bence7661 commented Jan 21, 2025

Tested for v0.9.3.1

This PR directly overwrites zzzz_arti_jamming_repairs.script since monkey patching seemed to hurt readibility/maintability.
+ I saw this approach made by others. I have no intention to rip off anyones work.
I can also make a monkey patch version if that's preferred.

I think this would make a nice QoL addon in one of the upcoming versions of G.A.M.M.A

The only file not created from scratch was zzzz_arti_jamming_repairs.script
+ the serious_utils_ui_modified.script this is a modified version used (probably not needed honestly because I could've just initialized utils_ui.UICellProperties, right?)

My starting point was to copy Momopate's Barrel Condition Effects Display and start editing that (since that is the last mod that directly overwrites the zzzz_arti_jamming_repairs.script)
True diffs between the file I copied and the changes I made in zzzz_arti_jamming_repairs.script
I used WinMerge to check the actual diffs.
Line 17
Line 652
Line 667 - 668
Line 683
function maintain_all_parts didn't exist before
function init_maintenance_menu basically completely reworked
function part_name_to_human_form didn't exist before
function remove_name Modified

In order for this mod to work SaloEater's Replace Shows Parts Health needs to be turned off.
Otherwise the game crashes as soon as maintain parts are opened (this is because the monkey patch I guess overrides priority)
In the PR I didn't delete the mod since IMO his name is rightfully there in the modlist as a contributor.

The following was grabbed straight from the addon's GitHub page. An even more detailed description can be found there, but for the context of the PR I think this is enough.

Detailed description

Fixes

  • Fixed: "Maintain parts" option appearing when there are no parts to clean or repair, preventing an empty menu box.
  • Fixed: "Maintain parts" menu incorrectly stating that you can clean a part when no cleaning kits are available.
    • Previously, selecting this option would consume a repair kit charge for "cleaning."
    • Now, the menu correctly indicates whether a cleaning kit or repair kit charge will be used.

New Features

  • Added: A percentile display next to parts in the "Maintain Parts" menu (similar to the "Field Strip" menu).
    (This is already present in G.A.M.M.A v0.9.3.1 courtesy of - SaloEater)
  • Added: Three new options to the "Maintain Parts" menu
    • Clean All: Cleans all parts or as many as possible based on available cleaning kit charges, starting from the worst-conditioned part to the best.
    • Repair All: Repairs all parts in the same manner, using available repair kits.
    • Maintain All: Performs a three-step process:
      • Cleans all possible parts.
      • Repairs all possible parts.
      • Repair uncleaned: If some parts were left uncleaned due to a lack of cleaning kit charges, repair kits will be used to complete the cleaning process.
        This process also follows a worst-to-best condition priority.

All of the above will go from lowest charge kit in stack -> highest charge.

Also it will go from lowest condition part -> highest condition part.

Configurability

  • Clean all minimum condition (default: 80%): Determines the minimum part condition threshold (%) for batch cleaning weapon parts.
    So if this option is set to 80% "Clean all" will only clean parts that are equal to or lower than this threshold.

  • Replace all minimum condition (default: 59%): Determines the minimum part condition threshold (%) for batch replacing weapon parts.
    So if this option is set to 80% "Repair all" will only clean parts that are equal to or lower than this threshold.

  • Disable the "maintain all" option (default: OFF): If you never want to use "maintain all" or if you're an avid misclicker then this one is for you! Removes the "maintain all" option from the "maintain parts" context menu.

  • Allow "maintain all" to use repair kits for cleaning (default: OFF): Maintain all consists of 3 steps: Clean all, Repair all and Repair uncleaned (When clean kits run out, but there are still parts left to clean)
    Allows the "Repair uncleaned" step to consume charges of the repair kit to "replace parts".
    The part condition would still have to be below or equal to the "Clean all minimum condition" option.

  • Part replacing should prioritize barrel (default: ON): The barrel will always be the first part to be replaced when batch replacing (if it is below or equal to the condition threshold configured).
    "Maintain all" will take this into consideration too!

  • De-clutter menu (default: OFF): Removes the "<= x %" part from the "clean all" and "replace all" menu options.

Grokitach and others added 7 commits January 20, 2025 17:19

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Backend fix

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Pre-0.9.3.1 Saves Fix addon added

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
hotfix for mags installation

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Crash fixes
@Bence7661
Copy link
Author

I can also create a list of test cases to help in testing (if the PR is ever considered for merge)

Bence7661 and others added 2 commits January 22, 2025 19:05

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…n-fixes
@Bence7661 Bence7661 closed this Feb 13, 2025
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.

None yet

2 participants