DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс InventoryActionHandler

Client only - manage set up crafting on client. Подробнее...

Закрытые члены

void InventoryActionHandler (PlayerBase player)
 
void SetAction (ActionBase action, ItemBase target_item, ItemBase main_item)
 
void SetAction (ActionBase action, ActionTarget target, ItemBase main_item)
 
bool IsActiveAction ()
 
void OnUpdate ()
 
void DeactiveAction ()
 

Закрытые данные

ActionBase m_action
 
ActionTarget m_target
 
ItemBase m_mainItem
 
bool m_useItemInHands
 
PlayerBase m_player
 
bool m_isActive
 
vector m_actionStartPos
 
const float MIN_DISTANCE_TO_INTERRUPT = 1.0
 
const int IAH_SINGLE_USE = 1
 
const int IAH_CONTINUOUS = 2
 

Подробное описание

Client only - manage set up crafting on client.

Конструктор(ы)

◆ InventoryActionHandler()

void InventoryActionHandler ( PlayerBase player)
inlineprivate
20 {
22 m_isActive = false;
23 m_action = null;
24 m_target = null;
26 m_useItemInHands = false;
27
28 }
ActionBase m_action
Definition InventoryActionHandler.c:4
ActionTarget m_target
Definition InventoryActionHandler.c:5
PlayerBase m_player
Definition InventoryActionHandler.c:9
bool m_useItemInHands
Definition InventoryActionHandler.c:7
bool m_isActive
Definition InventoryActionHandler.c:11
ItemBase m_mainItem
Definition InventoryActionHandler.c:6
Definition EntityAI.c:95

Перекрестные ссылки m_action, m_isActive, m_mainItem, m_player, m_target и m_useItemInHands.

Методы

◆ DeactiveAction()

void DeactiveAction ( )
inlineprivate
106 {
107 if( !m_isActive ) return;
108
109 m_isActive = false;
110
112 Class.CastTo(mngr, m_player.GetActionManager());
113
114 mngr.EjectAction(m_action);
115 mngr.ClearForceTarget();
116
117 m_player.GetCraftingManager().ResetInventoryCraft();
118
119 m_action = null;
120 m_target = null;
122 m_useItemInHands = false;
123 }
Definition ActionManagerClient.c:5
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), m_action, m_isActive, m_mainItem, m_player, m_target и m_useItemInHands.

Используется в OnUpdate().

◆ IsActiveAction()

bool IsActiveAction ( )
inlineprivate
64 {
65 return m_isActive;
66 }

Перекрестные ссылки m_isActive.

◆ OnUpdate()

void OnUpdate ( )
inlineprivate
69 {
70
71 if( !m_isActive ) return;
72
73 if( m_player.IsRaised() || m_player.GetCommand_Melee() )
74 {
76 return;
77 }
78
79 if( GetGame().IsInventoryOpen() )
80 {
82 return;
83 }
84
86 {
87 ItemBase handItem = m_player.GetItemInHands();
88
89 if( handItem != m_mainItem )
90 {
92 return;
93 }
94 }
95
97 {
99 return;
100 }
101
102
103 }
void DeactiveAction()
Definition InventoryActionHandler.c:105
vector m_actionStartPos
Definition InventoryActionHandler.c:12
const float MIN_DISTANCE_TO_INTERRUPT
Definition InventoryActionHandler.c:14
Definition InventoryItem.c:731
Definition EnMath.c:7
Definition EnConvert.c:106
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto native CGame GetGame()
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat(), DeactiveAction(), vector::Distance(), GetGame(), m_actionStartPos, m_isActive, m_mainItem, m_player, m_useItemInHands и MIN_DISTANCE_TO_INTERRUPT.

◆ SetAction() [1/2]

void SetAction ( ActionBase action,
ActionTarget target,
ItemBase main_item )
inlineprivate
43 {
45 Class.CastTo(mngr, m_player.GetActionManager());
46
50
51 ItemBase itemInHand = m_player.GetItemInHands();
53
54 m_actionStartPos = m_player.GetPosition();
55 m_isActive = true;
56
57 //mngr.InjectAction( action, target, main_item );
58 mngr.ForceTarget(m_target.GetObject());
59
60 GetGame().GetMission().HideInventory();
61 }

Перекрестные ссылки Class::CastTo(), GetGame(), m_action, m_actionStartPos, m_isActive, m_mainItem, m_player, m_target и m_useItemInHands.

◆ SetAction() [2/2]

void SetAction ( ActionBase action,
ItemBase target_item,
ItemBase main_item )
inlineprivate
31 {
33 if(target_item)
34 {
35 target_parent = target_item.GetHierarchyParent();
36 }
37 ActionTarget at = new ActionTarget(target_item, target_parent, -1, vector.Zero, -1);
38
40 }
class ActionTargets ActionTarget
void SetAction(ActionBase action, ItemBase target_item, ItemBase main_item)
Definition InventoryActionHandler.c:30
Definition ObjectTyped.c:2
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки ActionTarget, SetAction() и vector::Zero.

Используется в SetAction().

Поля

◆ IAH_CONTINUOUS

const int IAH_CONTINUOUS = 2
private

◆ IAH_SINGLE_USE

const int IAH_SINGLE_USE = 1
private

◆ m_action

ActionBase m_action
private

Используется в DeactiveAction(), InventoryActionHandler() и SetAction().

◆ m_actionStartPos

vector m_actionStartPos
private

Используется в OnUpdate() и SetAction().

◆ m_isActive

bool m_isActive
private

◆ m_mainItem

ItemBase m_mainItem
private

◆ m_player

PlayerBase m_player
private

◆ m_target

ActionTarget m_target
private

Используется в DeactiveAction(), InventoryActionHandler() и SetAction().

◆ m_useItemInHands

bool m_useItemInHands
private

◆ MIN_DISTANCE_TO_INTERRUPT

const float MIN_DISTANCE_TO_INTERRUPT = 1.0
private

Используется в OnUpdate().


Объявления и описания членов класса находятся в файле: