Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_WeaponFireModeCondition.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
4{
5 [Attribute(defvalue: EWeaponFiremodeType.Safety.ToString(), desc: "Fire mode to check", uiwidget: UIWidgets.ComboBox, enumType: EWeaponFiremodeType)]
7
8 [Attribute("true", uiwidget: UIWidgets.CheckBox, "True = currently active, False = contains")]
9 protected bool m_bIsCurrent;
10
11 //------------------------------------------------------------------------------------------------
13 {
14 // Check muzzle
15 BaseMuzzleComponent muzzle = data.GetCurrentMuzzle();
16 if (!muzzle)
17 return false;
18
19 // Get result
20 bool result;
21
22 if (m_bIsCurrent)
23 {
24 BaseFireMode mode = muzzle.GetCurrentFireMode();
25 if (mode)
26 result = (mode.GetFiremodeType() == m_iValue);
27 }
28 else
29 result = ContainsMode(muzzle, m_iValue);
30
31 return GetReturnResult(result);
32 }
33
34 //------------------------------------------------------------------------------------------------
35 protected bool ContainsMode(BaseMuzzleComponent muzzle, EWeaponFiremodeType modeType)
36 {
37 // Get fire modes list
38 array<BaseFireMode> fireModes = {};
39 muzzle.GetFireModesList(fireModes);
40
41 // Go throught fire modes
42 int count = fireModes.Count();
43 for (int i = 0; i < count; i++)
44 {
45 // Contains mode
46 if (fireModes[i].GetFiremodeType() == modeType)
47 return true;
48 }
49
50 // Not found
51 return false;
52 }
53}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
A single available action condition representation.
override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
bool ContainsMode(BaseMuzzleComponent muzzle, EWeaponFiremodeType modeType)
SCR_FieldOfViewSettings Attribute
EWeaponFiremodeType