DayZ 1.24
Loading...
Searching...
No Matches
CTObjectFollower Class Reference
Collaboration diagram for CTObjectFollower:
[legend]

Protected Member Functions

void CTActor (int index, vector pos, vector orient, string type, array< string > items, string hands_item, CameraToolsMenu parent)
 
void ~CTActor ()
 
string GetActorType ()
 
void AddItem (string item)
 
void SetItems (array< string > items)
 
array< stringGetItems ()
 
void SetHandsItem (string item)
 
string GetHandsItem ()
 
void Reset ()
 

Protected Attributes

int m_Index
 
Widget m_Root
 
TextWidget m_IndexWidget
 
string m_HandsItem
 
ref array< stringm_Items
 
EntityAI m_HandsItemObj
 

Detailed Description

Definition at line 1 of file CTActor.c.

Constructor & Destructor Documentation

◆ ~CTActor()

void CTObjectFollower::~CTActor ( )
inlineprotected

Definition at line 30 of file CTActor.c.

31 {
32 delete m_FollowerRoot;
33 }

Member Function Documentation

◆ AddItem()

void CTObjectFollower::AddItem ( string item)
inlineprotected

Definition at line 42 of file CTActor.c.

43 {
44 PlayerBase p = PlayerBase.Cast(m_FollowedObject);
45 if (p.GetInventory().CreateAttachment(item))
46 m_Items.Insert(item);
47 }
ref array< string > m_Items
Definition CTActor.c:9

◆ CTActor()

void CTObjectFollower::CTActor ( int index,
vector pos,
vector orient,
string type,
array< string > items,
string hands_item,
CameraToolsMenu parent )
inlineprotected

Definition at line 13 of file CTActor.c.

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;
21 m_Menu = parent;
22
23 m_IndexWidget.SetText(m_Index.ToString());
24 m_FollowerRoot.SetHandler(this);
25 CreateFollowedObject(type);
28 }
vector m_Orientation
vector m_Position
Cached world position.
Definition Effect.c:41
ServerBrowserMenuNew m_Menu
void SetHandsItem(string item)
Definition CTActor.c:65
TextWidget m_IndexWidget
Definition CTActor.c:6
void SetItems(array< string > items)
Definition CTActor.c:49
proto native CGame GetGame()

References GetGame(), m_Menu, m_Orientation, m_Position, SetHandsItem(), and SetItems().

Referenced by ScriptedWidgetEventHandler::OnMouseButtonDown().

◆ GetActorType()

string CTObjectFollower::GetActorType ( )
inlineprotected

Definition at line 35 of file CTActor.c.

36 {
37 if (m_FollowedObject)
38 return m_FollowedObject.GetType();
39 return "";
40 }

◆ GetHandsItem()

string CTObjectFollower::GetHandsItem ( )
inlineprotected

Definition at line 77 of file CTActor.c.

78 {
79 return m_HandsItem;
80 }
string m_HandsItem
Definition CTActor.c:8

References m_HandsItem.

◆ GetItems()

array< string > CTObjectFollower::GetItems ( )
inlineprotected

Definition at line 60 of file CTActor.c.

61 {
62 return m_Items;
63 }

References m_Items.

Referenced by Reset().

◆ Reset()

void CTObjectFollower::Reset ( )
inlineprotected

Definition at line 82 of file CTActor.c.

83 {
84 string type = m_FollowedObject.GetType();
85 DestroyFollowedObject();
86 CreateFollowedObject(type);
87
90 }
array< string > GetItems()
Definition CTActor.c:60

References GetItems(), SetHandsItem(), and SetItems().

◆ SetHandsItem()

void CTObjectFollower::SetHandsItem ( string item)
inlineprotected

Definition at line 65 of file CTActor.c.

66 {
68 if (m_HandsItemObj && m_FollowedObject)
69 {
70 HumanInventory.Cast(m_FollowedObject.GetInventory()).LocalDestroyEntity(m_HandsItemObj);
71 GetGame().ObjectDelete(m_HandsItemObj);
72 }
73 if (item)
74 HumanInventory.Cast(m_FollowedObject.GetInventory()).CreateInHands(item);
75 }
EntityAI m_HandsItemObj
Definition CTActor.c:11
inventory for plain man/human
proto native EntityAI CreateInHands(string typeName)
creates new entity in hands
override bool LocalDestroyEntity(notnull EntityAI item)

References HumanInventory::CreateInHands(), GetGame(), and HumanInventory::LocalDestroyEntity().

Referenced by CTActor(), and Reset().

◆ SetItems()

void CTObjectFollower::SetItems ( array< string > items)
inlineprotected

Definition at line 49 of file CTActor.c.

50 {
51 m_Items = items;
52 PlayerBase p = PlayerBase.Cast(m_FollowedObject);
53 if (p)
54 {
55 foreach (string item : items)
56 p.GetInventory().CreateAttachment(item);
57 }
58 }

Referenced by CTActor(), and Reset().

Member Data Documentation

◆ m_HandsItem

string CTObjectFollower::m_HandsItem
protected

Definition at line 8 of file CTActor.c.

Referenced by GetHandsItem().

◆ m_HandsItemObj

EntityAI CTObjectFollower::m_HandsItemObj
protected

Definition at line 11 of file CTActor.c.

◆ m_Index

int CTObjectFollower::m_Index
protected

Definition at line 3 of file CTActor.c.

◆ m_IndexWidget

TextWidget CTObjectFollower::m_IndexWidget
protected

Definition at line 6 of file CTActor.c.

◆ m_Items

ref array<string> CTObjectFollower::m_Items
protected

Definition at line 9 of file CTActor.c.

Referenced by GetItems().

◆ m_Root

Widget CTObjectFollower::m_Root
protected

Definition at line 5 of file CTActor.c.


The documentation for this class was generated from the following file: