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

◆ LoadFromCfg()

void PluginBase::LoadFromCfg ( )
inlineprivate

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

13 {
14 string cfg_access = "CfgHorticulture"; // it is stored in dz\gear\cultivation\cfgHorticulture.hpp
15 int cfg_horticulture_count = GetGame().ConfigGetChildrenCount( cfg_access );
16
17 for ( int i = 0; i < cfg_horticulture_count; i++ )
18 {
19 string cfg_class_name = "";
20 GetGame().ConfigGetChildName( cfg_access, i, cfg_class_name );
21 string cfg_class_access = cfg_access + " " + cfg_class_name;
22
23 int cfg_class_count = GetGame().ConfigGetChildrenCount( cfg_class_access );
24
25 for ( int j = 0; j < cfg_class_count; j++ )
26 {
27 string cfg_subclass_name = "";
28 GetGame().ConfigGetChildName( cfg_class_access, j, cfg_subclass_name );
29 string cfg_subclass_access = cfg_class_access + " " + cfg_subclass_name;
30
31 int cfg_subclass_count = GetGame().ConfigGetChildrenCount( cfg_subclass_access );
32
33 PlantMaterialHealth plantMaterialHealth = NULL;
34
35 if ( cfg_class_name == "Plants" )
36 {
37 plantMaterialHealth = new PlantMaterialHealth;
38 m_PlantMaterials.Set( cfg_subclass_name, plantMaterialHealth );
39 }
40
41 for ( int k = 0; k < cfg_subclass_count; k++ )
42 {
43 string cfg_variable_name = "";
44 GetGame().ConfigGetChildName( cfg_subclass_access, k, cfg_variable_name );
45 string cfg_variable_access = cfg_subclass_access + " " + cfg_variable_name;
46
47 if ( cfg_class_name == "Plants" )
48 {
49 string string_param = "";
50 GetGame().ConfigGetText( cfg_variable_access, string_param );
51
52 if ( cfg_variable_name == "infestedTex" )
53 {
54 plantMaterialHealth.m_InfestedTex = string_param;
55 }
56 else if ( cfg_variable_name == "infestedMat" )
57 {
58 plantMaterialHealth.m_InfestedMat = string_param;
59 }
60 else if ( cfg_variable_name == "healthyTex" )
61 {
62 plantMaterialHealth.m_HealthyTex = string_param;
63 }
64 else if ( cfg_variable_name == "healthyMat" )
65 {
66 plantMaterialHealth.m_HealthyMat = string_param;
67 }
68 }
69 }
70 }
71 }
72 }
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
string m_HealthyMat
Определения PlantMaterial.c:6
string m_InfestedMat
Определения PlantMaterial.c:4
string m_HealthyTex
Определения PlantMaterial.c:5
string m_InfestedTex
Определения PlantMaterial.c:3
ref map< string, ref PlantMaterialHealth > m_PlantMaterials
Определения PluginHorticulture.c:3
proto native CGame GetGame()

Перекрестные ссылки CGame::ConfigGetChildName(), CGame::ConfigGetChildrenCount(), CGame::ConfigGetText(), GetGame(), PlantMaterialHealth::m_HealthyMat, PlantMaterialHealth::m_HealthyTex, PlantMaterialHealth::m_InfestedMat, PlantMaterialHealth::m_InfestedTex и m_PlantMaterials.

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