-
Notifications
You must be signed in to change notification settings - Fork 148
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
Item context menu is not updated upon interaction #1432
Comments
What do you mean by "is never updated"? Does the old action appear on the next item on the list or? |
The actions remain the same, regardless what happens with the item. If the item gets replaced or removed completely, the context menu stays open with the same options, which may not be valid anymore. |
This is a user error. The correct way to make a consumable item is to make the statement return [
"acc_pointer_IR", "POINTER", "CONSUME", [], "", {true}, {nil}, true
] call CBA_fnc_addItemContextMenuOption; |
Additionally, the action is already not executed multiple times, so even if this bug is present, no exploit can come from it: [
"30Rnd_65x39_caseless_mag", "CONTAINER", "CONSUME", [], "", {true}, {
systemChat str ["consumed", diag_frameno];
true
}, true] call CBA_fnc_addItemContextMenuOption; |
The correct way to code a consuming item with a menu that sticks around is: [
"30Rnd_65x39_caseless_mag", "CONTAINER", "CONSUME", [], "", {true}, {
params ["_unit", "_container", "_item"];
systemChat format ["%1 consumed %2 from %3 - frame: %4",
name _unit, _item, typeOf _container, diag_frameno
];
_item in magazineCargo _container
}, true] call CBA_fnc_addItemContextMenuOption; |
Mods (complete and add to the following information):
2.02
3.15.2
Description:
The item context menu is never updated, even when an action is executed. This can cause conflicts between mods, since one mod can add an action that leaves the menu open, but should disable or enable a different action. In my opinion, this is an oversight and can cause unexpected behaviours.
Steps to reproduce:
Expected behavior:
The action should disappear.
Additional context:
The easiest and most solid solution would probably be updating the menu through an inventory player event handler.
The text was updated successfully, but these errors were encountered: