8 protected string m_HandsItem;
13 void CTActor(
int index,
vector pos,
vector orient,
string type,
array<string> items,
string hands_item, CameraToolsMenu parent )
15 m_FollowerRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/camera_tools/event_tracker.layout",
null );
16 m_FollowerButton = m_FollowerRoot.FindAnyWidget(
"IconPanel" );
17 m_IndexWidget =
TextWidget.Cast( m_FollowerRoot.FindAnyWidget(
"Text" ) );
23 m_IndexWidget.SetText( m_Index.ToString() );
24 m_FollowerRoot.SetHandler(
this );
25 CreateFollowedObject( type );
26 SetHandsItem( hands_item );
32 delete m_FollowerRoot;
37 if( m_FollowedObject )
38 return m_FollowedObject.GetType();
42 void AddItem(
string item )
45 if( p.GetInventory().CreateAttachment( item ) )
46 m_Items.Insert( item );
55 foreach(
string item : items )
57 p.GetInventory().CreateAttachment( item );
67 void SetHandsItem(
string item )
70 if ( m_HandsItemObj && m_FollowedObject)
72 HumanInventory.Cast( m_FollowedObject.GetInventory() ).LocalDestroyEntity( m_HandsItemObj );
73 GetGame().ObjectDelete( m_HandsItemObj );
77 HumanInventory.Cast( m_FollowedObject.GetInventory() ).CreateInHands( item );
88 string type = m_FollowedObject.GetType();
89 DestroyFollowedObject();
90 CreateFollowedObject( type );
92 SetHandsItem( m_HandsItem );
93 SetItems( GetItems() );