Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CustomArrayEditableEntityUIComponent.c
Go to the documentation of this file.
2{
3 [Attribute(desc: "Image widget to set icon same as EditableEntity UI info icon")]
4 protected ref array<string> m_sIconWidgetNames;
5
6 [Attribute("0", desc: "If true will attempt to color the widget this script is attached to if the EditableEntity uses SCR_ColorUIInfo")]
7 protected bool m_bColorWidget;
8
9 //------------------------------------------------------------------------------------------------
11 {
12 //~ Set custom textures
13 if (info)
14 {
15 ImageWidget iconWidget;
16
17 //~ Set Icons
19 {
20 foreach (string icon : m_sIconWidgetNames)
21 {
22 iconWidget = ImageWidget.Cast(GetWidget().FindAnyWidget(icon));
23 info.SetIconTo(iconWidget);
24 }
25 }
26
27 //~ Color widget
29 {
30 SCR_ColorUIInfo colorInfo = SCR_ColorUIInfo.Cast(info);
31
32 if (colorInfo)
33 GetWidget().SetColor(colorInfo.GetColor());
34 else
35 Print("'SCR_CustomArrayEditableEntityUIComponent' tried to set the UI color but the EditableEntity is not using SCR_ColorUIInfo", LogLevel.WARNING);
36 }
37 }
38 }
39}
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Widget GetWidget()
override void OnInit(SCR_EditableEntityComponent entity, SCR_UIInfo info, SCR_EditableEntityBaseSlotUIComponent slot)
bool SetIconTo(ImageWidget imageWidget)
Definition SCR_UIInfo.c:102
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