Item Context Menu -- Add class-specific actions support #1517
Item Context Menu -- Add class-specific actions support #1517PabstMirror merged 6 commits intoCBATeam:masterfrom
Conversation
Rework Inventory actions to use HashMap to store actions.
|
Don't like the ! syntax. ! means not. |
What about ["$CUP_acc_ANPEQ_15",["VEST_CONTAINER"], ...] call CBA_fnc_addItemContextMenuOption;
Impossible, imho. Some mods have it for years (and used in compats of other mods), it will break backward compatibility. |
|
Just use an explicit argument for the function. |
Added new parameter |
|
addClassEventHandler uses |
Heh, this was my first guess, but I thought that it should be a bit simplier for public function. Will make similar to what is used now.
What will be the profit? Prepended classname way is just similar to handling type options ( |
Both are public functions.
Performance seems non-issue here. #(#) syntax is used for implicit typing. Think of them as virtual parents, used where the shitty trees made by BI fail us. Prepending type names with arcane symbols is questionable. A I would like if the code refected this as well. |
|
Sounds reasonable, thanks for explanation. |
|
Hi, any chance to finish the review? |
When merged this pull request will:
Note:
Framework allows to apply actions(options) to item class, item type or "#All" wildcard. Actions added to class will be inherited by all it's child classes.
Mods often do not have strict inheritance scheme (class_base (scope=0) -> various class_variants (scope=2)), but may inherit from classes with scope=2. If I want to add some specific action for parent item - it now inherited by all it's childs, which is sometimes unwanted.
This PR adds:
Example
Config:
Add action to
CUP_acc_ANPEQ_15only: