forked from Mirrors/openclonk
Added option for ignoring contents in the interaction menu
Also ignore Clonks as "inventory items" if they are contained.master
parent
fcf2af1937
commit
ed514b7716
|
@ -282,6 +282,13 @@ public func RejectInteractionMenu(object to)
|
|||
return _inherited(to, ...);
|
||||
}
|
||||
|
||||
// You can not display the Clonk as a content entry in a building.
|
||||
// Otherwise you can transfer a crew member to your inventory...
|
||||
public func RejectInteractionMenuContentEntry(object menu_target, object container)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public func GetSurroundingEntryMessage(object for_clonk)
|
||||
{
|
||||
if (!GetAlive()) return Format("{{Clonk_Grave}} %s", Clonk_Grave->GetInscriptionForClonk(this));
|
||||
|
|
|
@ -837,6 +837,12 @@ func FxIntRefreshContentsMenuTimer(object target, effect, int time)
|
|||
var obj, i = 0;
|
||||
while (obj = effect.obj->Contents(i++))
|
||||
{
|
||||
// Ignore objects that do not want to be shown as contents
|
||||
if (obj->~RejectInteractionMenuContentEntry(cursor, effect.obj))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var symbol = obj;
|
||||
var extra_data = {slot = effect.slot, menu_index = effect.menu_index, objects = []};
|
||||
|
||||
|
|
Loading…
Reference in New Issue