Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HUDManagerEditorVisibilityHandler.c
Go to the documentation of this file.
3 {
4  [Attribute(desc: "Which HUD Layout should be opened when a player exits Editor.")]
5  protected string m_sExitingEditorLayout;
6  [Attribute(desc: "Which HUD Layout should be opened when a player enters Editor.")]
7  protected string m_sEnteringEditorLayout;
8 
9  protected bool m_bIsEditorOpen;
10 
11  //------------------------------------------------------------------------------------------------
12  protected void OnEditorExit()
13  {
14  m_bIsEditorOpen = false;
15 
17  if (layoutHandler)
18  layoutHandler.ChangeActiveHUDLayout(m_sExitingEditorLayout);
19  }
20 
21  //------------------------------------------------------------------------------------------------
22  protected void OnEditorEnter()
23  {
24  m_bIsEditorOpen = true;
25 
27  if (layoutHandler)
28  layoutHandler.ChangeActiveHUDLayout(m_sEnteringEditorLayout);
29  }
30 
31  //------------------------------------------------------------------------------------------------
32  protected void OnCharacterPossesed(IEntity entity)
33  {
34  if (!m_bIsEditorOpen)
35  return;
36 
38  if (layoutHandler)
39  layoutHandler.ChangeActiveHUDLayout(m_sExitingEditorLayout);
40  }
41 
42  //------------------------------------------------------------------------------------------------
43  override void OnUpdate(notnull SCR_HUDManagerComponent owner)
44  {
45  RegisterEvents();
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  void RegisterEvents()
50  {
52  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
53 
54  if (!pc || !editorManager || m_HUDManager.GetInfoDisplayCount() == 0)
55  return;
56 
57  pc.m_OnBeforePossess.Insert(OnCharacterPossesed);
58  editorManager.GetOnOpened().Insert(OnEditorEnter);
59  editorManager.GetOnClosed().Insert(OnEditorExit);
60 
61  m_HUDManager.RemoveHandlerFromUpdatableHandlers(this);
62 
63  if (editorManager.IsOpened())
64  OnEditorEnter();
65  }
66 }
SCR_HUDManagerComponent
Definition: SCR_HUDManagerComponent.c:23
SCR_HUDManagerHandler
Definition: SCR_HUDManagerHandler.c:2
SCR_PlayerController
Definition: SCR_PlayerController.c:31
SCR_HUDManagerEditorVisibilityHandler
Definition: SCR_HUDManagerEditorVisibilityHandler.c:2
m_HUDManager
protected SCR_HUDManagerComponent m_HUDManager
Definition: game.c:41
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_HUDManagerLayoutHandler
Definition: SCR_HUDManagerLayoutHandler.c:7
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
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26