Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SaveSessionToolbarAction.c
Go to the documentation of this file.
3 {
4  [Attribute(desc: "When enabled, the operation will always bring up a save dialog.")]
5  protected bool m_bSaveAs;
6 
7  [Attribute(ESaveType.USER.ToString(), UIWidgets.ComboBox, "Save file type.", enums: ParamEnumArray.FromEnum(ESaveType))]
8  protected ESaveType m_eSaveType;
9 
10  //---------------------------------------------------------------------------------------------
11  override bool IsServer()
12  {
13  //--- The action opens local UI
14  return false;
15  }
16 
17  //---------------------------------------------------------------------------------------------
18  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
19  {
20  //--- Disallow on client, or in MP for "Save" version ("Save As" is allowed in MP)
21  if (!Replication.IsServer() || (!m_bSaveAs && Replication.IsRunning()))
22  return false;
23 
24  //--- Disallow if editor save struct is not configured
25  SCR_SaveLoadComponent saveLoadComponent = SCR_SaveLoadComponent.GetInstance();
26  return saveLoadComponent && saveLoadComponent.ContainsStruct(SCR_EditorStruct);
27  }
28 
29  //---------------------------------------------------------------------------------------------
30  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
31  {
32  return CanBeShown(hoveredEntity, selectedEntities, cursorWorldPosition, flags);
33  }
34 
35  //---------------------------------------------------------------------------------------------
36  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
37  {
38  if (m_bSaveAs || !GetGame().GetSaveManager().OverrideCurrentSave(m_eSaveType))
39  GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.EditorSaveDialog);
40  }
41 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_EditorStruct
Definition: SCR_EditorStruct.c:8
SCR_SaveSessionToolbarAction
Definition: SCR_SaveSessionToolbarAction.c:2
ESaveType
ESaveType
Definition: ESaveType.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
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
GetSaveManager
SCR_SaveManagerCore GetSaveManager()
Definition: game.c:211
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