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

◆ OnUpdate()

void CraftingManager::OnUpdate ( Object item,
Object target,
int component_index )
inlineprivate

См. определение в файле CraftingManager.c строка 69

70 {
71 ItemBase item1 = ItemBase.Cast( item );
72 ItemBase item2 = ItemBase.Cast( target );
73
74 if ( m_player.GetActionManager().GetRunningAction() )
75 return;
76
77 ItemBase item_in_hands = m_player.GetItemInHands();
78
79 if (!item1 || !item2)
80 {
81 m_recipeCount = 0;
84 return;
85 }
86 else
87 {
88
89 if ( item1 != item_in_hands && item2 != item_in_hands )
90 {
91 InventoryLocation il1 = new InventoryLocation;
92 InventoryLocation il2 = new InventoryLocation;
93
94 item1.GetInventory().GetCurrentInventoryLocation(il1);
95 item2.GetInventory().GetCurrentInventoryLocation(il2);
96
97 Error("Crafting manager - both of items are out of hands - item1: " + il1.DumpToString() + " item2: " + il2.DumpToString() + " / item in hands: - " + item_in_hands);
98 }
99 }
100
101 int recipeCount = 0;
102
104 {
105 recipeCount = m_recipesManager.GetValidRecipes(m_item1, m_item2, m_recipes, m_player);
106 m_recipeCount = recipeCount;
108 return;
109 }
110
111 recipeCount = m_recipesManager.GetValidRecipes(item1, item2, m_recipes, m_player);
112
113 if (recipeCount == 0)
114 {
115 m_recipeCount = 0;
118 }
119 else
120 {
121 if ( m_craftingMode == CM_MODE_NONE || m_recipeCount != recipeCount || m_item1 != item1 || m_item2 != item2 )
122 {
124 m_recipeCount = recipeCount;
126 m_item1 = item1;
127 m_item2 = item2;
128
129 m_actionVariantManager.SetActionVariantCount(m_recipeCount);
130 }
132 }
133
134 }
class GP5GasMask extends MaskBase ItemBase
ref array< int > m_recipes
Определения CraftingManager.c:18
int m_recipeID
Определения CraftingManager.c:11
ItemBase m_item2
Определения CraftingManager.c:16
const int CM_MODE_WORLD
Определения CraftingManager.c:5
int m_contextualRecipeID
Определения CraftingManager.c:12
int m_craftingMode
Определения CraftingManager.c:14
const int CM_MODE_NONE
Определения CraftingManager.c:4
const int CM_MODE_INVENTORY
Определения CraftingManager.c:6
PlayerBase m_player
Определения CraftingManager.c:8
int m_recipeCount
Определения CraftingManager.c:13
ItemBase m_item1
Определения CraftingManager.c:15
PluginRecipesManager m_recipesManager
Определения CraftingManager.c:9
ActionVariantManager m_actionVariantManager
Определения CraftingManager.c:10
string DumpToString()
Определения InventoryLocation.c:233
void Error(string err)
Messagebox with error message.
Определения EnDebug.c:90

Перекрестные ссылки CM_MODE_INVENTORY, CM_MODE_NONE, CM_MODE_WORLD, InventoryLocation::DumpToString(), Error(), m_actionVariantManager, m_contextualRecipeID, m_craftingMode, m_item1, m_item2, m_player, m_recipeCount, m_recipeID, m_recipes и m_recipesManager.

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