Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LightSlot.c
Go to the documentation of this file.
2{
3 [Attribute(defvalue: "", uiwidget: UIWidgets.EditBox, desc: "Name of the sound event that should be called when the lights are activated.", category: "Sounds")]
4 protected string m_sLightOnEventName;
5
6 [Attribute(defvalue: "", uiwidget: UIWidgets.EditBox, desc: "Name of the sound event that should be called when the lights are deactivated.", category: "Sounds")]
7 protected string m_sLightOffEventName;
8
9 protected bool m_bIsActive;
11
12 protected ref ScriptInvoker m_OnLightStateChanged; // TODO: ScriptInvokerBool
13
14 //------------------------------------------------------------------------------------------------
24
25 //------------------------------------------------------------------------------------------------
26 override void OnLightStateChanged(bool newState)
27 {
28 if (m_bIsActive == newState)
29 return;
30
31 m_bIsActive = newState;
33 m_OnLightStateChanged.Invoke(newState);
34 }
35
36 //------------------------------------------------------------------------------------------------
37 override void OnInit(IEntity owner)
38 {
39 super.OnInit(owner);
41
44 }
45
46 //------------------------------------------------------------------------------------------------
48 void PlaySound(bool newState)
49 {
50 string eventName;
51
52 if (newState)
53 eventName = m_sLightOnEventName;
54 else
55 eventName = m_sLightOffEventName;
56
57 if (m_SoundComponent && !eventName.IsEmpty())
58 m_SoundComponent.SoundEvent(eventName);
59 }
60};
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
ScriptInvoker GetOnLightStateChanged()
override void OnLightStateChanged(bool newState)
string m_sLightOffEventName
override void OnInit(IEntity owner)
void PlaySound(bool newState)
string m_sLightOnEventName
ref ScriptInvoker m_OnLightStateChanged
SoundComponent m_SoundComponent
SCR_FieldOfViewSettings Attribute
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134