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

Private Member Functions

void ActionWorldCraft ()
 
override ActionData CreateActionData ()
 
override void CreateConditionComponents ()
 
override void OnActionInfoUpdate (PlayerBase player, ActionTarget target, ItemBase item)
 
override string GetText ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override string GetSoundCategory (ActionData action_data)
 
override bool SetupAction (PlayerBase player, ActionTarget target, ItemBase item, out ActionData action_data, Param extra_data=NULL)
 
override void Start (ActionData action_data)
 
override void OnEndServer (ActionData action_data)
 
override void OnEndClient (ActionData action_data)
 
override void OnFinishProgressServer (ActionData action_data)
 
override void OnFinishProgressClient (ActionData action_data)
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
- Private Member Functions inherited from ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Private Attributes

string m_ActionPrompt
 

Detailed Description

Definition at line 32 of file ActionWorldCraft.c.

Constructor & Destructor Documentation

◆ ActionWorldCraft()

void ActionWorldCraft::ActionWorldCraft ( )
inlineprivate

Definition at line 36 of file ActionWorldCraft.c.

37 {
39 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
40 m_FullBody = true;
41 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
42 }
bool m_FullBody
Definition ActionBase.c:52
int m_StanceMask
Definition ActionBase.c:53
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, m_FullBody, and m_StanceMask.

Member Function Documentation

◆ ActionCondition()

override bool ActionWorldCraft::ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 76 of file ActionWorldCraft.c.

77 {
78 //Client
79 if (!GetGame().IsDedicatedServer())
80 return true;
81 else //Server
82 {
83 if (!target.GetObject() || !item)
84 return false;
85 }
86
87 return true;
88 }
proto native CGame GetGame()

References GetGame().

◆ CreateActionData()

override ActionData ActionWorldCraft::CreateActionData ( )
inlineprivate

Definition at line 44 of file ActionWorldCraft.c.

◆ CreateConditionComponents()

override void ActionWorldCraft::CreateConditionComponents ( )
inlineprivate

Definition at line 50 of file ActionWorldCraft.c.

51 {
54 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ GetSoundCategory()

override string ActionWorldCraft::GetSoundCategory ( ActionData action_data)
inlineprivate

Definition at line 90 of file ActionWorldCraft.c.

91 {
93
94 ItemBase target = ItemBase.Cast(actionDataWorldCraft.m_Target.GetObject());
96
97 PluginRecipesManager recipesManager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
98
99 string soundCat = recipesManager.GetSoundCategory(actionDataWorldCraft.m_RecipeID, target, item);
100
101 return soundCat;
102 }
PluginBase GetPlugin(typename plugin_type)

References GetPlugin().

◆ GetText()

override string ActionWorldCraft::GetText ( )
inlineprivate

Definition at line 63 of file ActionWorldCraft.c.

64 {
67 {
68 PluginRecipesManager module_recipes_manager;
69 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
70 return module_recipes_manager.GetRecipeName(player.GetCraftingManager().GetRecipeID(m_VariantID));
71 }
72
73 return "Default worldcraft text";
74 }
int m_VariantID
Definition ActionBase.c:59
PlayerBase GetPlayer()
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.

References Class::CastTo(), GetGame(), GetPlayer(), GetPlugin(), and m_VariantID.

◆ HandleReciveData()

override void ActionWorldCraft::HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate

Definition at line 187 of file ActionWorldCraft.c.

188 {
189
192
193 action_data_wc.m_MainItem = recive_data_wc.m_MainItem;
194 if (!action_recive_data.m_Target)
195 action_data.m_Target = new ActionTarget(NULL, NULL, -1, vector.Zero, 0);
196 else
197 action_data_wc.m_Target = recive_data_wc.m_Target;
198 action_data_wc.m_RecipeID = recive_data_wc.m_RecipeID;
199 }
class ActionTargets ActionTarget
static const vector Zero
Definition EnConvert.c:110

References ActionTarget, and vector::Zero.

◆ OnActionInfoUpdate()

override void ActionWorldCraft::OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate

Definition at line 56 of file ActionWorldCraft.c.

57 {
58 PluginRecipesManager module_recipes_manager;
59 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
60 m_Text = module_recipes_manager.GetRecipeName(player.GetCraftingManager().GetRecipeID(m_VariantID));
61 }
string m_Text
Definition ActionBase.c:49

References Class::CastTo(), GetPlugin(), m_Text, and m_VariantID.

◆ OnEndClient()

override void ActionWorldCraft::OnEndClient ( ActionData action_data)
inlineprivate

Definition at line 130 of file ActionWorldCraft.c.

131 {
132 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(false);
133 }

◆ OnEndServer()

override void ActionWorldCraft::OnEndServer ( ActionData action_data)
inlineprivate

Definition at line 125 of file ActionWorldCraft.c.

126 {
127 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(false);
128 }

◆ OnFinishProgressClient()

override void ActionWorldCraft::OnFinishProgressClient ( ActionData action_data)
inlineprivate

Definition at line 155 of file ActionWorldCraft.c.

156 {
157 /*ActionManagerClient am = ActionManagerClient.Cast(action_data.m_Player.GetActionManager());
158 am.UnlockInventory(action_data);*/
159 }

◆ OnFinishProgressServer()

override void ActionWorldCraft::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 135 of file ActionWorldCraft.c.

136 {
137 /*if (!GetGame().IsMultiplayer())
138 {
139 ActionManagerClient am = ActionManagerClient.Cast(action_data.m_Player.GetActionManager());
140 am.UnlockInventory(action_data);
141 }*/
142
144 PluginRecipesManager module_recipes_manager;
146
148 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
149 Class.CastTo(item2, action_data.m_Target.GetObject());
150
151 if (action_data.m_MainItem && item2)
152 module_recipes_manager.PerformRecipeServer(action_data_wc.m_RecipeID, action_data.m_MainItem, item2, action_data.m_Player);
153 }

References Class::CastTo(), and GetPlugin().

◆ ReadFromContext()

override bool ActionWorldCraft::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate

Definition at line 170 of file ActionWorldCraft.c.

171 {
174
175 super.ReadFromContext(ctx, action_recive_data);
176
177 int recipeID;
178 if (!ctx.Read(recipeID))
179 return false;
180
182 recive_data_wc.m_RecipeID = recipeID;
183
184 return true;
185 }

◆ SetupAction()

override bool ActionWorldCraft::SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate

Definition at line 104 of file ActionWorldCraft.c.

105 {
106 if (super.SetupAction(player, target, item, action_data, extra_data))
107 {
108 if (!GetGame().IsDedicatedServer())
109 {
112 action_data_wc.m_RecipeID = player.GetCraftingManager().GetRecipeID(m_VariantID);
113 }
114 return true;
115 }
116 return false;
117 }

References Class::CastTo(), GetGame(), and m_VariantID.

◆ Start()

override void ActionWorldCraft::Start ( ActionData action_data)
inlineprivate

Definition at line 119 of file ActionWorldCraft.c.

120 {
121 super.Start(action_data);
122 if (action_data.m_Player) action_data.m_Player.TryHideItemInHands(true);
123 }

◆ WriteToContext()

override void ActionWorldCraft::WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate

Definition at line 161 of file ActionWorldCraft.c.

162 {
163 super.WriteToContext(ctx, action_data);
164
166
167 ctx.Write(action_data_wc.m_RecipeID);
168 }

Member Data Documentation

◆ m_ActionPrompt

string ActionWorldCraft::m_ActionPrompt
private

Definition at line 34 of file ActionWorldCraft.c.


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