Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_RewindToolbarAction.c
Go to the documentation of this file.
3 {
4  [Attribute(ESaveType.EDITOR.ToString(), UIWidgets.ComboBox, "Save file type.", enums: ParamEnumArray.FromEnum(ESaveType))]
5  protected ESaveType m_eSaveType;
6 
7  [Attribute()]
8  protected string m_sCustomName;
9 
10  [Attribute(desc: "When enabled, the action will delete the rewind point instead of loading it.")]
11  protected bool m_bIsDelete;
12 
13  protected SCR_RewindComponent m_RewindManager;
14  protected SCR_BaseToolbarEditorUIComponent m_Toolbar;
15 
16  protected void OnSaveChanged(ESaveType type, string fileName)
17  {
18  if (m_Toolbar && type == ESaveType.EDITOR)
19  m_Toolbar.MarkForRefresh();
20  }
21 
22  //---------------------------------------------------------------------------------------------
23  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
24  {
25  if (Replication.IsRunning())
26  return false;
27 
28  SCR_RewindComponent rewindManager = SCR_RewindComponent.GetInstance();
29  return rewindManager && rewindManager.HasRewindPoint();
30  }
31 
32  //---------------------------------------------------------------------------------------------
33  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,int flags, int param = -1)
34  {
35  if (m_bIsDelete)
36  {
37  SCR_RewindComponent rewindManager = SCR_RewindComponent.GetInstance();
38  rewindManager.DeleteRewindPoint();
39 
41  if (pauseManager)
42  pauseManager.SetPause(true);
43  }
44  else
45  {
46  new SCR_RewindDialog(m_eSaveType, m_sCustomName);
47  }
48  }
49 
50  //---------------------------------------------------------------------------------------------
51  override void OnInit(SCR_ActionsToolbarEditorUIComponent toolbar)
52  {
53  m_Toolbar = toolbar;
54  GetGame().GetSaveManager().GetOnSaved().Insert(OnSaveChanged);
55  GetGame().GetSaveManager().GetOnDeleted().Insert(OnSaveChanged);
56  }
57 
58  //---------------------------------------------------------------------------------------------
59  override void OnExit(SCR_ActionsToolbarEditorUIComponent toolbar)
60  {
61  GetGame().GetSaveManager().GetOnSaved().Insert(OnSaveChanged);
62  GetGame().GetSaveManager().GetOnDeleted().Insert(OnSaveChanged);
63  }
64 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_sCustomName
protected string m_sCustomName
Definition: SCR_RewindComponent.c:12
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_RewindToolbarAction
Definition: SCR_RewindToolbarAction.c:2
SCR_RewindDialog
Definition: SCR_RewindComponent.c:71
ESaveType
ESaveType
Definition: ESaveType.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_EditorToolbarAction
Definition: SCR_EditorToolbarAction.c:3
SCR_PauseGameTimeEditorComponent
Definition: SCR_PauseGameTimeEditorComponent.c:8
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
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
SCR_BaseToolbarEditorUIComponent
Definition: SCR_BaseToolbarEditorUIComponent.c:5