DayZ 1.24
Loading...
Searching...
No Matches
ActionReadPaper.c
Go to the documentation of this file.
2{
8
9 override void EndActionComponent()
10 {
11 }
12
13 override void OnStateChange(int pOldState, int pCurrentState)
14 {
15 if (pCurrentState == STATE_NONE && (!GetGame().IsDedicatedServer()))
16 {
17 if (GetGame().GetUIManager() && GetGame().GetUIManager().IsMenuOpen(MENU_NOTE))
18 GetGame().GetUIManager().FindMenu(MENU_NOTE).Close();
19 }
20 else if (pCurrentState == STATE_LOOP_LOOP && pOldState != STATE_LOOP_LOOP && (!GetGame().IsMultiplayer() || GetGame().IsServer()))
21 {
23 Param1<string> text = new Param1<string>(paper_item.GetWrittenNoteData().GetNoteText());
24 paper_item.RPCSingleParam(ERPCs.RPC_READ_NOTE, text, true, m_ActionData.m_Player.GetIdentity());
25 }
26 }
27};
28
30{
32 {
34 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_VIEWNOTE;
35 m_FullBody = true;
36 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_PRONE;
37 m_Text = "#read";
38 }
39
45
46 override bool HasTarget()
47 {
48 return false;
49 }
50
52 {
53 super.OnUpdate(action_data);
54
55 if (!GetGame().IsDedicatedServer())
56 {
57 if (action_data.m_State == UA_FINISHED && GetGame().GetUIManager() && !GetGame().GetUIManager().IsMenuOpen(MENU_NOTE))
58 ActionManagerClient.Cast(action_data.m_Player.GetActionManager()).RequestEndAction();
59 }
60 }
61
63 {
64 if (action_data.m_Callback)
65 action_data.m_Callback.InternalCommand(DayZPlayerConstants.CMD_ACTIONINT_INTERRUPT);
66 }
67};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
int m_StanceMask
Definition ActionBase.c:53
ERPCs
Definition ERPCs.c:2
ActionData m_ActionData
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ItemBase m_MainItem
Definition ActionBase.c:28
override void RequestEndAction()
override void OnStateChange(int pOldState, int pCurrentState)
override void CreateActionComponent()
override void EndActionComponent()
override void OnUpdate(ActionData action_data)
override void CreateConditionComponents()
override bool HasTarget()
override void OnEndRequest(ActionData action_data)
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
const int MENU_NOTE
Definition constants.c:180
const int UA_FINISHED
Definition constants.c:436
static const int STATE_NONE
undef state - not running anymore
Definition human.c:348
proto native void EnableStateChangeCallback()
enables state change callback OnStateChange
static const int STATE_LOOP_LOOP
Definition human.c:352