DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
CTActor.c
См. документацию.
2{
3 protected int m_Index;
4
5 protected Widget m_Root;
7
8 protected string m_HandsItem;
9 protected ref array<string> m_Items;
10
12
13 void CTActor( int index, vector pos, vector orient, string type, array<string> items, string hands_item, CameraToolsMenu parent )
14 {
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" ) );
18 m_Index = index;
19 m_Position = pos;
20 m_Orientation = orient;
21 m_Menu = parent;
22
23 m_IndexWidget.SetText( m_Index.ToString() );
24 m_FollowerRoot.SetHandler( this );
25 CreateFollowedObject( type );
26 SetHandsItem( hands_item );
27 SetItems( items );
28 }
29
30 void ~CTActor()
31 {
32 delete m_FollowerRoot;
33 }
34
35 string GetActorType()
36 {
37 if( m_FollowedObject )
38 return m_FollowedObject.GetType();
39 return "";
40 }
41
42 void AddItem( string item )
43 {
44 PlayerBase p = PlayerBase.Cast( m_FollowedObject );
45 if( p.GetInventory().CreateAttachment( item ) )
46 m_Items.Insert( item );
47 }
48
49 void SetItems( array<string> items )
50 {
51 m_Items = items;
52 PlayerBase p = PlayerBase.Cast( m_FollowedObject );
53 if( p )
54 {
55 foreach( string item : items )
56 {
57 p.GetInventory().CreateAttachment( item );
58 }
59 }
60 }
61
63 {
64 return m_Items;
65 }
66
67 void SetHandsItem( string item )
68 {
69 m_HandsItem = item;
70 if ( m_HandsItemObj && m_FollowedObject)
71 {
72 HumanInventory.Cast( m_FollowedObject.GetInventory() ).LocalDestroyEntity( m_HandsItemObj );
74 }
75 if (item)
76 {
77 HumanInventory.Cast( m_FollowedObject.GetInventory() ).CreateInHands( item );
78 }
79 }
80
81 string GetHandsItem()
82 {
83 return m_HandsItem;
84 }
85
86 void Reset()
87 {
88 string type = m_FollowedObject.GetType();
89 DestroyFollowedObject();
90 CreateFollowedObject( type );
91
93 SetItems( GetItems() );
94 }
95}
vector m_Orientation
Определения BleedingSource.c:15
vector m_Position
Cached world position.
Определения Effect.c:41
ServerBrowserMenuNew m_Menu
Определения ServerBrowserTab.c:37
proto native WorkspaceWidget GetWorkspace()
proto native void ObjectDelete(Object obj)
void ~CTActor()
Определения CTActor.c:30
void SetHandsItem(string item)
Определения CTActor.c:67
void AddItem(string item)
Определения CTActor.c:42
EntityAI m_HandsItemObj
Определения CTActor.c:11
void Reset()
Определения CTActor.c:86
array< string > GetItems()
Определения CTActor.c:62
string m_HandsItem
Определения CTActor.c:8
int m_Index
Определения CTActor.c:3
string GetHandsItem()
Определения CTActor.c:81
TextWidget m_IndexWidget
Определения CTActor.c:6
string GetActorType()
Определения CTActor.c:35
Widget m_Root
Определения CTActor.c:5
ref array< string > m_Items
Определения CTActor.c:9
void CTActor(int index, vector pos, vector orient, string type, array< string > items, string hands_item, CameraToolsMenu parent)
Определения CTActor.c:13
void SetItems(array< string > items)
Определения CTActor.c:49
Определения CTActor.c:2
Определения Building.c:6
proto native EntityAI CreateInHands(string typeName)
creates new entity in hands
override bool LocalDestroyEntity(notnull EntityAI item)
Определения HumanInventory.c:425
inventory for plain man/human
Определения HumanInventory.c:10
Определения PlayerBaseClient.c:2
Определения EnWidgets.c:220
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Определения EnConvert.c:106
proto native CGame GetGame()
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.