Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_EndGameToolbarAction.c
Go to the documentation of this file.
3 {
4  override bool IsServer()
5  {
6  return false;
7  }
8 
9  override bool CanBeShown(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
10  {
11  if (!Replication.IsRunning())
12  return false;
13 
14  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
15  if (!editorManager)
16  return false;
17 
18  SCR_RespawnComponent respawnComponent = SCR_RespawnComponent.GetInstance();
19  if (!respawnComponent)
20  return false;
21 
23 
24  if (gameMode.GetState() != SCR_EGameModeState.GAME)
25  return false;
26 
27  return !editorManager.IsLimited();
28  }
29  override bool CanBePerformed(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags)
30  {
31  if (!Replication.IsRunning())
32  return false;
33 
35  if (gameMode.GetState() != SCR_EGameModeState.GAME)
36  return false;
37 
38  return true;
39  }
40  override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags, int param = -1)
41  {
43  int PlayerID = -1;
44 
45  if (playerController)
46  PlayerID = playerController.GetPlayerId();
47 
48  SCR_EditorManagerEntity editorManager = SCR_EditorManagerEntity.GetInstance();
49  if (!editorManager)
50  return;
51 
52  if (editorManager.IsLimited())
53  return;
54 
55  SCR_RespawnComponent respawnComponent = SCR_RespawnComponent.GetInstance();
56  if (!respawnComponent)
57  return;
58 
59  SCR_AttributesManagerEditorComponent attributeManager = SCR_AttributesManagerEditorComponent.Cast(SCR_AttributesManagerEditorComponent.GetInstance(SCR_AttributesManagerEditorComponent));
60  if (!attributeManager)
61  return;
62 
64  if (gameMode.GetState() != SCR_EGameModeState.GAME)
65  return;
66 
67  attributeManager.StartEditing(respawnComponent);
68  }
69 };
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
SCR_RespawnComponent
void SCR_RespawnComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_RespawnComponent.c:576
SCR_PlayerController
Definition: SCR_PlayerController.c:31
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
SCR_EditorToolbarAction
Definition: SCR_EditorToolbarAction.c:3
SCR_EndGameToolbarAction
Definition: SCR_EndGameToolbarAction.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_BaseContainerCustomTitleUIInfo
void SCR_BaseContainerCustomTitleUIInfo(string propertyName, string format="%1")
Definition: Attributes.c:788
SCR_EGameModeState
SCR_EGameModeState
Definition: SCR_EGameModeState.c:4
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_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26