Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_NoGameMasterStickyNotificationUIComponent.c
Go to the documentation of this file.
2 {
3  protected SCR_PlayerDelegateEditorComponent m_DelegateManager;
4 
5  //------------------------------------------------------------------------------------------------
6  protected void CheckShowNotification(bool isInit = false)
7  {
8  //Check if there is at least one GM. If not, set the sticky active else hide the sticky
9  SetStickyActive(!m_DelegateManager.HasPlayerWithUnlimitedEditor(), !isInit);
10  }
11 
12  //------------------------------------------------------------------------------------------------
13  protected void OnLimitedEditorChanged()
14  {
15  CheckShowNotification();
16  }
17 
18  //------------------------------------------------------------------------------------------------
19  protected override void OnButton()
20  {
21  MenuManager menuManager = GetGame().GetMenuManager();
22 
23  if (menuManager)
24  menuManager.OpenDialog(ChimeraMenuPreset.PlayerListMenu);
25  }
26 
27  //------------------------------------------------------------------------------------------------
28  override void OnInit(SCR_NotificationsLogComponent notificationLog)
29  {
30  super.OnInit(notificationLog);
31 
32  //Never show if everybody is GM or nobody is GM.
34  if (gameMode && gameMode.GetGameMasterTarget() == EGameModeEditorTarget.VOTE)
35  {
37  if (m_DelegateManager)
38  {
39  m_DelegateManager.GetOnLimitedEditorChanged().Insert(OnLimitedEditorChanged);
40  CheckShowNotification(true);
41  return;
42  }
43  }
44 
45  SetVisible(false);
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  protected override void OnDestroy()
50  {
51  if (m_DelegateManager)
52  m_DelegateManager.GetOnLimitedEditorChanged().Remove(OnLimitedEditorChanged);
53  }
54 }
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_NotificationsLogComponent
Definition: SCR_NotificationsLogUIComponent.c:6
SCR_PlayerDelegateEditorComponent
Definition: SCR_PlayerDelegateEditorComponent.c:9
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SetVisible
void SetVisible(int layer)
Definition: SCR_ServicePointMapDescriptorComponent.c:95
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition: ChimeraMenuBase.c:3
EGameModeEditorTarget
EGameModeEditorTarget
Definition: SCR_GameModeEditor.c:150
SCR_StickyNotificationUIComponent
Definition: SCR_StickyNotificationUIComponent.c:1
SCR_NoGameMasterStickyNotificationUIComponent
Definition: SCR_NoGameMasterStickyNotificationUIComponent.c:1
SCR_GameModeEditor
Definition: SCR_GameModeEditor.c:7