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

Arsenal - Reuse current inventory containers when importing invalid loadouts #10364

Merged
merged 15 commits into from
Feb 5, 2025

Conversation

mrschick
Copy link
Contributor

@mrschick mrschick commented Oct 5, 2024

When merged this pull request will:

  • When importing a stored loadout which has a uniform/vest/backpack that is missing or from an unloaded mod, retain the currently equipped container and fill it with available items from the stored loadout.
  • Fix Arsenal Import button ignores limited arsenal #10673, also attempt to recover missing containers in the imported inventory.

The use case for this change is missions in which the arsenal is restricted to clothing from a specific faction, but still contains all the usual medical and other specialized equipment for a given role.
Previously, even if one had saved a very similar loadout, but with a different camo, it was impossible to load it without losing all clothing items. Forcing one to redo the entire loadout from scratch.
With this change, it will be possible to import such a loadout, so that the numerous equipment items will be placed in already worn clothing of the specific faction, saving time.

If "" is given as a container, an error is thrown, therefore, filter out all unavailable/null containers

I realize that this was part of optimization work in #9316. Since it hinders this implementation, I removed that check. I have not found it causing errors when importing loadouts.

@LinkIsGrim
Copy link
Contributor

LinkIsGrim commented Oct 16, 2024

I realize that this was part of optimization work in #9316.

I think loadout validation is spread out over multiple frames now so it doesn't matter as much

Just for confirmation's sake: does this only apply if the class doesn't exist, or also for items that aren't available in the arsenal as well?

Not the problem if the latter, it opens up an interesting possibility (layered loadouts)

@mrschick
Copy link
Contributor Author

does this only apply if the class doesn't exist, or also for items that aren't available in the arsenal as well?

It applies whenever fnc_verifyLoadout.sqf returns an inventory container's config name as "", which happens in both cases.

@LinkIsGrim LinkIsGrim added the kind/change Release Notes: **CHANGED:** label Oct 16, 2024
@mrschick
Copy link
Contributor Author

Could this make 3.19?

Co-authored-by: Jouni Järvinen <[email protected]>
@mrschick mrschick requested a review from LinkIsGrim January 27, 2025 07:47
@LinkIsGrim LinkIsGrim self-requested a review February 2, 2025 17:47
@LinkIsGrim
Copy link
Contributor

I ended up refactoring verifyLoadout again while reviewing this.

I have a minor nitpick with preventOverfilling (could be less code) and I'm not a fan of recoverInvalidContainers atm, but I don't think there's any working around the latter.

I'll leave my drastic changes to another PR, LGTM.

@LinkIsGrim LinkIsGrim requested a review from johnb432 February 3, 2025 22:08
@mrschick
Copy link
Contributor Author

mrschick commented Feb 3, 2025

(could be less code)

Please do tell ✍🏻

@LinkIsGrim
Copy link
Contributor

See below:
image

I'd have pushed to branch but no write perms

@mrschick
Copy link
Contributor Author

mrschick commented Feb 3, 2025

Sadly still an issue with organization forks.
Now please don't make me write it off that picture 😁

Copy link
Contributor

@PabstMirror PabstMirror left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me

@LinkIsGrim LinkIsGrim added this to the 3.19.1 milestone Feb 5, 2025
@LinkIsGrim LinkIsGrim merged commit c82b51f into acemod:master Feb 5, 2025
3 checks passed
@mrschick mrschick deleted the feature/improve-loadout-load branch February 5, 2025 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/change Release Notes: **CHANGED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arsenal Import button ignores limited arsenal
5 participants