Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CameraParticleEditorAttribute.c
Go to the documentation of this file.
1
6{
7 //------------------------------------------------------------------------------------------------
8 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
9 {
10 if (!item.IsInherited(SCR_CameraBase)) return null;
11
13 if (!cameraParticlesManager) return null;
14
15 return SCR_BaseEditorAttributeVar.CreateInt(cameraParticlesManager.GetCurrentEffect());
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
20 {
22 if (!cameraParticlesManager) return;
23
24 if (var) cameraParticlesManager.SetCurrentEffect(var.GetInt());
25 }
26
27 //------------------------------------------------------------------------------------------------
28 override void PreviewVariable(bool setPreview, SCR_AttributesManagerEditorComponent manager)
29 {
30 WriteVariable(null, GetVariable(), manager, -1);
31 }
32
33 //---- REFACTOR NOTE START: Loop might not be save? ----
34
35 //------------------------------------------------------------------------------------------------
36 override int GetEntries(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
37 {
38 outEntries.Clear();
39
41 if (!cameraParticlesManager) return 0;
42
43 array<SCR_CameraParticleEditor> effects = new array<SCR_CameraParticleEditor>;
44 int effectsCount = cameraParticlesManager.GetEffects(effects);
45 if (effectsCount == 0) return 0;
46
47 for (int i = 0; i < effectsCount; i++)
48 {
49 outEntries.Insert(new SCR_BaseEditorAttributeEntryText(effects[i].GetDisplayName()));
50 }
51 return effectsCount;
52 }
53
54 //---- REFACTOR NOTE END ----
55};
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_BaseEditorAttributeEntryText(string text)
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
sealed SCR_BaseEditorAttributeVar GetVariable(bool createWhenNull=false)
static SCR_BaseEditorAttributeVar CreateInt(int value)