Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CameraParticlesEditorComponent.c
Go to the documentation of this file.
1[ComponentEditorProps(category: "GameScripted/Editor", description: "Camera for in-game editor. Works only with SCR_EditorBaseEntity!", icon: "WBData/ComponentEditorProps/componentEditor.png")]
3{
4 [Attribute()]
5 private ref array<ref SCR_CameraParticleEditor> m_Effects;
6
7 int GetEffects(notnull array<SCR_CameraParticleEditor> outEffects)
8 {
9 outEffects.Clear();
10 foreach (SCR_CameraParticleEditor effect: m_Effects)
11 {
12 outEffects.Insert(effect);
13 }
14 return outEffects.Count();
15 }
16 int GetEffectsCount()
17 {
18 return m_Effects.Count();
19 }
20 SCR_CameraParticleEditor GetEffect(int index)
21 {
22 return m_Effects[index];
23 }
24};
25
29{
30 private int m_iCurrentEffect;
31 private SCR_CameraEditorComponent m_CameraManager;
32
33 int GetEffects(notnull array<SCR_CameraParticleEditor> outEffects)
34 {
36 if (!prefabData) return 0;
37
38 return prefabData.GetEffects(outEffects);
39 }
40 void RefreshCurrentEffect(SCR_ManualCamera manualCamera)
41 {
42 SetCurrentEffect(m_iCurrentEffect);
43 }
44 void SetCurrentEffect(int index)
45 {
47 if (!prefabData || index < 0 || index >= prefabData.GetEffectsCount()) return;
48
49 SCR_CameraParticleEditor effect = prefabData.GetEffect(m_iCurrentEffect);
50 if (effect) effect.Destroy();
51
52 m_iCurrentEffect = index;
53
54 effect = prefabData.GetEffect(m_iCurrentEffect);
55 if (effect) effect.Create(m_CameraManager.GetCamera());
56 }
57 int GetCurrentEffect()
58 {
59 return m_iCurrentEffect;
60 }
61 override void EOnEditorPostActivate()
62 {
63 m_CameraManager = SCR_CameraEditorComponent.Cast(SCR_CameraEditorComponent.GetInstance(SCR_CameraEditorComponent, true));
64 if (!m_CameraManager) return;
65
66 if (m_CameraManager.GetCamera())
67 RefreshCurrentEffect(null);
68 else
69 m_CameraManager.GetOnCameraCreate().Insert(RefreshCurrentEffect);
70 }
71 override void EOnEditorDeactivate()
72 {
73 if (m_CameraManager) m_CameraManager.GetOnCameraCreate().Remove(RefreshCurrentEffect);
74
76 if (prefabData)
77 {
78 SCR_CameraParticleEditor effect = prefabData.GetEffect(m_iCurrentEffect);
79 if (effect) effect.Destroy();
80 }
81 }
82};
83
86{
87 [Attribute()]
88 private LocalizedString m_sDisplayName;
89
90 [Attribute(params: "ptc", uiwidget: UIWidgets.ResourcePickerThumbnail)]
91 private ResourceName m_Effect;
92
93 private ParticleEffectEntity m_Emitter;
94
95 string GetDisplayName()
96 {
97 return m_sDisplayName;
98 }
99
100 void Create(IEntity target)
101 {
102 if (m_Effect.IsEmpty()) return;
103
105 spawnParams.Parent = target;
106 m_Emitter = ParticleEffectEntity.SpawnParticleEffect(m_Effect, spawnParams);
107 }
108 void Destroy()
109 {
110 delete m_Emitter;
111 }
112};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
enum EAIGroupCombatMode ComponentEditorProps(category:"GameScripted/AI", description:"Component for utility AI system for groups")
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
class SCR_KeyBindingFilter BaseContainerCustomTitleField("m_sBindString")
void ParticleEffectEntity(IEntitySource src, IEntity parent)
void SCR_BaseEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
EntityComponentPrefabData GetEditorComponentData()
void EOnEditorPostActivate()
When the component is activated, but after EOnEditorActivate() function was called in all components.
SCR_FieldOfViewSettings Attribute