Since this seems to be the place about putting up (new) ideas for the craftEquipment screen I'd figured why not show the system I currently use.
It has evolved over time but is currently in a state for which i believe could benefit others as well.
The basic premise for this design was to allow for GUI adaptions but not for any changes to the underlying logic related to item allocation to soldiers.
New query methods were allowed if needed for numbers (but thanks to then new apoc-style equipment those are no longer necessary).
The main goal was to make item allocation a bit easier.
The true power lies in those situation where a mod provides a huge number of battleItems but stock is (always) limited.
See attached image-collage to get an ideas of how those changes look and the sections below for a description.
If interested in (part of) those ideas I can put up a demo branch rebased upon latest oxce-plus (9a90fab43).
The code gates most changes behind an user option but there are some refactors.
Reason for the gating is to let impacted code stand out while minimizing changes to existing logic and UI.
Major visual changes (A-C).
===========================
(A)
Changes the info line **if** the craft has a limit on item amount and/or size.
All fields (except for "Soldiers>##") are running numbers responding to list changes.
Intention behind this change:
Make player aware of the limitations before any error pops up.
(B)
Introduces buttons that operate on the list as visible (e.g. after filter has been applied).
They accept the same input as existing list button (e.g. respond to LMB, mouse-wheel and RMB).
There are two important things to note about the usage of those buttons though:
1) Those buttons use a 2-step approach when changing numbers.
- The first click tries to balance claimed items in the direction chosen
+ Pressing ">" only operates on items that have less assigned to craft than claimed by soldiers.
+ Pressing "<" only operates on items that have more assigned to craft than claimed by soldiers.
- Only when the list is fully balanced the buttons will operate on the full list again.
2) When using these buttons any error message related to craft limits is suppressed.
- Allows to (temporarily) assign all items to craft in order to assist equipping via inventory button.
- Even though errors are suppressed they are still enforced, see [F] how that is handled.
Intention behind this change:
Make item allocation easier but have some safeguard against accidental removal of claimed items (without enforcing a minimum).
(and visual AMSR while holding down LMB. But that is pure coincidence ... or is it?
(C)
Adds an extra column to show if (and how much) of a soldier claim exist on a item.
This new column uses a (translatable) indicator to convey the status, more_than/exactly/not enough, followed by the claimed amount.
The extra column approach was chosen because I did not want to change the meaning of the "on-craft" column.
Intention behind this change:
Inform player there are claims on certain items.
Side-note:
Image as shown still has an old alignment for the 'on-craft' and 'claimed' columns
Since the creation of the image those are shifted to the right (closer to original location of on-craft).
There still is an offset to the left of ~1 character (6px) though, to account for "more than reasonable" numbers.
Other changes (D-F).
====================
(D) Combobox.
-------------
This button now responds to RMB-clicks, when that happens the behavior changes into:
+ Show the inverse of the selected category (anything not belonging to ...).
+ Change combobox text to reflect this inverted list display.
The second change is that the default filter categories learned a new one.
- A filter to only show items claimed by soldiers.
(E) Visit inventory button.
---------------------------
This button changes appearance if it is detected that some claimed item is missing on the craft.
If that is the case any inventory visit would mean that some soldiers lose said item(s).
When the button is in this warning state an LMB click will show a warning.
This warning tells why it is not a good idea to visit inventory at this moment (and how to forcefully visit anyway).
A visit to inventory can always be enforced using 'CTRL+click' or 'RMB'.
(F) Return to base (ok) button
------------------------------
This button changes appearance if it is detected that some craft item limit has been exceeded.
A click on this button will replay any stored warning messages and it is not allowed to exit this screen.
To prevent players getting stuck on this screen a shortcut has been provided (CTRL+ALT+click) for forced exit.
This forced exit will restore craft inventory to the state from before entering this screen (to prevent erroneous craft state).
Relation with 'oxceAlternateCraftEquipmentManagement`
=====================================================
The original intent of this redesign was to provide extra info (and QoL operations) using existing data.
Since apoc-style predates this suggestion care has been taken as to not interfere with it's logic (only it's visuals).
This means that any protection provided by apoc-style is not overridden by this redesign (e.g. very unlikely to see "< ##").
It also means some gratitude is in order. This functionality allowed me to reuse some logic and thus made life easier.