Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PauseGameTimeToolbarAction.c
Go to the documentation of this file.
3 {
4  protected bool m_bIsGameTimePaused;
5  protected ChimeraWorld m_World;
6 
7  //---------------------------------------------------------------------------------------------
8  //--- ToDo: Use event?
9  protected void UpdateGameTimePause()
10  {
11  if (m_bIsGameTimePaused != m_World.IsGameTimePaused())
12  {
13  m_bIsGameTimePaused = m_World.IsGameTimePaused();
14 
15  Toggle(!m_bIsGameTimePaused, !m_bIsGameTimePaused);
16  }
17  }
18 
19  //---------------------------------------------------------------------------------------------
20  override bool IsServer()
21  {
22  return false;
23  }
24 
25  //---------------------------------------------------------------------------------------------
26  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
27  {
28  return !Replication.IsRunning();
29  }
30 
31  //---------------------------------------------------------------------------------------------
32  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
33  {
34  return !Replication.IsRunning();
35  }
36 
37  //---------------------------------------------------------------------------------------------
38  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
39  {
41  if (pauseManager)
42  pauseManager.TogglePause();
43  else
44  m_World.PauseGameTime(!m_World.IsGameTimePaused());
45  }
46 
47  //---------------------------------------------------------------------------------------------
48  override void Track()
49  {
50  m_World = GetGame().GetWorld();
51  m_bIsGameTimePaused = m_World.IsGameTimePaused();
52  GetGame().GetCallqueue().CallLater(UpdateGameTimePause, 1, true);
53 
54  Toggle(!m_bIsGameTimePaused, !m_bIsGameTimePaused);
55  }
56 
57  //---------------------------------------------------------------------------------------------
58  override void Untrack()
59  {
60  GetGame().GetCallqueue().Remove(UpdateGameTimePause);
61  }
62 };
ChimeraWorld
Definition: ChimeraWorld.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Toggle
void Toggle()
Toggle hint. Hide it if it's shown, and open it again if it's hidden.
Definition: SCR_HintManagerComponent.c:216
SCR_BaseToggleToolbarAction
Definition: SCR_BaseToggleToolbarAction.c:3
SCR_PauseGameTimeEditorComponent
Definition: SCR_PauseGameTimeEditorComponent.c:8
m_World
protected BaseWorld m_World
Definition: SCR_PreviewEntityEditorUIComponent.c:46
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_PauseGameTimeToolbarAction
Definition: SCR_PauseGameTimeToolbarAction.c:2
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468