Added option for ignoring contents in the interaction menu

Also ignore Clonks as "inventory items" if they are contained.
master
Mark 2018-12-21 09:01:20 +01:00
parent fcf2af1937
commit ed514b7716
2 changed files with 13 additions and 0 deletions

View File

@ -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));

View File

@ -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 = []};