Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_FieldManualPiece_Header.c
Go to the documentation of this file.
3{
4 protected static const int IMAGE_INDEX = 0;
5
6 [Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail, params: "edds imageset")]
8
9 [Attribute()]
10 protected string m_sImageSetName;
11
12 [Attribute(uiwidget: UIWidgets.EditBoxWithButton)]
13 string m_sText;
14
15 [Attribute(defvalue: "{B6E3D069C489E6EF}UI/layouts/Menus/FieldManual/Pieces/FieldManual_Piece_Header.layout", uiwidget: UIWidgets.EditBoxWithButton, params: "layout")]
17
18 //------------------------------------------------------------------------------------------------
19 override void CreateWidget(notnull Widget parent)
20 {
21 Widget createdWidget = GetGame().GetWorkspace().CreateWidgets(m_Layout, parent);
22 if (!createdWidget)
23 {
24 Print(string.Format("created widget (%2:%1) was null | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, m_Layout, m_sText), LogLevel.DEBUG);
25 return;
26 }
27
28 TextWidget textWidget = TextWidget.Cast(createdWidget);
29 if (!textWidget)
30 {
31 textWidget = TextWidget.Cast(SCR_WidgetHelper.GetWidgetOrChild(createdWidget, "Text"));
32 }
33
34 if (!textWidget)
35 {
36 Print("created widget could not be set text | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.DEBUG);
37 return;
38 }
39
40 textWidget.SetText(m_sText);
41
42 ImageWidget imageWidget = ImageWidget.Cast(createdWidget.FindAnyWidget("Image"));
43 if (imageWidget != null)
44 {
45 if (!m_ImagePath.IsEmpty())
46 {
47 if (m_ImagePath.EndsWith("imageset") && !m_sImageSetName.IsEmpty())
48 {
49 imageWidget.LoadImageFromSet(IMAGE_INDEX, m_ImagePath, m_sImageSetName);
50 }
51 else
52 {
53 imageWidget.LoadImageTexture(IMAGE_INDEX, m_ImagePath);
54 }
55 SCR_WidgetHelper.ResizeToImage(imageWidget, IMAGE_INDEX);
56 }
57 else
58 {
59 imageWidget.GetParent().SetVisible(false); //--- ToDo: Cleaner hierarchy
60 }
61 }
62
63 }
64}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_PlayerCommandingConfigActionPair Managed SCR_BaseContainerLocalizedTitleField("m_sCommandName")
override void CreateWidget(notnull Widget parent)
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