Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PreGameGameModeStateComponent.c
Go to the documentation of this file.
1 [ComponentEditorProps(category: "GameScripted/GameMode/Components", description: "Game Mode component responsible for adding a 'pre-game' period to the game mode.")]
3 {
4 }
5 
7 class SCR_PreGameGameModeStateComponent : SCR_BaseGameModeStateComponent
8 {
9  [Attribute("30", uiwidget: UIWidgets.Slider, "Duration of this state in seconds or 0 for infinite duration. (Requires manual start)", params: "0 864000 1", category: "Game Mode")]
10  protected float m_fDuration;
11 
12  [Attribute("1", uiwidget: UIWidgets.CheckBox, "Disables player controls in this state if checked.", category: "Game Mode")]
13  protected bool m_bDisableControls;
14 
15  //------------------------------------------------------------------------------------------------
17  override float GetDuration()
18  {
19  return m_fDuration;
20  }
21 
22  //------------------------------------------------------------------------------------------------
25  override bool CanAdvanceState(SCR_EGameModeState nextState)
26  {
27  return m_fDuration > 0.0 && m_pGameMode.GetElapsedTime() >= m_fDuration;
28  }
29 
30  //------------------------------------------------------------------------------------------------
32  override bool GetAllowControls()
33  {
34  return !m_bDisableControls;
35  }
36 
37  //------------------------------------------------------------------------------------------------
40  {
41  return SCR_EGameModeState.PREGAME;
42  }
43 }
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
m_bDisableControls
protected bool m_bDisableControls
Definition: SCR_PreGameGameModeStateComponent.c:13
GetDuration
override float GetDuration()
Definition: SCR_PreGameGameModeStateComponent.c:17
m_fDuration
float m_fDuration
Definition: SendGoalMessage.c:437
Attribute
SCR_PreGameGameModeStateComponentClass SCR_BaseGameModeStateComponentClass Attribute("30", uiwidget:UIWidgets.Slider, "Duration of this state in seconds or 0 for infinite duration. (Requires manual start)", params:"0 864000 1", category:"Game Mode")] protected float m_fDuration
Game mode component that handles the pre-game period.
GetAffiliatedState
sealed override SCR_EGameModeState GetAffiliatedState()
Called on the authority when created to assign state this component belongs to.
Definition: SCR_PreGameGameModeStateComponent.c:39
GetAllowControls
override bool GetAllowControls()
Definition: SCR_PreGameGameModeStateComponent.c:32
SCR_BaseGameModeStateComponentClass
Definition: SCR_BaseGameModeStateComponent.c:2
CanAdvanceState
override bool CanAdvanceState(SCR_EGameModeState nextState)
Definition: SCR_PreGameGameModeStateComponent.c:25
m_pGameMode
SCR_BaseGameModeComponentClass m_pGameMode
The game mode entity this component is attached to.
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_PreGameGameModeStateComponentClass
Definition: SCR_PreGameGameModeStateComponent.c:2
SCR_EGameModeState
SCR_EGameModeState
Definition: SCR_EGameModeState.c:4
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180