30 protected const string EXIT_SAVE =
"#AR-PauseMenu_ReturnSaveTitle";
34 protected const string EXIT_TITLE =
"#AR-PauseMenu_ReturnTitle";
42 protected const string LOAD_TITLE =
"#AR-PauseMenu_Load";
73 GetGame().OpenPauseMenu(
false,
true);
79 bool isReplicationRunning =
Replication.IsRunning();
98 GetGame().GetWorkspace().SetFocusedWidget(comp.GetRootWidget());
99 comp.m_OnClicked.Insert(Close);
106 bool enabledRestart = !isReplicationRunning;
107 comp.GetRootWidget().SetVisible(enabledRestart);
108 comp.m_OnClicked.Insert(OnRestart);
115 SCR_RespawnSystemComponent respawnComponent = SCR_RespawnSystemComponent.GetInstance();
116 if (respawnComponent && !respawnComponent.IsPauseMenuRespawnEnabled())
117 comp.SetVisible(
false);
119 comp.m_OnClicked.Insert(ConfirmRespawn);
126 bool factionLeaveAllowed;
134 array<Faction> factions = {};
135 fm.GetFactionsList(factions);
136 int playableFactionCount = 0;
140 if (scriptedFaction && scriptedFaction.
IsPlayable())
141 playableFactionCount++;
144 factionLeaveAllowed = factionLeaveAllowed && (playableFactionCount > 1);
147 comp.GetRootWidget().SetVisible(factionLeaveAllowed);
148 if (factionLeaveAllowed)
150 PlayerController pc =
GetGame().GetPlayerController();
154 comp.SetEnabled(factionComp.GetAffiliatedFaction() != null);
156 comp.m_OnClicked.Insert(OnLeaveFaction)
164 comp.m_OnClicked.Insert(OnExit);
175 SCR_RewindComponent rewindManager = SCR_RewindComponent.GetInstance();
176 comp.GetRootWidget().SetVisible(rewindManager != null);
177 comp.SetEnabled(rewindManager && rewindManager.HasRewindPoint());
178 comp.m_OnClicked.Insert(OnRewind);
186 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
188 if (tutorial && tutorial.CanBreakCourse())
190 comp.SetVisible(
true);
191 comp.m_OnClicked.Insert(OnCourseBreak);
195 comp.SetVisible(
false);
203 comp.m_OnClicked.Insert(OnCamera);
204 comp.SetEnabled(editorManager && !editorManager.IsOpened());
205 comp.GetRootWidget().SetVisible(
Game.
IsDev());
216 comp.m_OnClicked.Insert(OnFieldManual);
223 if (!groupManager || !groupManager.IsGroupMenuAllowed())
224 comp.GetRootWidget().SetVisible(
false);
226 comp.m_OnClicked.Insert(OnGroupMenu);
234 comp.GetRootWidget().SetVisible(isReplicationRunning);
235 comp.m_OnClicked.Insert(OnBlockList);
242 comp.GetRootWidget().SetVisible(isReplicationRunning);
243 comp.m_OnClicked.Insert(OnPlayers);
250 bool canInvite = isReplicationRunning &&
GetGame().GetPlayerManager().IsMultiplayerActivityInviteAvailable();
251 comp.GetRootWidget().SetVisible(canInvite);
279 SetEditorUnlimitedButton(editorManager);
280 SetEditorPhotoButton(editorManager);
291 comp.m_OnClicked.Insert(OnFeedback);
298 if (separatorSecondGroup)
299 separatorSecondGroup.SetVisible(
false);
302 m_InputManager =
GetGame().GetInputManager();
308 SCR_CampaignBuildingEditorComponent CampaignBuildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
309 if (!CampaignBuildingEditorComponent)
313 CampaignBuildingEditorComponent.GetOnObstructionEventTriggered().Insert(
AreaTriggerChange);
315 if (CampaignBuildingEditorComponent.IsViewObstructed())
352 private void OnCourseBreak()
354 SCR_TutorialGamemodeComponent tutorial = SCR_TutorialGamemodeComponent.GetInstance();
368 editorManager.GetOnOpened().Insert(Close);
369 editorManager.GetOnClosed().Insert(Close);
379 editorManager.GetOnOpened().Insert(Close);
380 editorManager.GetOnClosed().Insert(Close);
397 SCR_HUDManagerComponent hud =
GetGame().GetHUDManager();
403 SCR_UISoundEntity.SoundEvent(SCR_SoundEvent.SOUND_FE_HUD_PAUSE_MENU_CLOSE);
410 m_InputManager.RemoveActionListener(UIConstants.MENU_ACTION_OPEN,
EActionTrigger.DOWN, Close);
411 m_InputManager.RemoveActionListener(UIConstants.MENU_ACTION_BACK,
EActionTrigger.DOWN, Close);
413 m_InputManager.RemoveActionListener(UIConstants.MENU_ACTION_OPEN_WB,
EActionTrigger.DOWN, Close);
414 m_InputManager.RemoveActionListener(UIConstants.MENU_ACTION_BACK_WB,
EActionTrigger.DOWN, Close);
422 m_InputManager.AddActionListener(UIConstants.MENU_ACTION_OPEN,
EActionTrigger.DOWN, Close);
423 m_InputManager.AddActionListener(UIConstants.MENU_ACTION_BACK,
EActionTrigger.DOWN, Close);
425 m_InputManager.AddActionListener(UIConstants.MENU_ACTION_OPEN_WB,
EActionTrigger.DOWN, Close);
426 m_InputManager.AddActionListener(UIConstants.MENU_ACTION_BACK_WB,
EActionTrigger.DOWN, Close);
431 void FadeBackground(
bool fade,
bool animate =
true)
439 AnimateWidget.Opacity(
m_wFade, 1, UIConstants.FADE_RATE_FAST,
true);
443 private void OnSettings()
449 private void OnFieldManual()
455 private void OnGroupMenu()
458 if (!groupManager || !groupManager.IsGroupMenuAllowed())
465 private void OnBlockList()
467 SCR_BlockedUsersDialogUI dialog =
new SCR_BlockedUsersDialogUI();
468 SCR_ConfigurableDialogUi.CreateFromPreset(SCR_AccountWidgetComponent.BLOCKED_USER_DIALOG_CONFIG,
"blocked_list", dialog);
472 private void OnExit()
483 private void ConfirmRespawn()
494 RespawnSystemComponent respawn = RespawnSystemComponent.Cast(gameMode.FindComponent(RespawnSystemComponent));
495 canRespawn = (respawn != null &&
CanRespawn());
506 private void OnRewind()
508 new SCR_RewindDialog();
512 private void OnExitConfirm()
516 SaveGameManager manager =
GetGame().GetSaveGameManager();
535 GetGame().GetSaveGameManager().SetSavingAllowed(
false);
553 world.PauseGameTime(
false);
560 private void OnEditorUnlimited()
565 if (!editorManager.IsOpened() || editorManager.GetCurrentModeEntity().IsLimited())
567 editorManager.SetCurrentMode(
false);
568 editorManager.Open();
572 editorManager.Close();
584 if (!editorManager || editorManager.IsLimited())
589 bool isUnlimitedEditorLegal;
590 SCR_EditorSettingsEntity settingsEntity = SCR_EditorSettingsEntity.GetInstance();
606 if (!editorManager.IsOpened() || editorManager.GetCurrentModeEntity().IsLimited())
630 SetEditorUnlimitedButton(editorManager);
631 SetEditorPhotoButton(editorManager);
635 private void OnEditorPhoto()
640 if (!editorManager.IsOpened() || editorManager.GetCurrentMode() !=
EEditorMode.PHOTO)
643 editorManager.Open();
647 editorManager.Close();
658 if (Replication.IsRunning())
666 if (!editorManager || !editorManager.HasMode(
EEditorMode.PHOTO))
674 if (!editorManager.IsOpened() || editorManager.GetCurrentMode() !=
EEditorMode.PHOTO)
694 void DisableSettings()
701 void DisableGameMaster()
708 void DisableArmaVision()
717 SCR_FeedbackDialogUI.OpenFeedbackDialog();
721 private void OnRestart()
724 SCR_ConfigurableDialogUi dialog = SCR_CommonDialogs.CreateDialog(SCR_ScenarioUICommon.DIALOG_RESTART);
732 private void OnRestartConfirm()
734 GetGame().GetMenuManager().CloseAllMenus();
735 GameStateTransitions.RequestScenarioRestart();
739 private void OnPlayers()
741 ArmaReforgerScripted.OpenPlayerList();
747 GetGame().GetPlayerManager().ShowMultiplayerActivityInvite();
755 PlayerController pc =
GetGame().GetPlayerController();
759 IEntity player = pc.GetControlledEntity();
763 SCR_ChimeraCharacter
char = SCR_ChimeraCharacter.Cast(player);
767 CharacterControllerComponent charController =
char.GetCharacterController();
782 PlayerController playerController =
GetGame().GetPlayerController();
783 if (!playerController)
790 respawn.RequestPlayerSuicide();
795 private void OnLeaveFaction()
797 PlayerController pc =
GetGame().GetPlayerController();
801 SCR_PlayerFactionAffiliationComponent factionComp = SCR_PlayerFactionAffiliationComponent.Cast(pc.FindComponent(SCR_PlayerFactionAffiliationComponent));
810 rc.RequestPlayerSuicide();
816 private void OnCamera()
818 SCR_DebugCameraCore cameraCore = SCR_DebugCameraCore.Cast(SCR_DebugCameraCore.GetInstance(SCR_DebugCameraCore));
820 cameraCore.ToggleCamera();
825 override void HandlerDeattached(Widget w)
827 super.HandlerDeattached(w);
845 if (!
GetGame().GetSaveGameManager().IsSavingAllowed())