Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBuildingEditorComponent.c
Go to the documentation of this file.
1 // Attached on EditorModeBuilding prefab
2 [ComponentEditorProps(category: "GameScripted/Editor", description: "Main conflict component for handling building editor mode", icon: "WBData/ComponentEditorProps/componentEditor.png")]
4 {
5 }
6 
7 //------------------------------------------------------------------------------------------------
8 
9 class SCR_CampaignBuildingEditorComponent : SCR_BaseEditorComponent
10 {
11  protected ref array<SCR_CampaignBuildingProviderComponent> m_aProvidersComponents = {};
12  protected ref array<RplId> m_aProvidersRplIds = {};
14  protected SCR_CampaignBuildingProviderComponent m_ForcedProviderComponent;
15  protected bool m_bViewObstructed;
16 
17  protected ref ScriptInvoker m_OnProviderChanged;
19 
20  //------------------------------------------------------------------------------------------------
21  ScriptInvoker GetOnProviderChanged()
22  {
24  m_OnProviderChanged = new ScriptInvoker();
25 
26  return m_OnProviderChanged;
27  }
28 
29  //------------------------------------------------------------------------------------------------
31  {
34 
36  }
37 
38  //------------------------------------------------------------------------------------------------
39  void AddProviderEntityEditorComponent(SCR_CampaignBuildingProviderComponent providerComponent)
40  {
41  if (!providerComponent || m_aProvidersComponents.Contains(providerComponent))
42  return;
43 
44  SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
45  if (base)
46  m_aProvidersComponents.InsertAt(providerComponent, 0);
47  else
48  m_aProvidersComponents.Insert(providerComponent);
49 
51  }
52 
53  //------------------------------------------------------------------------------------------------
54  void RemoveProviderEntityEditorComponent(SCR_CampaignBuildingProviderComponent providerComponent)
55  {
56  if (m_ForcedProviderComponent == providerComponent)
57  SetForcedProvider(null);
58 
59  m_aProvidersComponents.RemoveItemOrdered(providerComponent);
60 
61  if (!m_aProvidersComponents.IsEmpty())
63  }
64 
65  //------------------------------------------------------------------------------------------------
67  SCR_CampaignBuildingProviderComponent GetProviderComponent(bool getMasterProviderComponent = false)
68  {
69  SCR_CampaignBuildingProviderComponent temporaryProviderComponent;
71  temporaryProviderComponent = m_ForcedProviderComponent;
72 
73  if (m_aProvidersComponents.IsEmpty())
74  return null;
75 
76  temporaryProviderComponent = m_aProvidersComponents[0];
77 
78  if (getMasterProviderComponent && temporaryProviderComponent && temporaryProviderComponent.UseMasterProvider())
79  return SCR_CampaignBuildingProviderComponent.Cast(GetMasterProviderEntity().FindComponent(SCR_CampaignBuildingProviderComponent));
80 
81  return temporaryProviderComponent;
82  }
83 
84  //------------------------------------------------------------------------------------------------
86  void SetForcedProvider(SCR_CampaignBuildingProviderComponent forcedProviderComponent = null)
87  {
88  m_ForcedProviderComponent = forcedProviderComponent;
89  }
90 
91  //------------------------------------------------------------------------------------------------
93  {
94  return m_aProvidersComponents.Count();
95  }
96 
97  //------------------------------------------------------------------------------------------------
98  bool IsActiveProvider(notnull SCR_CampaignBuildingProviderComponent providerComponent)
99  {
100  if (providerComponent == m_ForcedProviderComponent)
101  return true;
102 
103  // there exist a forced provider and it's not a tested entity, then it can't be an active provider. ToDo: Zamyslet se a zeptat
105  return false;
106 
107  if (!m_aProvidersComponents.IsEmpty() && m_aProvidersComponents[0] == providerComponent)
108  return true;
109 
110  return false;
111  }
112 
113  //------------------------------------------------------------------------------------------------
114  bool GetProviderResourceComponent(out SCR_ResourceComponent resourceComponent)
115  {
116  if (m_aProvidersComponents.IsEmpty())
117  return false;
118 
119  resourceComponent = SCR_ResourceComponent.FindResourceComponent(GetProviderEntity());
120 
121  if (resourceComponent)
122  return true;
123 
124  IEntity parent = GetProviderEntity();
125 
126  while (parent)
127  {
128  resourceComponent = SCR_ResourceComponent.FindResourceComponent(parent);
129 
130  if (resourceComponent)
131  return true;
132 
133  parent = parent.GetParent();
134  }
135 
136  return false;
137  }
138 
139  //------------------------------------------------------------------------------------------------
142  {
143  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
144  if (!providerComponent)
145  return -1;
146 
147  return providerComponent.GetShownBudget();
148  }
149 
150  //------------------------------------------------------------------------------------------------
151  [Obsolete("SCR_CampaignBuildingEditorComponent.GetProviderResourceComponent() should be used instead.")]
153  {
154  if (m_aProvidersComponents.IsEmpty())
155  return false;
156 
157  suppliesComponent = SCR_CampaignSuppliesComponent.Cast(GetProviderEntity().FindComponent(SCR_CampaignSuppliesComponent));
158  if (suppliesComponent)
159  return true;
160 
161  IEntity parent = GetProviderEntity();
162  while (parent)
163  {
164  suppliesComponent = SCR_CampaignSuppliesComponent.Cast(parent.FindComponent(SCR_CampaignSuppliesComponent));
165  if (suppliesComponent)
166  return true;
167 
168  parent = parent.GetParent();
169  }
170  return false;
171  }
172 
173  //------------------------------------------------------------------------------------------------
175  {
176  if (m_aProvidersComponents.IsEmpty())
177  return null;
178 
180  if (factionComp)
181  return factionComp;
182 
183  IEntity parent = GetProviderEntity();
184  while (parent)
185  {
186  factionComp = SCR_FactionAffiliationComponent.Cast(parent.FindComponent(SCR_FactionAffiliationComponent));
187  if (factionComp)
188  return factionComp;
189 
190  parent = parent.GetParent();
191  }
192 
193  return null;
194  }
195 
196  //------------------------------------------------------------------------------------------------
198  {
199  if (m_aProvidersComponents.IsEmpty())
200  return null;
201 
202  //ToDo: Is it still needed?
203  // clear possible null, better solution - some invoker when the value in array change to null?
204  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
205  if (!providerComponent)
206  {
207  RemoveProviderEntityEditorComponent(providerComponent);
208  return null;
209  }
210 
211  IEntity child = GetProviderEntity(providerComponent.UseMasterProvider()).GetChildren();
212  while (child)
213  {
215  if (trg)
216  return trg;
217 
218  child = child.GetSibling();
219  }
220 
221  return null;
222  }
223 
224  //------------------------------------------------------------------------------------------------
225  //~ This function will add/remove the faction label of the saved editor state. Thus displaying the correct faction entities in the menu
226  protected void AddRemoveFactionLabel(SCR_Faction faction, bool addLabel)
227  {
228  if (!faction)
229  return;
230 
231  m_ContentBrowserManager.AddRemoveLabelOfPersistentBrowserState(faction.GetFactionLabel(), addLabel);
232  }
233 
234  //------------------------------------------------------------------------------------------------
235  ScriptedGameTriggerEntity SpawnClientTrigger()
236  {
237  BaseGameMode gameMode = GetGame().GetGameMode();
238 
239  SCR_CampaignBuildingManagerComponent buildingManagerComponent = SCR_CampaignBuildingManagerComponent.Cast(gameMode.FindComponent(SCR_CampaignBuildingManagerComponent));
240  if (!buildingManagerComponent)
241  return null;
242 
243  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
244  if (!providerComponent)
245  return null;
246 
247  IEntity provider = GetProviderEntity(providerComponent.UseMasterProvider());
248  if (!provider)
249  return null;
250 
251  Resource resource = Resource.Load(buildingManagerComponent.GetClientTriggerResourceName());
252  if (!resource || !resource.IsValid())
253  return null;
254 
255  EntitySpawnParams params = new EntitySpawnParams();
256  params.TransformMode = ETransformMode.WORLD;
257  params.Parent = provider;
258 
259  return ScriptedGameTriggerEntity.Cast(GetGame().SpawnEntityPrefab(resource, provider.GetWorld(), params));
260  }
261 
262  //------------------------------------------------------------------------------------------------
264  override protected void EOnEditorActivate()
265  {
266  SCR_CampaignBuildingProviderComponent providerComponenet = GetProviderComponent(true);
267  if (!providerComponenet)
268  return;
269 
270  if (!System.IsConsoleApp() && GetGame().GetPlayerController())
271  {
272  ScriptedGameTriggerEntity trigger = SpawnClientTrigger();
273 
274  if (trigger)
275  {
276  trigger.SetSphereRadius(providerComponenet.GetBuildingRadius());
277 
278  SCR_CampaignBuildingAreaMeshComponent areaMeshComponent = SCR_CampaignBuildingAreaMeshComponent.Cast(trigger.FindComponent(SCR_CampaignBuildingAreaMeshComponent));
279  if (areaMeshComponent && areaMeshComponent.ShouldEnableFrameUpdateDuringEditor())
280  {
281  areaMeshComponent.ActivateEveryFrame();
282  areaMeshComponent.GenerateAreaMesh();
283  }
284 
285  trigger.SetFlags(EntityFlags.VISIBLE, false);
286  }
287  }
288 
289  if (providerComponenet.ObstrucViewWhenEnemyInRange())
290  SetOnEnterEvent();
291 
293 
294  FactionAffiliationComponent factionComponent = GetProviderFactionComponent();
295  if (factionComponent)
296  {
297  // here we have to check both Affiliated faction and Default affiliated faction in case of vehicles. It's because vehicles can't have set a affiliated faction if no one is sitting inside (to prevent AI to shoot at empty vehicles)
298  Faction buildingFaction = factionComponent.GetAffiliatedFaction();
299 
300  if (!buildingFaction)
301  buildingFaction = factionComponent.GetDefaultAffiliatedFaction();
302 
303  if (buildingFaction)
304  AddRemoveFactionLabel(SCR_Faction.Cast(buildingFaction), true);
305  }
306 
307  array<SCR_EditorContentBrowserSaveStateDataUI> contentBrowserStates = {};
308  int tabsCount = m_ContentBrowserManager.GetContentBrowserTabStates(contentBrowserStates);
309 
310  for (int i = 0; i < tabsCount; i++)
311  {
312  if (!contentBrowserStates[i])
313  continue;
314 
315  //~ Todo: Fix first tab being broken
316  //~ Hotfix for first tab being broken
317  if (i == 0 || !CanBeShown(contentBrowserStates[i]))
318  m_ContentBrowserManager.SetStateTabVisible(i, false);
319  }
320 
321  ToggleBuildingTool(false);
322  }
323 
324  //------------------------------------------------------------------------------------------------
327  {
328  if (!TabContainLabel(tab))
329  return false;
330 
331  return tab.CanBeShown();
332  }
333 
334  //------------------------------------------------------------------------------------------------
337  {
338  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
339  if (!providerComponent)
340  return false;
341 
342  array<EEditableEntityLabel> labels = providerComponent.GetAvailableTraits();
343 
344  foreach (EEditableEntityLabel label : labels)
345  {
346  if (tab.ContainsLabel(label))
347  return true;
348  }
349 
350  return false;
351  }
352 
353  //------------------------------------------------------------------------------------------------
356  {
357  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
358  if (!providerComponent)
359  return false;
360 
361  return providerComponent.GetMilitaryBaseComponent();
362  }
363 
364  //------------------------------------------------------------------------------------------------
365  void ToggleBuildingTool(bool mode)
366  {
367  IEntity player = EntityUtils.GetPlayer();
368  if (!player)
369  return;
370 
371  SCR_GadgetManagerComponent gadgetManager = SCR_GadgetManagerComponent.GetGadgetManager(player);
372  if (!gadgetManager)
373  return;
374 
375  SCR_CampaignBuildingGadgetToolComponent gadgetComponent = SCR_CampaignBuildingGadgetToolComponent.Cast(gadgetManager.GetHeldGadgetComponent());
376  if (!gadgetComponent)
377  return;
378 
379  if (mode)
380  gadgetComponent.ToolToHand();
381  else
382  gadgetComponent.ToolToInventory();
383  }
384 
385  //------------------------------------------------------------------------------------------------
387  protected void SetOnEnterEvent()
388  {
390  if (!trigger)
391  return;
392 
393  trigger.GetOnEntityEnterTrigger().Insert(EntityEnterTrigger);
394  trigger.GetOnEntityLeaveTrigger().Insert(EntityLeaveTrigger);
395  }
396 
397  //------------------------------------------------------------------------------------------------
398  protected void EntityEnterTrigger(IEntity ent)
399  {
400  if (CanBlockView(ent))
401  {
402  SetOnEntityKilled(ent);
403 
404  // show the notification and rise an event only when this is for the first time.
406  {
407  m_OnObstructionEventTriggered.Invoke(true);
408  SCR_NotificationsComponent.SendLocal(ENotification.EDITOR_ENEMY_IN_AREA);
409  m_bViewObstructed = true;
410  }
411  }
412  }
413 
414  //------------------------------------------------------------------------------------------------
415  // Called when entity leaves the trigger. Can be also when the entity is killed or deleted.
417  protected void EntityLeaveTrigger(IEntity ent)
418  {
419  if (!ent)
420  return;
421 
422  if (CanBlockView(ent))
424 
426  if (!trigger)
427  return;
428 
429  trigger.QueryEntitiesInside();
430  array<IEntity> entitiesInside = {};
431  trigger.GetEntitiesInside(entitiesInside);
432 
433  // Check if in trigger is still present any entity that can block the view. If so, don't continue.
434  foreach (IEntity entity : entitiesInside)
435  {
436  // The entity that triggers an event as the leaving one is still on the list of entities present in trigger, skip it.
437  if (ent == entity)
438  continue;
439 
440  if (entity && CanBlockView(entity))
441  return;
442  }
443 
445  m_OnObstructionEventTriggered.Invoke(false);
446 
447  m_bViewObstructed = false;
448  }
449 
450  //------------------------------------------------------------------------------------------------
453  protected bool CanBlockView(notnull IEntity ent)
454  {
455  SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(ent);
456  if (!character)
457  return false;
458 
459  CharacterControllerComponent charControl = character.GetCharacterController();
460  if (!charControl || charControl.GetLifeState() == ECharacterLifeState.DEAD)
461  return false;
462 
463  int playerId = GetGame().GetPlayerManager().GetPlayerIdFromControlledEntity(ent);
464  if (playerId == 0)
465  {
466  AIControlComponent ctrComp = charControl.GetAIControlComponent();
467  if (ctrComp && !ctrComp.IsAIActivated())
468  return false;
469  }
470 
471  foreach (SCR_CampaignBuildingProviderComponent providerComponent : m_aProvidersComponents)
472  {
473  if (!providerComponent || !providerComponent.IsEnemyFaction(character))
474  continue;
475 
476  return true;
477  }
478 
479  return false;
480  }
481 
482  //------------------------------------------------------------------------------------------------
484  void SetOnEntityKilled(IEntity ent)
485  {
486  SCR_EditableCharacterComponent editableCharacter = SCR_EditableCharacterComponent.Cast(ent.FindComponent(SCR_EditableCharacterComponent));
487  if (!editableCharacter)
488  return;
489 
490  editableCharacter.GetOnDestroyed().Insert(EntityLeaveTrigger);
491  editableCharacter.GetOnDeleted().Insert(EntityLeaveTrigger);
492  }
493 
494  //------------------------------------------------------------------------------------------------
496  void RemoveOnEntityKilled(IEntity ent)
497  {
498  SCR_EditableCharacterComponent editableCharacter = SCR_EditableCharacterComponent.Cast(ent.FindComponent(SCR_EditableCharacterComponent));
499  if (!editableCharacter)
500  return;
501 
502  editableCharacter.GetOnDestroyed().Remove(EntityLeaveTrigger);
503  editableCharacter.GetOnDeleted().Remove(EntityLeaveTrigger);
504  }
505 
506  //------------------------------------------------------------------------------------------------
508  {
509  int playerId = SCR_PlayerController.GetLocalPlayerId();
510 
511  PlayerController playerController = GetGame().GetPlayerManager().GetPlayerController(playerId);
512  if (!playerController)
513  return SCR_ECharacterRank.INVALID;
514 
515  return SCR_CharacterRankComponent.GetCharacterRank(playerController.GetControlledEntity());
516  }
517 
518  //------------------------------------------------------------------------------------------------
519  override protected void EOnEditorOpenServer()
520  {
521  SCR_MilitaryBaseComponent base;
522 
523  if (GetProviderEntity())
524  {
525  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(GetProviderEntity().FindComponent(SCR_CampaignBuildingProviderComponent));
526  if (!providerComponent)
527  return;
528 
529  base = providerComponent.GetMilitaryBaseComponent();
530  }
531 
532  if (base)
533  return;
534 
535  GetGame().GetWorld().QueryEntitiesBySphere(GetProviderEntity().GetOrigin(), GetProviderComponent().GetBuildingRadius(), AssociateCompositionsToProvider, null, EQueryEntitiesFlags.ALL);
536  }
537 
538  //------------------------------------------------------------------------------------------------
539  override protected void EOnEditorCloseServer()
540  {
541  ToggleBuildingTool(true);
542 
543  if (!GetProviderEntity())
544  return;
545 
546  // In case the provider of the building was the base, don't remove it's stamp from component. So the composition can't be build from another providers
547  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(GetProviderEntity().FindComponent(SCR_CampaignBuildingProviderComponent));
548  if (!providerComponent)
549  return;
550 
551  SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
552  if (base)
553  return;
554 
555  GetGame().GetWorld().QueryEntitiesBySphere(GetProviderEntity().GetOrigin(), GetProviderComponent().GetBuildingRadius(), UnassignCompositionProvider, null, EQueryEntitiesFlags.ALL);
556  }
557 
558  //------------------------------------------------------------------------------------------------
560  {
561  SCR_EditableEntityComponent editableComponent = SCR_EditableEntityComponent.Cast(ent.FindComponent(SCR_EditableEntityComponent));
562  if (!editableComponent || editableComponent.GetParentEntity())
563  return true;
564 
565  SCR_CampaignBuildingCompositionComponent comp = SCR_CampaignBuildingCompositionComponent.Cast(ent.FindComponent(SCR_CampaignBuildingCompositionComponent));
566  if (!comp)
567  return true;
568 
569  // compositioni has no owner, set one.
570  if (comp.GetProviderEntity() == null)
571  comp.SetProviderEntityServer(GetProviderEntity());
572 
573  return true;
574  }
575 
576  //------------------------------------------------------------------------------------------------
577  bool UnassignCompositionProvider(IEntity ent)
578  {
579  SCR_EditableEntityComponent editableComponent = SCR_EditableEntityComponent.Cast(ent.FindComponent(SCR_EditableEntityComponent));
580  if (!editableComponent || editableComponent.GetParentEntity())
581  return true;
582 
583  SCR_CampaignBuildingCompositionComponent comp = SCR_CampaignBuildingCompositionComponent.Cast(ent.FindComponent(SCR_CampaignBuildingCompositionComponent));
584  if (!comp)
585  return true;
586 
587  if (comp.GetProviderEntity() == GetProviderEntity())
588  comp.SetProviderEntityServer(null);
589 
590  return true;
591  }
592 
593  //------------------------------------------------------------------------------------------------
595  override protected void EOnEditorDeactivate()
596  {
598  if (trigger)
599  SCR_EntityHelper.DeleteEntityAndChildren(trigger);
600 
601  FactionAffiliationComponent factionComponent = GetProviderFactionComponent();
602  if (factionComponent)
603  {
604  // here we have to check both Affiliated faction and Default affiliated faction in case of vehicles. It's because vehicles can't have set a affiliated faction if no one is sitting inside (to prevent AI to shoot at empty vehicles)
605  Faction buildingFaction = factionComponent.GetAffiliatedFaction();
606 
607  if (!buildingFaction)
608  buildingFaction = factionComponent.GetDefaultAffiliatedFaction();
609 
610  if (buildingFaction)
611  AddRemoveFactionLabel(SCR_CampaignFaction.Cast(buildingFaction), false);
612  }
613 
614  ToggleBuildingTool(true);
615  }
616 
617  //------------------------------------------------------------------------------------------------
618  // Return the entity which belongs to currently active provider componenet.
620  IEntity GetProviderEntity(bool getMasterProvider = false)
621  {
622  if (getMasterProvider)
623  return GetMasterProviderEntity();
624 
625  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
626  if (!providerComponent)
627  return null;
628 
629  return providerComponent.GetOwner();
630  }
631 
632  //------------------------------------------------------------------------------------------------
636  {
637  SCR_CampaignBuildingProviderComponent providerComponent = GetProviderComponent();
638  if (!providerComponent)
639  return null;
640 
641  return providerComponent.GetMasterProviderEntity();
642  }
643 
644  //------------------------------------------------------------------------------------------------
647  {
648  int count = m_aProvidersRplIds.Count();
649  for (int i = 0; i < count; i++)
650  {
651  RplComponent rplComp = RplComponent.Cast(Replication.FindItem(m_aProvidersRplIds[i]));
652  if (!rplComp)
653  continue;
654 
655  IEntity provider = rplComp.GetEntity();
656  if (!provider)
657  continue;
658 
659  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
660  if (!providerComponent)
661  continue;
662 
663  AddProviderEntityEditorComponent(providerComponent);
664  m_aProvidersRplIds.RemoveOrdered(i);
665  count--;
666  }
667 
668  if (m_aProvidersRplIds.IsEmpty())
669  SCR_CampaignBuildingProviderComponent.GetOnProviderCreated().Remove(SetProviderFromRplID);
670  }
671 
672  //------------------------------------------------------------------------------------------------
673  override protected bool RplSave(ScriptBitWriter writer)
674  {
675  RplId entityRplID;
676  int count = m_aProvidersComponents.Count();
677 
678  writer.WriteInt(count);
679  for (int i = 0; i < count; i++)
680  {
681  IEntity provider = m_aProvidersComponents[i].GetOwner();
682  if (!provider)
683  continue;
684 
685  RplComponent rplCmp = RplComponent.Cast(provider.FindComponent(RplComponent));
686  entityRplID = rplCmp.Id();
687  writer.WriteRplId(entityRplID);
688  }
689 
690  return true;
691  }
692 
693  //------------------------------------------------------------------------------------------------
694  override protected bool RplLoad(ScriptBitReader reader)
695  {
696  RplId entityRplID;
697  IEntity ent;
698  int count;
699  reader.ReadInt(count);
700 
701  for (int i = 0; i < count; i++)
702  {
703  reader.ReadRplId(entityRplID);
704  if (!entityRplID.IsValid())
705  continue;
706 
707  RplComponent rplComp = RplComponent.Cast(Replication.FindItem(entityRplID));
708  if (!rplComp)
709  {
710  m_aProvidersRplIds.Insert(entityRplID);
711  continue;
712  }
713 
714  ent = IEntity.Cast(rplComp.GetEntity());
715  if (!ent)
716  continue;
717 
718  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(ent.FindComponent(SCR_CampaignBuildingProviderComponent));
719  AddProviderEntityEditorComponent(providerComponent);
720  }
721 
722  if (!m_aProvidersRplIds.IsEmpty())
723  SCR_CampaignBuildingProviderComponent.GetOnProviderCreated().Insert(SetProviderFromRplID);
724 
725  if (!m_aProvidersComponents.IsEmpty())
727 
728  return true;
729  }
730 }
EntityEnterTrigger
protected void EntityEnterTrigger(IEntity ent)
Definition: SCR_CampaignBuildingEditorComponent.c:398
SetProviderFromRplID
void SetProviderFromRplID()
Set a provider, loaded from RPL ID.
Definition: SCR_CampaignBuildingEditorComponent.c:646
ComponentEditorProps
SCR_FragmentEntityClass ComponentEditorProps
SetForcedProvider
void SetForcedProvider(SCR_CampaignBuildingProviderComponent forcedProviderComponent=null)
Used when player initiate a building mode via user action - forced provider is an entity owning the u...
Definition: SCR_CampaignBuildingEditorComponent.c:86
EEditableEntityLabel
EEditableEntityLabel
Definition: EEditableEntityLabel.c:1
m_aProvidersRplIds
protected ref array< RplId > m_aProvidersRplIds
Definition: SCR_CampaignBuildingEditorComponent.c:12
SCR_PlayerController
Definition: SCR_PlayerController.c:31
SCR_EntityHelper
Definition: SCR_EntityHelper.c:1
EOnEditorOpenServer
override protected void EOnEditorOpenServer()
Definition: SCR_CampaignBuildingEditorComponent.c:519
GetMasterProviderEntity
IEntity GetMasterProviderEntity()
Definition: SCR_CampaignBuildingEditorComponent.c:635
GetProviderResourceComponent
bool GetProviderResourceComponent(out SCR_ResourceComponent resourceComponent)
Definition: SCR_CampaignBuildingEditorComponent.c:114
ECharacterLifeState
ECharacterLifeState
Definition: ECharacterLifeState.c:12
UnassignCompositionProvider
bool UnassignCompositionProvider(IEntity ent)
Definition: SCR_CampaignBuildingEditorComponent.c:577
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
EOnEditorDeactivate
override protected void EOnEditorDeactivate()
Hide the area of building and remove the active faction.
Definition: SCR_CampaignBuildingEditorComponent.c:595
SCR_GadgetManagerComponent
Definition: SCR_GadgetManagerComponent.c:138
SetOnEntityKilled
void SetOnEntityKilled(IEntity ent)
Set an event called when entity which can block view in Free Roam Building enters the area of Free Ro...
Definition: SCR_CampaignBuildingEditorComponent.c:484
GetProviderComponent
SCR_CampaignBuildingProviderComponent GetProviderComponent(bool getMasterProviderComponent=false)
Return provider component of current provider.
Definition: SCR_CampaignBuildingEditorComponent.c:67
SCR_ECharacterRank
SCR_ECharacterRank
Definition: SCR_CharacterRankComponent.c:305
RemoveOnEntityKilled
void RemoveOnEntityKilled(IEntity ent)
Remove an event called when entity which can block view in Free Roam Building is killed / leave the a...
Definition: SCR_CampaignBuildingEditorComponent.c:496
GetProviderSuppliesComponent
bool GetProviderSuppliesComponent(out SCR_CampaignSuppliesComponent suppliesComponent)
Definition: SCR_CampaignBuildingEditorComponent.c:152
SCR_CampaignBuildingEditorComponentClass
Definition: SCR_CampaignBuildingEditorComponent.c:3
SetOnEnterEvent
protected void SetOnEnterEvent()
Set event to obstruct view when enemy character enters a building radius.
Definition: SCR_CampaignBuildingEditorComponent.c:387
SCR_ContentBrowserEditorComponent
Definition: SCR_ContentBrowserEditorComponent.c:16
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
EEditableEntityBudget
EEditableEntityBudget
Definition: EEditableEntityBudget.c:1
m_ContentBrowserManager
protected SCR_ContentBrowserEditorComponent m_ContentBrowserManager
Definition: SCR_CampaignBuildingEditorComponent.c:13
m_OnProviderChanged
protected ref ScriptInvoker m_OnProviderChanged
Definition: SCR_CampaignBuildingEditorComponent.c:17
GetProviderEntity
IEntity GetProviderEntity(bool getMasterProvider=false)
bool getMasterProvider default false. If true, tries to search for master provider entity.
Definition: SCR_CampaignBuildingEditorComponent.c:620
RemoveProviderEntityEditorComponent
void RemoveProviderEntityEditorComponent(SCR_CampaignBuildingProviderComponent providerComponent)
Definition: SCR_CampaignBuildingEditorComponent.c:54
EOnEditorCloseServer
override protected void EOnEditorCloseServer()
Definition: SCR_CampaignBuildingEditorComponent.c:539
SCR_CharacterRankComponent
void SCR_CharacterRankComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CharacterRankComponent.c:209
SCR_CampaignSuppliesComponent
void SCR_CampaignSuppliesComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_CampaignSuppliesComponent.c:327
RplLoad
override protected bool RplLoad(ScriptBitReader reader)
Definition: SCR_CampaignBuildingEditorComponent.c:694
ENotification
ENotification
Definition: ENotification.c:4
SCR_FreeRoamBuildingClientTriggerEntity
Definition: SCR_FreeRoamBuildingClientTriggerEntity.c:6
GetOrigin
vector GetOrigin()
Definition: SCR_AIUtilityComponent.c:279
SCR_BaseEditorComponent
Definition: SCR_BaseEditorComponent.c:119
IsActiveProvider
bool IsActiveProvider(notnull SCR_CampaignBuildingProviderComponent providerComponent)
Definition: SCR_CampaignBuildingEditorComponent.c:98
GetProviderFactionComponent
SCR_FactionAffiliationComponent GetProviderFactionComponent()
Definition: SCR_CampaignBuildingEditorComponent.c:174
ScriptInvokerBool
ScriptInvokerBase< ScriptInvokerBoolMethod > ScriptInvokerBool
Definition: SCR_ScriptInvokerHelper.c:41
GetBuildingRadius
float GetBuildingRadius()
Definition: SCR_CampaignBuildingProviderComponent.c:292
CanBeShown
bool CanBeShown(notnull SCR_EditorContentBrowserSaveStateDataUI tab)
Check if the given tab can be shown.
Definition: SCR_CampaignBuildingEditorComponent.c:326
GetShownBudget
EEditableEntityBudget GetShownBudget()
Check current provider and return budget marked as a budget to be shown in UI progress bar....
Definition: SCR_CampaignBuildingEditorComponent.c:141
GetOnObstructionEventTriggered
ScriptInvokerBool GetOnObstructionEventTriggered()
Definition: SCR_CampaignBuildingEditorComponent.c:30
GetOnProviderChanged
ScriptInvoker GetOnProviderChanged()
Definition: SCR_CampaignBuildingEditorComponent.c:21
m_OnObstructionEventTriggered
protected ref ScriptInvokerBool m_OnObstructionEventTriggered
Definition: SCR_CampaignBuildingEditorComponent.c:18
CanBlockView
protected bool CanBlockView(notnull IEntity ent)
Definition: SCR_CampaignBuildingEditorComponent.c:453
RplSave
override protected bool RplSave(ScriptBitWriter writer)
Definition: SCR_CampaignBuildingEditorComponent.c:673
m_bViewObstructed
protected bool m_bViewObstructed
Definition: SCR_CampaignBuildingEditorComponent.c:15
AddProviderEntityEditorComponent
void AddProviderEntityEditorComponent(SCR_CampaignBuildingProviderComponent providerComponent)
Definition: SCR_CampaignBuildingEditorComponent.c:39
m_ForcedProviderComponent
protected SCR_CampaignBuildingProviderComponent m_ForcedProviderComponent
Definition: SCR_CampaignBuildingEditorComponent.c:14
SCR_BaseEditorComponentClass
Definition: SCR_BaseEditorComponent.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
EntityLeaveTrigger
protected void EntityLeaveTrigger(IEntity ent)
Definition: SCR_CampaignBuildingEditorComponent.c:417
Faction
Definition: Faction.c:12
GetProviderEntitiesCount
int GetProviderEntitiesCount()
Definition: SCR_CampaignBuildingEditorComponent.c:92
TabContainLabel
bool TabContainLabel(SCR_EditorContentBrowserSaveStateDataUI tab)
Check if the given tabUI contains any label set on provider.
Definition: SCR_CampaignBuildingEditorComponent.c:336
AddRemoveFactionLabel
protected void AddRemoveFactionLabel(SCR_Faction faction, bool addLabel)
Definition: SCR_CampaignBuildingEditorComponent.c:226
SCR_CampaignFaction
Definition: SCR_CampaignFaction.c:2
IsProviderBase
bool IsProviderBase()
Returns true if the provider is a base.
Definition: SCR_CampaignBuildingEditorComponent.c:355
AssociateCompositionsToProvider
bool AssociateCompositionsToProvider(IEntity ent)
Definition: SCR_CampaignBuildingEditorComponent.c:559
GetUserRank
SCR_ECharacterRank GetUserRank()
Definition: SCR_CampaignBuildingEditorComponent.c:507
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
SCR_FactionAffiliationComponent
Definition: SCR_FactionAffiliationComponent.c:10
EntityUtils
Definition: EntityUtils.c:12
ToggleBuildingTool
void ToggleBuildingTool(bool mode)
Definition: SCR_CampaignBuildingEditorComponent.c:365
GetTrigger
SCR_FreeRoamBuildingClientTriggerEntity GetTrigger()
Definition: SCR_CampaignBuildingEditorComponent.c:197
m_aProvidersComponents
SCR_CampaignBuildingEditorComponentClass m_aProvidersComponents
SpawnClientTrigger
ScriptedGameTriggerEntity SpawnClientTrigger()
Definition: SCR_CampaignBuildingEditorComponent.c:235
SCR_Faction
Definition: SCR_Faction.c:6
Obsolete
RespawnSystemComponentClass GameComponentClass Obsolete()] proto external GenericEntity DoSpawn(string prefab
RespawnSystemComponent should be attached to a gamemode to handle player spawning and respawning.
EOnEditorActivate
override protected void EOnEditorActivate()
Make the area around where is possible to build composition visible for player.
Definition: SCR_CampaignBuildingEditorComponent.c:264
category
params category
Definition: SCR_VehicleDamageManagerComponent.c:180
SCR_EditorContentBrowserSaveStateDataUI
Editor Content browser State data that includes UI data for tabs.
Definition: SCR_EditorContentBrowserStateDataUI.c:3