|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001896||OpenClonk||Objects||public||2017-03-03 23:57||2017-03-06 05:39|
|Priority||normal||Severity||feature||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0001896: ObjectInterationMenu: Callback target for entries_callback|
|Description||In the object interaction menu I want to be able to set the object context for the entry callback.|
The current situation is this: In Hazard the firemode selection is a part of the interaction menu for the clonk. The clonk asks all contents whether they have some sort of interaction menu entries via GetInteractionMenus() and displays these in his inventory page.
Now, the items generate entries in their category. During GetInteractionMenus() the function context is in the item, here everything is fine. When the object interaction menu calls the "entries_callback", however, I can use a function of the item, but it will be executed in the Clonk's context.
I intended for the item to go through its firemodes and create menu items accordingly. However, since the function is called from the clonk's context, it will go through the clonk's firemodes (he doesn't have any) and consequently no entries are created.
The "feature" could be resolved the following ways, imo:
- find a better solution than asking the items for their entries
- execute the callback in the context of "callback_target", or add another property "entries_callback_target", so that it does not cause problems with the existing objects that use "callback_target"
- add an optional "entries_callback_parameters" (or similar implementation) that allows passing additional parameters to the "entries_callback" function (this way I could pass the item from GetInteractionMenus())
- find yet another solution that works similarly and/or better
I can do the changes myself, nonetheless I want to agree with you on the best option before I extend such an integral part of the game.
|Tags||No tags attached.|
|I think I'll be going for the extra parameter option "entries_callback_parameter", because it seems to be the most flexible variant.|
Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
Changeset c37bc58 by Mark <email@example.com>
ObjectInteractionMenu: Add parameter for entry callback 0001896
|2017-03-03 23:57||Marky||New Issue|
|2017-03-03 23:59||Marky||Description Updated||View Revisions|
|2017-03-04 11:42||Marky||Note Added: 0005621|
|2017-03-06 05:36||occ||Note Added: 0005622|
|2017-03-06 05:39||Marky||Assigned To||=> Marky|
|2017-03-06 05:39||Marky||Status||new => resolved|
|2017-03-06 05:39||Marky||Resolution||open => fixed|