Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SkipCinematicTrack.c
Go to the documentation of this file.
1[CinematicTrackAttribute(name:"Skip Track", description:"Track used for skipping cinematic by pressing button")]
3{
4
5 [Attribute("false")]
6 bool m_bCanSkip;
7
8 [Attribute("true")]
9 bool m_bCutsceneContext;
10
12 protected bool m_bHintCreated;
14
15 protected ResourceName m_sSkipHintLayout = "{3761599052EEA9B2}UI/layouts/HUD/SkipCinematicScene/SkipCinematiSceneWidget.layout";
16
17 private ChimeraWorld globalWorld;
18 private CinematicEntity cineToSkip;
19
20 void Skip()
21 {
22 if (!m_bCanSkip)
23 return;
24
25 cineToSkip = CinematicEntity.Cast(globalWorld.FindEntityByName(GetSceneName()));
26 if (cineToSkip)
27 {
28 cineToSkip.Stop();
30 }
31
32 AudioSystem.SetMasterVolume(AudioSystem.SFX, 1);
33 AudioSystem.SetMasterVolume(AudioSystem.Dialog, 1);
34 }
35
36 override void OnFinish()
37 {
39 }
40
41 override void OnInit(World world)
42 {
43 globalWorld = world;
44
45 GetGame().GetInputManager().AddActionListener("SkipScene", EActionTrigger.DOWN, Skip);
46 }
47
48 override void OnApply(float time)
49 {
50 if (m_bCutsceneContext)
51 GetGame().GetInputManager().ActivateContext("CutsceneContext");
52 if (m_bCanSkip && !m_bHintCreated)
53 {
54 CreateSkipHint();
55 FadeIn(m_wSkipHint);
56 }
57
58 if (!m_bCanSkip)
60 }
61
62 void CreateSkipHint()
63 {
64 GetGame().GetWorkspace().CreateWidgets(m_sSkipHintLayout);
65 m_wSkipHint = FrameWidget.Cast(GetGame().GetWorkspace().FindAnyWidget("SkipCinematicScene"));
66 m_bHintCreated = true;
67 }
68
69 void FadeIn(Widget w)
70 {
71 m_SkipHintComponent = SCR_FadeUIComponent.Cast(w.FindHandler(SCR_FadeUIComponent));
72 m_SkipHintComponent.FadeIn(true);
73 }
74
75 void FadeOut(Widget w)
76 {
77 if (!m_wSkipHint)
78 return;
79
80 m_SkipHintComponent = SCR_FadeUIComponent.Cast(w.FindHandler(SCR_FadeUIComponent));
82 return;
83
84 m_SkipHintComponent.FadeOut(true);
85 }
86}
ArmaReforgerScripted GetGame()
Definition game.c:1398
void FadeOut()
ResourceName m_sSkipHintLayout
SCR_FadeUIComponent m_SkipHintComponent
SCR_FieldOfViewSettings Attribute
EActionTrigger