Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AttachPylonSupportStationAction.c
Go to the documentation of this file.
2{
3 [Attribute("0", params: "0 inf")]
4 protected int m_iPylonIndex;
5
7
8 //------------------------------------------------------------------------------------------------
13
14 //------------------------------------------------------------------------------------------------
15 override bool CanBeShownScript(IEntity user)
16 {
17 //~ Not valid or already occupied
18 if (m_sItemPrefab.IsEmpty() || !m_WeaponSlot || m_WeaponSlot.GetWeaponEntity())
19 return false;
20
21 return super.CanBeShownScript(user);
22 }
23
24 //------------------------------------------------------------------------------------------------
25 protected override void DelayedInit(IEntity owner)
26 {
27 if (!owner)
28 return;
29
30 super.DelayedInit(owner);
31
33 if (!itemData)
34 return;
35
36 m_sItemPrefab = itemData.GetItemPrefab();
37
39
40 array<Managed> weaponSlots = {};
42 WeaponSlotComponent weaponSlot;
43
44 foreach (Managed slot : weaponSlots)
45 {
46 weaponSlot = WeaponSlotComponent.Cast(slot);
47 if (!weaponSlot)
48 continue;
49
50 if (weaponSlot.GetWeaponSlotIndex() == m_iPylonIndex)
51 m_WeaponSlot = weaponSlot;
52 }
53
54 if (!m_WeaponSlot)
55 Print("SCR_AttachPylonSupportStationAction: Could not find weapon slot!", LogLevel.ERROR);
56 }
57
58 //------------------------------------------------------------------------------------------------
60 {
61 return ESupportStationType.VEHICLE_WEAPON;
62 }
63
64 //------------------------------------------------------------------------------------------------
65 override bool GetActionNameScript(out string outName)
66 {
67 UIInfo uiInfo = GetUIInfo();
68 if (!uiInfo)
69 return super.GetActionNameScript(outName);
70
71 outName = WidgetManager.Translate(uiInfo.GetName(), m_sItemName);
72
73 return super.GetActionNameScript(outName);
74 }
75}
ESupportStationType
proto external int FindComponents(typename typeName, notnull array< Managed > outComponents)
override bool GetActionNameScript(out string outName)
UIInfo - allows to define UI elements.
Definition UIInfo.c:14
IEntity GetOwner()
Owner entity of the fuel tank.
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute