Done.
Test build was here:
EDIT: use official build OXCE v7.8 or higher
Please test and provide feedback.
Features implemented:
- everything enabled/disabled by a user option (in Advanced tab) called "Alternate craft equipment management"
- the Soldiers screen now has an "Inventory" button (inside the actions combobox)... until now there was only a hotkey 'I' to open the inventory
- when moving (assigning/deassigning/reassigning) soldiers from and to a craft, they take their inventory (or as much as possible of it) with them
- the Craft Equipment screen shows more detailed info about how many items are in soldiers' inventory (i.e. reserved) and how many are extra and/or missing
- the Craft Equipment screen shows also items that are not in the base, not on the craft, but only reserved by the soldiers' inventory templates
- the Craft Equipment screen automatically adds more items from the base onto the craft (when the screen is opened), if there were some items missing and are now available (e.g. purchase/transfers have arrived recently)
- when removing items from the Craft Equipment screen, you can only remove the extra items... items reserved for soldiers can only be removed by removing the soldiers
* EDIT: this doesn't apply when loading a global craft equipment layout (F9)
- the soldiers' inventory templates are only saved/updated in the following situations:
1. in the base, via Soldiers > Inventory (or I hotkey)
2. in the base, via Craft Equipment > Inventory
They are NOT saved/updated anymore in these situations:
3. after the Briefing (before the first mission stage)
4. in-between mission stages (for multi-stage missions)
Display of the items in craft equipment screen:
1. HWPs - no change
2. exact amount of items necessary - no change
3. more items than necessary - displayed as X/+Y (where X is the number of necessary/reserved items and Y is the number of extra items; X plus Y is the number of items on the craft)
4. less items than necessary - displayed as X/-Y (where X is the number of items on the craft and Y is the number of items missing)
Items are explicitly moved together with soldiers in the following cases:
a/ when assigning/deassigning/reassigning soldiers on the Craft Soldiers screen
b/ when assigning/deassigning/reassigning soldiers on the Craft Armor screen - using CTRL+click
c/ when a soldier is removed from a craft automatically due to soldier being wounded during a mission
d/ when a soldier is removed from a craft automatically due to soldier transformation starting
Items are also moved together with soldiers in the following cases (not explicitly, but as a side effect of other standard xcom behavior):
e/ when completely unloading a craft due to selling a craft in the Sell screen
f/ when completely unloading a craft due to "consuming" a craft during the Manufacturing (e.g. craft upgrade)
g/ when a non-empty hangar is destroyed => (only the first) craft in the hangar is destroyed, but the crew and the items are saved
Items are not moved (intentionally) in the following cases:
h/ when evacuating the crew / ejecting the pilots - the soldiers are allowed to survive (depending on the modder's taste), but the items on the craft will be destroyed
i/ when an empty hangar is destroyed => (all) crafts being transferred into this empty hangar are destroyed including the items; TODO: the crew is saved, but probably in a buggy state... to be tested
Items are also not moved (because it is not required/desired/supported) in the following cases:
j/ when starting a new game (the soldiers don't have any inventory template yet, so there's nothing to move!)
k/ when loading a saved game and soldier-to-craft links are built (this is just a technicality)
l/ when importing saves from the original UFO/TFTD (this is just a technicality)
m/ in the "New Battle" mode
n/ in the "Craft Preview" and "Base Preview" modes
Disclaimer: when automatically moving items:
- there is no check for items not allowed on crafts (e.g. corpses, geoscape items, items without a bigsprite, fixed items, alien artifacts, explicitly disabled items, items that don't exist in the mod anymore, etc.) -- most of these should hopefully never be saved in a soldier's template, but if they somehow manage to get there, they will be used as is
- there is no check for craft item number limit
- there is no check for craft item weight limit
Don't ask for this, it will not be done. I'm not willing to spend the next 5+ years fixing it!
(The checks will still work for any extra items you'd want to add manually.)
Last thing: this is a PLAYER option, it cannot be fixed by a modder. It can be recommended though.