Anonymous Login
2020-06-05 22:25 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001896OpenClonkObjectspublic2017-03-06 04:39
Assigned ToMarky 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Product Version 
Target VersionFixed in Version 
Summary0001896: ObjectInterationMenu: Callback target for entries_callback
DescriptionIn 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.
TagsNo tags attached.
Attached Files




Marky (developer)

I think I'll be going for the extra parameter option "entries_callback_parameter", because it seems to be the most flexible variant.


occ (reporter)

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 <>
ObjectInteractionMenu: Add parameter for entry callback 0001896


-Issue History
Date Modified Username Field Change
2017-03-03 22:57 Marky New Issue
2017-03-03 22:59 Marky Description Updated View Revisions
2017-03-04 10:42 Marky Note Added: 0005621
2017-03-06 04:36 occ Note Added: 0005622
2017-03-06 04:39 Marky Assigned To => Marky
2017-03-06 04:39 Marky Status new => resolved
2017-03-06 04:39 Marky Resolution open => fixed
+Issue History