Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FlushToilet.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
3{
4 [Attribute("", UIWidgets.Auto)]
5 ref SCR_AudioSourceConfiguration m_AudioSourceConfiguration;
6
7 private AudioHandle m_AudioHandle = AudioHandle.Invalid;
8
9 protected static ref ScriptInvokerInt s_onToiletFlushed;
10
11 //------------------------------------------------------------------------------------------------
12 override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
13 {
15 s_onToiletFlushed.Invoke(GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(pUserEntity));
16
17 if (!m_AudioSourceConfiguration || !m_AudioSourceConfiguration.IsValid())
18 return;
19
20 SCR_SoundManagerModule soundManager = SCR_SoundManagerModule.GetInstance(pOwnerEntity.GetWorld());
21 if (!soundManager)
22 return;
23
24 SCR_AudioSource audioSource = soundManager.CreateAudioSource(pOwnerEntity, m_AudioSourceConfiguration);
25 if (!audioSource)
26 return;
27
28 soundManager.PlayAudioSource(audioSource);
29
30 m_AudioHandle = audioSource.m_AudioHandle;
31 }
32
33 //------------------------------------------------------------------------------------------------
41
42 //------------------------------------------------------------------------------------------------
43 override bool GetActionNameScript(out string outName)
44 {
45 outName = "#AR-UserAction_FlushToilet";
46 return true;
47 }
48
49 //------------------------------------------------------------------------------------------------
50 override bool CanBePerformedScript(IEntity user)
51 {
52 return AudioSystem.IsSoundPlayed(m_AudioHandle);
53 }
54
55 //------------------------------------------------------------------------------------------------
57 {
58 AudioSystem.TerminateSoundFadeOut(m_AudioHandle, false, 0);
59 }
60};
ArmaReforgerScripted GetGame()
Definition game.c:1398
void SCR_AudioSource(SCR_AudioSourceConfiguration audioSourceConfiguration, vector mat[4])
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
proto external BaseWorld GetWorld()
override bool GetActionNameScript(out string outName)
static ref ScriptInvokerInt s_onToiletFlushed
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
override bool CanBePerformedScript(IEntity user)
static ScriptInvokerInt GetOnToiletFlushed()
SCR_FieldOfViewSettings Attribute