```
protected ActionBase FindContextualContinuousAction(ActionTarget target, ItemBase item)
{
Object targetObject;
Object targetParent;
if( target )
{
targetObject = target.GetObject();
targetParent = target.GetParent();
}
ref TIntArray primary_action_ids = new TIntArray;
ActionBase picked_action;
primary_action_ids.Insert(AT_WORLD_CRAFT);
if (targetParent)
{
targetParent.GetContinuousActions(primary_action_ids);
}
// Adding interact actions of items in the world
if ( targetObject )
{
targetObject.GetContinuousActions(primary_action_ids);
}
if ( item )
{
item.GetContinuousActions(primary_action_ids);
}
// Adding default continuous actions of player
if ( m_Player )
{
m_Player.GetContinuousActions(primary_action_ids);
}
// Adding actions of item
// Looking for first possible continuous action
if ( primary_action_ids && primary_action_ids.Count() > 0 )
{
for ( int i = 0; i < primary_action_ids.Count(); i++ )
{
picked_action = GetAction(primary_action_ids.Get(i));
if ( picked_action && picked_action.Can(m_Player,target, item) )
{
return picked_action;
}
}
}
return NULL;
}
```
------
```
protected ActionBase FindContextualSingleUseAction(ActionTarget target, ItemBase item)
{
Object targetObject;
Object targetParent;
if( target )
{
targetObject = target.GetObject();
targetParent = target.GetParent();
}
ref TIntArray secondary_action_ids = new TIntArray;
ActionBase picked_action;
secondary_action_ids.Insert(AT_WORLD_CRAFT_SWITCH);
if (targetParent)
{
targetParent.GetSingleUseActions(secondary_action_ids);
}
// Adding interact actions of items in the world
if ( targetObject )
{
targetObject.GetSingleUseActions(secondary_action_ids);
}
// Adding actions of item
if ( item )
{
item.GetSingleUseActions(secondary_action_ids);
}
// Adding default single use actions of player
if ( m_Player )
{
m_Player.GetSingleUseActions(secondary_action_ids);
}
// Looking for first possible single use action
if ( secondary_action_ids && secondary_action_ids.Count() > 0 )
{
for ( int i = 0; i < secondary_action_ids.Count(); i++ )
{
picked_action = GetAction(secondary_action_ids.Get(i));
if ( picked_action && picked_action.Can(m_Player, target, item) )
{
return picked_action;
}
}
}
return NULL;
}
```