WIP - Arsenal - Refactor/Cleanup/Fixes/Additions
My aim was to cleanup the old code and fix a couple of things:
When merged this pull request will:
-
Everything has been made to work with config case sensitive names.
-
Added the ability to add/remove primary and secondary muzzle magazines to weapons where it wasn't previously possible:
- Handguns: Added secondary muzzle magazines
- Launchers: Added secondary muzzle magazines
- Binoculars: Added primary and secondary muzzle magazines
I added this for weapons like RHS' SMAW, which has two muzzles (primary and a spotting rifle) and laser designators, where you can ensure that a magazine has been loaded.
-
Added:
ace_arsenal_uniqueBasecan be applied to items from "CfgWeapons", "CfgMagazines" and "CfgVehicles". I'm unsure about that change, but I felt it matched the documentation on it better. Maybe the documentation should be expanded/changed instead. -
Added: More caches to hopefully reduce some loading times.
-
Added: When searching, it will keep the currently selected item highlighted, unless it doesn't match the search results (works for items as well as loadouts).
-
Addresses #9035 (it should in theory at least).
-
Addresses #8844.
-
Fixed: Linked items being removed when switching to a new weapon ( #8786 removed that accidentally). Now it removes the linked items only if they aren't available to the arsenal.
-
Fixed: Faces not being JIP compatible. Previously it would constantly overwrite the same JIP ID.
-
Fixed: Weapons with attachments that were in containers losing their attachments when changing containers of the same type.
-
Changed: (Tied to above) When switching containers of the same type, it will no longer replenish magazines.
-
Changed: If there are only items with no mass (e.g. ACE fortity tool), the "remove all items" button shows.
-
Changed: Loadouts can be renamed case-insensitively ("Temp" -> "TemP", previously not possible).
-
Probably more, which I have forgotten at this point, as I have been working on this for several months.
This is still WIP and I have numerous questions for the ACE team as to what I should do in some cases. I'll open reviews for the areas in question.
I do have a couple of general questions though:
- Do Macros for the arsenal need to be backwards compatible or can they be altered (or even deleted)?
- What sort of scopes (private, protected or public) should be allowed for weapons in the arsenal?
- Is
GVAR(currentItems)public? Do mods rely on it? - I'm unsure whether the new functions I have added to
commonshould be placed there or in the arsenal. I figured they could be useful in general, so I put them in common.ace_common_fnc_addWeaponcan be removed if https://github.com/CBATeam/CBA_A3/pull/1557 gets merged.
I have tested it some, but mostly SP (with some 3DEN, but only a little). However, whatever is MP related I haven't tested at all.
IMPORTANT
- [x] If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
- [x] Development Guidelines are read, understood and applied.
- [x] Title of this PR uses our standard template
Component - Add|Fix|Improve|Change|Make|Remove {changes}.