Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FieldManualConfigLoader.c
Go to the documentation of this file.
2{
3 //------------------------------------------------------------------------------------------------
7 static SCR_FieldManualConfigRoot LoadConfigRoot(ResourceName configPath)
8 {
9 SCR_FieldManualConfigRoot result = SCR_ConfigHelperT<SCR_FieldManualConfigRoot>.GetConfigObject(configPath);
10 if (!result)
11 return null;
12
13 if (result.m_aCategories)
14 {
15 foreach (SCR_FieldManualConfigCategory category : result.m_aCategories)
16 {
18 }
19 }
20
21 return result;
22 }
23
24 //------------------------------------------------------------------------------------------------
26 {
27 if (category.m_aCategories)
28 {
29 foreach (SCR_FieldManualConfigCategory subCategory : category.m_aCategories)
30 {
31 FillCategories(subCategory);
32 }
33 }
34
35 if (category.m_aEntries)
36 FillEntries(category.m_aEntries);
37 }
38
39 //------------------------------------------------------------------------------------------------
40 protected static void FillEntries(notnull array<ref SCR_FieldManualConfigEntry> entries)
41 {
42 foreach (SCR_FieldManualConfigEntry entry : entries)
43 {
45 if (weaponEntry)
46 FillEntries_Weapon(weaponEntry);
47 }
48 }
49
50 //------------------------------------------------------------------------------------------------
51 protected static void FillEntries_Weapon(notnull SCR_FieldManualConfigEntry_Weapon weaponEntry)
52 {
53 if (weaponEntry.m_sWeaponEntityPath.IsEmpty())
54 return;
55
56 SCR_FieldManualUI_WeaponStatsHelper weaponStatsHelper = new SCR_FieldManualUI_WeaponStatsHelper(weaponEntry.m_sWeaponEntityPath);
57
58 if (weaponEntry.m_sTitle.IsEmpty())
59 weaponEntry.m_sTitle = weaponStatsHelper.GetDisplayName();
60
61 if (weaponEntry.m_Image.IsEmpty())
62 weaponEntry.m_Image = weaponStatsHelper.GetInventoryIcon();
63
64 if (!weaponEntry.m_aContent)
65 weaponEntry.m_aContent = {};
66
67 if (weaponEntry.m_aContent.IsEmpty())
68 weaponEntry.m_aContent.Insert(new SCR_FieldManualPiece_Text()); // will be auto-filled below
69
70 // fill the first empty text with weapon description
71 foreach (SCR_FieldManualPiece piece : weaponEntry.m_aContent)
72 {
73 SCR_FieldManualPiece_Text textPiece = SCR_FieldManualPiece_Text.Cast(weaponEntry.m_aContent[0]);
74 if (textPiece && textPiece.m_sText.IsEmpty())
75 {
76 textPiece.m_sText = weaponStatsHelper.GetDescription();
77 break;
78 }
79 }
80
81 weaponEntry.m_WeaponStatsHelper = weaponStatsHelper;
82 }
83}
static void FillCategories(notnull SCR_FieldManualConfigCategory category)
static void FillEntries_Weapon(notnull SCR_FieldManualConfigEntry_Weapon weaponEntry)
static void FillEntries(notnull array< ref SCR_FieldManualConfigEntry > entries)