Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CampaignBuildingDeleteSelectedContextAction.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
4{
5 //------------------------------------------------------------------------------------------------
6 override int GetParam()
7 {
8 return GetGame().GetPlayerController().GetPlayerId();
9 }
10
11 //------------------------------------------------------------------------------------------------
12 override bool CanBeShown(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
13 {
14 if (!selectedEntity)
15 return false;
16
17 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(selectedEntity.GetOwner().FindComponent(SCR_CampaignBuildingCompositionComponent));
18 if (!compositionComponent || compositionComponent.IsInteractionLocked())
19 return false;
20
21 return super.CanBeShown(selectedEntity, cursorWorldPosition, flags);
22 }
23
24 //------------------------------------------------------------------------------------------------
25 override bool CanBePerformed(SCR_EditableEntityComponent selectedEntity, vector cursorWorldPosition, int flags)
26 {
27 if (!selectedEntity || !CanBeDeleted(selectedEntity))
28 return false;
29
30 return super.CanBePerformed(selectedEntity, cursorWorldPosition, flags);
31 }
32
33 //------------------------------------------------------------------------------------------------
34 override void Perform(SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition, int flags, int param = -1)
35 {
36 if (!hoveredEntity || !CanBeDeleted(hoveredEntity))
37 return;
38
39 super.Perform(hoveredEntity, cursorWorldPosition);
40 }
41
42 //------------------------------------------------------------------------------------------------
43 protected bool CanBeDeleted(notnull SCR_EditableEntityComponent hoveredEntity)
44 {
45 SCR_CampaignBuildingCompositionComponent compositionComponent = SCR_CampaignBuildingCompositionComponent.Cast(hoveredEntity.GetOwner().FindComponent(SCR_CampaignBuildingCompositionComponent));
46 if (!compositionComponent)
47 return false;
48
49 if (compositionComponent.IsInteractionLocked())
50 {
52 return false;
53 }
54
55 return true;
56 }
57
58 //------------------------------------------------------------------------------------------------
59 protected void SendNotification()
60 {
61 SCR_NotificationsComponent.SendLocal(ENotification.EDITOR_COMPOSITION_UNDER_CONSTRUCTION);
62 }
63}
SCR_EAIThreatSectorFlags flags
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_ArsenalGameModeUIDataHolder SCR_BaseContainerCustomTitleUIInfo("m_UIInfo")
bool CanBeDeleted(notnull SCR_EditableEntityComponent hoveredEntity)