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

Private Member Functions

void ActionUnfoldMapCB ()
 
void ~ActionUnfoldMapCB ()
 
override void SetActionData (ActionData action_data)
 
bool CancelCondition ()
 
override void OnStateChange (int pOldState, int pCurrentState)
 
override void OnAnimationEvent (int pEventID)
 
override void OnFinish (bool pCanceled)
 
void PerformMapChange ()
 
bool StateCheck ()
 
- Private Member Functions inherited from ActionBaseCB
void ActionBaseCB ()
 
int GetPossileStanceMask ()
 
override void OnFinish (bool pCanceled)
 
void SetCommand (int command_uid)
 
void CreateActionComponent ()
 
void InitActionComponent ()
 
void ProgressActionComponent ()
 
void EndActionComponent ()
 
void Interrupt ()
 
void SetActionData (ActionData action_data)
 
override bool IsUserActionCallback ()
 
float GetActionComponentProgress ()
 
int GetActionState ()
 
ActionTarget GetTarget ()
 

Private Attributes

bool m_MapFolding
 
bool m_HasReceivedEvent
 
bool m_CancelCondition
 
int m_InitMovementState
 
int m_FinalMovementState
 
- Private Attributes inherited from ActionBaseCB
ActionData m_ActionData
 
SoundOnVehicle m_SoundObject
 
bool m_Canceled
 
bool m_Interrupted
 

Detailed Description

Definition at line 1 of file ActionUnfoldMap.c.

Constructor & Destructor Documentation

◆ ActionUnfoldMapCB()

void ActionUnfoldMapCB::ActionUnfoldMapCB ( )
inlineprivate

Definition at line 9 of file ActionUnfoldMap.c.

10 {
14 }
class DayZCreatureAnimInterface RegisterAnimationEvent(string event_name, string function_name)
const int UA_ANIM_EVENT
Definition constants.c:443
proto native void EnableCancelCondition(bool pEnable)
proto native void EnableStateChangeCallback()
enables state change callback OnStateChange

References EnableCancelCondition(), EnableStateChangeCallback(), RegisterAnimationEvent(), and UA_ANIM_EVENT.

◆ ~ActionUnfoldMapCB()

void ActionUnfoldMapCB::~ActionUnfoldMapCB ( )
inlineprivate

Definition at line 16 of file ActionUnfoldMap.c.

17 {
18 if (GetGame() && GetGame().GetMission())
19 {
21 {
22 GetGame().GetMission().RemoveActiveInputExcludes({"map"}, false);
23 }
24 else
25 {
26 GetGame().GetMission().RemoveActiveInputExcludes({"loopedactions"}, false);
27 }
28 GetGame().GetMission().RemoveActiveInputRestriction(EInputRestrictors.MAP);
29 }
30
32 return;
33
34 ItemMap chernomap = ItemMap.Cast(m_ActionData.m_Player.GetItemInHands());
35 if (chernomap && m_ActionData.m_Player.IsMapOpen())
36 chernomap.SetMapStateOpen(false, m_ActionData.m_Player);
37 }
ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
proto native CGame GetGame()

References GetGame(), CfgGameplayHandler::GetUse3DMap(), ActionBaseCB::m_ActionData, and ActionData::m_Player.

Member Function Documentation

◆ CancelCondition()

bool ActionUnfoldMapCB::CancelCondition ( )
inlineprivate

Definition at line 45 of file ActionUnfoldMap.c.

46 {
47 return m_CancelCondition;
48 }

References m_CancelCondition.

◆ OnAnimationEvent()

override void ActionUnfoldMapCB::OnAnimationEvent ( int pEventID)
inlineprivate

Definition at line 59 of file ActionUnfoldMap.c.

60 {
62 return;
63
64 switch (pEventID)
65 {
66 case UA_ANIM_EVENT:
67 m_HasReceivedEvent = true;
68 m_FinalMovementState = m_ActionData.m_Player.m_MovementState.m_iStanceIdx;
69
70 if (StateCheck())
71 {
73 m_CancelCondition = false;
74 }
75 else
76 m_CancelCondition = true;
77 break;
78 }
79 }

References ActionBaseCB::m_ActionData, m_CancelCondition, m_FinalMovementState, m_HasReceivedEvent, ActionData::m_Player, PerformMapChange(), StateCheck(), and UA_ANIM_EVENT.

◆ OnFinish()

override void ActionUnfoldMapCB::OnFinish ( bool pCanceled)
inlineprivate

Definition at line 81 of file ActionUnfoldMap.c.

82 {
84 {
87
88 if ((!GetGame().IsDedicatedServer()) && GetGame().GetUIManager() && GetGame().GetUIManager().IsMenuOpen(MENU_MAP))
89 GetGame().GetUIManager().FindMenu(MENU_MAP).Close();
90
94
95 m_ActionData.m_Player.SetMapClosingSyncSet(false); //reset
96
97 ItemMap chernomap = ItemMap.Cast(m_ActionData.m_Player.GetItemInHands());
98 if (chernomap && m_ActionData.m_Player.IsMapOpen())
99 chernomap.SetMapStateOpen(false, m_ActionData.m_Player);
100
101 if (action)
102 action.End(m_ActionData);
103 }
104 }
ActionUnfoldMapCB ActionBaseCB ActionUnfoldMap()
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionBase m_Action
Definition ActionBase.c:27
const int MENU_MAP
Definition constants.c:181

References ActionUnfoldMap(), GetGame(), ActionData::m_Action, ActionData::m_ActionComponent, ActionBaseCB::m_ActionData, m_FinalMovementState, m_InitMovementState, ActionData::m_Player, ActionData::m_State, and MENU_MAP.

◆ OnStateChange()

override void ActionUnfoldMapCB::OnStateChange ( int pOldState,
int pCurrentState )
inlineprivate

Definition at line 50 of file ActionUnfoldMap.c.

51 {
53 return;
54
56 m_CancelCondition = true;
57 }
static const int STATE_LOOP_IN
looped state
Definition human.c:351
static const int STATE_LOOP_LOOP
Definition human.c:352

References ActionBaseCB::m_ActionData, m_CancelCondition, m_HasReceivedEvent, ActionData::m_Player, STATE_LOOP_IN, and STATE_LOOP_LOOP.

◆ PerformMapChange()

void ActionUnfoldMapCB::PerformMapChange ( )
inlineprivate

Definition at line 106 of file ActionUnfoldMap.c.

107 {
108 if (m_ActionData.m_Player.IsSwimming() || m_ActionData.m_Player.IsClimbing() || m_ActionData.m_Player.IsFalling() || m_ActionData.m_Player.IsClimbingLadder() || m_ActionData.m_Player.IsUnconscious() || m_ActionData.m_Player.IsRestrained())
109 return;
110
111 ItemMap chernomap = ItemMap.Cast(m_ActionData.m_Player.GetItemInHands());
112 if (chernomap)
113 {
114 if (!m_ActionData.m_Player.IsMapOpen() && !m_MapFolding)
115 {
116 if (m_CancelCondition) //do not open when cancelling in progress
117 return;
118
119 chernomap.SetMapStateOpen(true, m_ActionData.m_Player);
120
121 if (!GetGame().IsMultiplayer() || GetGame().IsServer())
122 {
123 //chernomap.SyncMapMarkers();
124 }
125
126 if (!GetGame().IsDedicatedServer())
127 {
128 UIManager m_UIManager;
130 m_UIManager = GetGame().GetUIManager();
131 m_UIManager.CloseAll();
133 {
134 mapMenu = m_UIManager.EnterScriptedMenu(MENU_MAP, null);
135 mapMenu.InitMapItem(chernomap);
136 mapMenu.LoadMapMarkers();
137 GetGame().GetMission().AddActiveInputExcludes({"map"});
138 }
139 else
140 {
141 GetGame().GetMission().AddActiveInputExcludes({"loopedactions"});
142 }
143
144 GetGame().GetMission().AddActiveInputRestriction(EInputRestrictors.MAP);
145 }
146 }
147 else if (m_ActionData.m_Player.IsMapOpen())
148 {
149 chernomap.SetMapStateOpen(false, m_ActionData.m_Player);
150 m_MapFolding = true;
151 m_ActionData.m_Player.SetMapOpen(false);
152 }
153 }
154 }
proto native UIScriptedMenu EnterScriptedMenu(int id, UIMenuPanel parent)
Create & open menu with specific id (see MenuID) and set its parent.
bool CloseAll()
Close all opened menus.
Definition UIManager.c:76

References UIManager::CloseAll(), UIManager::EnterScriptedMenu(), GetGame(), CfgGameplayHandler::GetUse3DMap(), ActionBaseCB::m_ActionData, m_CancelCondition, m_MapFolding, ActionData::m_Player, and MENU_MAP.

Referenced by OnAnimationEvent().

◆ SetActionData()

override void ActionUnfoldMapCB::SetActionData ( ActionData action_data)
inlineprivate

Definition at line 39 of file ActionUnfoldMap.c.

40 {
42 m_InitMovementState = m_ActionData.m_Player.m_MovementState.m_iStanceIdx;
43 }

References ActionBaseCB::m_ActionData, m_InitMovementState, and ActionData::m_Player.

◆ StateCheck()

bool ActionUnfoldMapCB::StateCheck ( )
inlineprivate

Definition at line 156 of file ActionUnfoldMap.c.

157 {
159 }

References m_FinalMovementState, and m_InitMovementState.

Referenced by OnAnimationEvent().

Member Data Documentation

◆ m_CancelCondition

bool ActionUnfoldMapCB::m_CancelCondition
private

◆ m_FinalMovementState

int ActionUnfoldMapCB::m_FinalMovementState
private

Definition at line 7 of file ActionUnfoldMap.c.

Referenced by OnAnimationEvent(), OnFinish(), and StateCheck().

◆ m_HasReceivedEvent

bool ActionUnfoldMapCB::m_HasReceivedEvent
private

Definition at line 4 of file ActionUnfoldMap.c.

Referenced by OnAnimationEvent(), and OnStateChange().

◆ m_InitMovementState

int ActionUnfoldMapCB::m_InitMovementState
private

Definition at line 6 of file ActionUnfoldMap.c.

Referenced by OnFinish(), SetActionData(), and StateCheck().

◆ m_MapFolding

bool ActionUnfoldMapCB::m_MapFolding
private

Definition at line 3 of file ActionUnfoldMap.c.

Referenced by PerformMapChange().


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