Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
ctactor.c
Go to the documentation of this file.
1
class
CTActor
extends
CTObjectFollower
2
{
3
protected
int
m_Index
;
4
5
protected
Widget
m_Root
;
6
protected
TextWidget
m_IndexWidget
;
7
8
protected
string
m_HandsItem
;
9
protected
ref
array<string>
m_Items
;
10
11
protected
EntityAI
m_HandsItemObj
;
12
13
void
CTActor
(
int
index,
vector
pos,
vector
orient,
string
type,
array<string>
items,
string
hands_item, CameraToolsMenu parent )
14
{
15
m_FollowerRoot =
g_Game
.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
62
array<string>
GetItems
()
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
);
73
g_Game
.ObjectDelete(
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
92
SetHandsItem
(
m_HandsItem
);
93
SetItems
(
GetItems
() );
94
}
95
}
m_Orientation
vector m_Orientation
Definition
bleedingsource.c:15
CTObjectFollower
Definition
ctactor.c:2
CTObjectFollower::m_Items
ref array< string > m_Items
Definition
ctactor.c:9
CTObjectFollower::m_Root
Widget m_Root
Definition
ctactor.c:5
CTObjectFollower::m_IndexWidget
TextWidget m_IndexWidget
Definition
ctactor.c:6
CTObjectFollower::Reset
void Reset()
Definition
ctactor.c:86
CTObjectFollower::AddItem
void AddItem(string item)
Definition
ctactor.c:42
CTObjectFollower::CTActor
void CTActor(int index, vector pos, vector orient, string type, array< string > items, string hands_item, CameraToolsMenu parent)
Definition
ctactor.c:13
CTObjectFollower::m_Index
int m_Index
Definition
ctactor.c:3
CTObjectFollower::GetActorType
string GetActorType()
Definition
ctactor.c:35
CTObjectFollower::GetItems
array< string > GetItems()
Definition
ctactor.c:62
CTObjectFollower::SetItems
void SetItems(array< string > items)
Definition
ctactor.c:49
CTObjectFollower::GetHandsItem
string GetHandsItem()
Definition
ctactor.c:81
CTObjectFollower::m_HandsItem
string m_HandsItem
Definition
ctactor.c:8
CTObjectFollower::SetHandsItem
void SetHandsItem(string item)
Definition
ctactor.c:67
CTObjectFollower::m_HandsItemObj
EntityAI m_HandsItemObj
Definition
ctactor.c:11
CTObjectFollower::~CTActor
void ~CTActor()
Definition
ctactor.c:30
EntityAI
Definition
inventoryitem.c:2
HumanInventory
inventory for plain man/human
Definition
humaninventory.c:10
HumanInventory::LocalDestroyEntity
override bool LocalDestroyEntity(notnull EntityAI item)
Definition
humaninventory.c:435
HumanInventory::CreateInHands
proto native EntityAI CreateInHands(string typeName)
PlayerBase
Definition
playerbaseclient.c:2
TextWidget
Definition
enwidgets.c:220
Widget
Definition
enwidgets.c:190
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
vector
Definition
enconvert.c:119
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
m_Position
vector m_Position
Cached world position.
Definition
effect.c:43
m_Menu
ServerBrowserMenuNew m_Menu
Definition
serverbrowsertab.c:37
Games
Dayz
scripts
5_mission
gui
cameratools
ctactor.c
Generated by
1.17.0