DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionWorldCraft
+ Граф наследования:ActionWorldCraft:

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

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)
 
- Закрытые члены унаследованные от 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)
 

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

string m_ActionPrompt
 

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

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

◆ ActionWorldCraft()

void ActionWorldCraft ( )
inlineprivate
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:61
int m_StanceMask
Definition ActionBase.c:62
Definition ActionWorldCraft.c:11
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, ActionBase::m_FullBody и ActionBase::m_StanceMask.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
77 {
78 //Client
79 if ( !GetGame().IsDedicatedServer() )
80 {
81 return true;
82 }
83 else //Server
84 {
85 if ( !target.GetObject() || !item )
86 return false;
87 }
88
89 return true;
90 }
Definition EntityAI.c:95
proto native CGame GetGame()

Перекрестные ссылки GetGame().

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate
45 {
46 ActionData action_data = new WorldCraftActionData;
47 return action_data;
48 }

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
51 {
54 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINone.c:2
Definition CCTObject.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

Перекрестные ссылки UAMaxDistances::DEFAULT, ActionBase::m_ConditionItem и ActionBase::m_ConditionTarget.

◆ GetSoundCategory()

override string GetSoundCategory ( ActionData action_data)
inlineprivate
93 {
95
96 ItemBase target = ItemBase.Cast(actionDataWorldCraft.m_Target.GetObject());
98
99 PluginRecipesManager recipesManager = PluginRecipesManager.Cast(GetPlugin(PluginRecipesManager));
100
101 string soundCat = recipesManager.GetSoundCategory(actionDataWorldCraft.m_RecipeID,target, item);
102
103 return soundCat;
104 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
Definition InventoryItem.c:731

Перекрестные ссылки GetPlugin().

◆ GetText()

override string GetText ( )
inlineprivate
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 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
int m_VariantID
Definition ActionBase.c:68
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition PlayerBaseClient.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), GetGame(), GetPlayer(), GetPlugin() и ActionBase::m_VariantID.

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate
192 {
193
196
197 action_data_wc.m_MainItem = recive_data_wc.m_MainItem;
198 if (!action_recive_data.m_Target)
199 {
200 action_data.m_Target = new ActionTarget(NULL, NULL, -1, vector.Zero, 0);
201 }
202 else
203 {
204 action_data_wc.m_Target = recive_data_wc.m_Target;
205 }
206 action_data_wc.m_RecipeID = recive_data_wc.m_RecipeID;
207 }
class ActionTargets ActionTarget
Definition ActionWorldCraft.c:2
Definition EnConvert.c:106
static const vector Zero
Definition EnConvert.c:110

Перекрестные ссылки ActionTarget и vector::Zero.

◆ OnActionInfoUpdate()

override void OnActionInfoUpdate ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
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:58

Перекрестные ссылки Class::CastTo(), GetPlugin(), ActionBase::m_Text и ActionBase::m_VariantID.

◆ OnEndClient()

override void OnEndClient ( ActionData action_data)
inlineprivate
138 {
139 if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
140 }

◆ OnEndServer()

override void OnEndServer ( ActionData action_data)
inlineprivate
131 {
132 if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(false);
133
134 super.OnEndServer(action_data);
135 }

◆ OnFinishProgressClient()

override void OnFinishProgressClient ( ActionData action_data)
inlineprivate
160 {
161 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
143 {
145 PluginRecipesManager module_recipes_manager;
147
149 Class.CastTo(module_recipes_manager, GetPlugin(PluginRecipesManager));
150 Class.CastTo(item2, action_data.m_Target.GetObject());
151
152 if (action_data.m_MainItem && item2)
153 {
155 module_recipes_manager.PerformRecipeServer(action_data_wc.m_RecipeID, action_data.m_MainItem, item2, action_data.m_Player);
156 }
157 }
void ClearActionJuncture(ActionData action_data)
Definition ActionBase.c:979

Перекрестные ссылки Class::CastTo(), ActionBase::ClearActionJuncture() и GetPlugin().

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate
173 {
175 {
177 }
178
179 super.ReadFromContext(ctx, action_recive_data);
180
181 int recipeID;
182 if (!ctx.Read(recipeID))
183 return false;
184
186 recive_data_wc.m_RecipeID = recipeID;
187
188 return true;
189 }

◆ SetupAction()

override bool SetupAction ( PlayerBase player,
ActionTarget target,
ItemBase item,
out ActionData action_data,
Param extra_data = NULL )
inlineprivate
107 {
108 if (super.SetupAction(player, target, item, action_data, extra_data ))
109 {
111
112 if (!GetGame().IsDedicatedServer()) // server synchs the recipe id through HandleReceiveData before this
113 action_data_wc.m_RecipeID = player.GetCraftingManager().GetRecipeID(m_VariantID);
114
115 PluginRecipesManager moduleRecipesManager;
116 Class.CastTo(moduleRecipesManager, GetPlugin(PluginRecipesManager));
117 m_CommandUID = moduleRecipesManager.GetAnimationCommandUID(action_data_wc.m_RecipeID);
118
119 return true;
120 }
121 return false;
122 }

Перекрестные ссылки Class::CastTo(), GetGame(), GetPlugin(), AnimatedActionBase::m_CommandUID и ActionBase::m_VariantID.

◆ Start()

override void Start ( ActionData action_data)
inlineprivate
125 {
126 super.Start(action_data);
127 if ( action_data.m_Player ) action_data.m_Player.TryHideItemInHands(true);
128 }

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate
164 {
165 super.WriteToContext(ctx, action_data);
166
168
169 ctx.Write(action_data_wc.m_RecipeID);
170 }

Поля

◆ m_ActionPrompt

string m_ActionPrompt
private

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