Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionChangeTaskIcon.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Which task to work with - Use GetTask")]
6
7 [Attribute(params: "edds imageset", uiwidget: UIWidgets.ResourcePickerThumbnail, desc: "Task icon set", category: "Task")]
8 ResourceName m_sTaskIconSet;
9
10 [Attribute(desc: "Name of the specific icon from the icon set", category: "Task")]
11 string m_sTaskIconName;
12
13 //------------------------------------------------------------------------------------------------
14 override void OnActivate(IEntity object)
15 {
16 if (!CanActivate())
17 return;
18
19 if (!m_Getter)
20 {
21 Print(string.Format("ScenarioFramework Action: Getter not found for Action %1.", this), LogLevel.ERROR);
22 return;
23 }
24
25 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
26 if (!entityWrapper)
27 {
28 Print(string.Format("ScenarioFramework Action: Issue with Getter detected for Action %1.", this), LogLevel.ERROR);
29 return;
30 }
31
32 SCR_ScenarioFrameworkTask task = SCR_ScenarioFrameworkTask.Cast(entityWrapper.GetValue());
33 if (!task)
34 {
35 if (object)
36 Print(string.Format("ScenarioFramework Action: Task not found for Action %1 attached on %2.", this, object.GetName()), LogLevel.ERROR);
37 else
38 Print(string.Format("ScenarioFramework Action: Task not found for Action %1.", this), LogLevel.ERROR);
39
40 return;
41 }
42
43 SCR_ScenarioFrameworkLayerTask layerTask = task.GetLayerTask();
44 if (!layerTask)
45 {
46 if (object)
47 Print(string.Format("ScenarioFramework Action: Layer Task not found for Action %1 attached on %2.", this, object.GetName()), LogLevel.ERROR);
48 else
49 Print(string.Format("ScenarioFramework Action: Layer Task not found for Action %1.", this), LogLevel.ERROR);
50
51 return;
52 }
53
54 if (SCR_StringHelper.IsEmptyOrWhiteSpace(m_sTaskIconSet))
55 {
56 if (object)
57 Print(string.Format("ScenarioFramework Action: Task Icon Set empty for Action %1 attached on %2.", this, object.GetName()), LogLevel.ERROR);
58 else
59 Print(string.Format("ScenarioFramework Action: Task Icon Set empty for Action %1.", this), LogLevel.ERROR);
60 return;
61 }
62
63 if (SCR_StringHelper.IsEmptyOrWhiteSpace(m_sTaskIconName))
64 {
65 if (object)
66 Print(string.Format("ScenarioFramework Action: Task Icon Name empty for Action %1 attached on %2.", this, object.GetName()), LogLevel.ERROR);
67 else
68 Print(string.Format("ScenarioFramework Action: Task Icon Name empty for Action %1.", this), LogLevel.ERROR);
69 return;
70 }
71
72 layerTask.m_sTaskIconSet = m_sTaskIconSet;
73 layerTask.m_sTaskIconName = m_sTaskIconName;
74 task.SetTaskIconPath(m_sTaskIconSet);
75 task.SetTaskIconSetName(m_sTaskIconName);
76 }
77}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static bool IsEmptyOrWhiteSpace(string input)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute