Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PauseGameTimeToolbarAction.c
Go to the documentation of this file.
3{
6
7 //---------------------------------------------------------------------------------------------
8 override bool IsServer()
9 {
10 return false;
11 }
12
13 //---------------------------------------------------------------------------------------------
14 override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
15 {
16 if (!m_GameMode)
18
19 if (!m_GameMode)
20 return false;
21
22 return m_GameMode.CanBePaused();
23 }
24
25 //---------------------------------------------------------------------------------------------
26 override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
27 {
28 if (!m_GameMode)
30
31 if (!m_GameMode)
32 return false;
33
34 return m_GameMode.CanBePaused();
35 }
36
37 //---------------------------------------------------------------------------------------------
38 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
39 {
40 SCR_PauseGameTimeEditorComponent pauseManager = SCR_PauseGameTimeEditorComponent.Cast(SCR_PauseGameTimeEditorComponent.GetInstance(SCR_PauseGameTimeEditorComponent));
41 if (pauseManager)
42 pauseManager.TogglePause();
43 else
44 m_GameMode.PauseGame(!m_World.IsGameTimePaused(), SCR_EPauseReason.EDITOR | SCR_EPauseReason.MUSIC);
45 }
46
47 //---------------------------------------------------------------------------------------------
48 override void Track()
49 {
50 m_World = GetGame().GetWorld();
53 GetGame().GetCallqueue().CallLater(UpdateGameTimePause, 1, true);
54 }
55
56 //---------------------------------------------------------------------------------------------
57 override void Untrack()
58 {
59 GetGame().GetCallqueue().Remove(UpdateGameTimePause);
60 }
61
62 //---------------------------------------------------------------------------------------------
63 protected void UpdateGameTimePause()
64 {
65 const bool isPaused = m_World.IsGameTimePaused();
66 Toggle(isPaused, isPaused);
67 }
68}
SCR_EAIThreatSectorFlags flags
SCR_EPauseReason
Definition EPauseReason.c:2
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
SCR_BaseGameMode GetGameMode()
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags, int param=-1)
override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)
override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set< SCR_EditableEntityComponent > selectedEntities, vector cursorWorldPosition, int flags)