Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_LoadSessionToolbarAction.c
Go to the documentation of this file.
3 {
4  //---------------------------------------------------------------------------------------------
5  override bool IsServer()
6  {
7  //--- The action opens local UI
8  return false;
9  }
10 
11  //---------------------------------------------------------------------------------------------
12  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
13  {
14  //--- Disallow if editor save struct is not configured
15  SCR_SaveLoadComponent saveLoadComponent = SCR_SaveLoadComponent.GetInstance();
16  if (!saveLoadComponent || !saveLoadComponent.ContainsStruct(SCR_EditorStruct))
17  return false;
18 
19  if (Replication.IsServer())
20  {
21  //--- Loading is always available for the host and in singleplayer
22  return true;
23  }
24  else
25  {
26  //--- Loading is available only if the game is not hosted (the host has exclusive access to that feature, nobody should do it without their knowledge)
28  return gameMode && !gameMode.IsHosted();
29  }
30  }
31 
32  //---------------------------------------------------------------------------------------------
33  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
34  {
35  return CanBeShown(hoveredEntity, selectedEntities, cursorWorldPosition, flags);
36  }
37 
38  //---------------------------------------------------------------------------------------------
39  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
40  {
41  GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.EditorLoadDialog);
42  }
43 };
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
SCR_LoadSessionToolbarAction
Definition: SCR_LoadSessionToolbarAction.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_EditorStruct
Definition: SCR_EditorStruct.c:8
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SCR_EditorToolbarAction
Definition: SCR_EditorToolbarAction.c:3
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition: ChimeraMenuBase.c:3
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