4 protected static const int IMAGE_INDEX = 0;
6 [
Attribute(uiwidget: UIWidgets.ResourcePickerThumbnail,
params:
"edds imageset")]
7 protected ResourceName m_ImagePath;
10 protected string m_sImageSetName;
12 [
Attribute(uiwidget: UIWidgets.EditBoxWithButton)]
15 [
Attribute(defvalue:
"{B6E3D069C489E6EF}UI/layouts/Menus/FieldManual/Pieces/FieldManual_Piece_Header.layout", uiwidget: UIWidgets.EditBoxWithButton,
params:
"layout")]
16 ResourceName m_Layout;
19 override void CreateWidget(notnull Widget parent)
21 Widget createdWidget =
GetGame().GetWorkspace().CreateWidgets(
m_Layout, parent);
24 Print(
string.Format(
"created widget (%2:%1) was null | " + FilePath.StripPath(__FILE__) +
":" + __LINE__,
m_Layout,
m_sText), LogLevel.DEBUG);
28 TextWidget textWidget = TextWidget.Cast(createdWidget);
31 textWidget = TextWidget.Cast(
SCR_WidgetHelper.GetWidgetOrChild(createdWidget,
"Text"));
36 Print(
"created widget could not be set text | " + FilePath.StripPath(__FILE__) +
":" + __LINE__, LogLevel.DEBUG);
42 ImageWidget imageWidget = ImageWidget.Cast(createdWidget.FindAnyWidget(
"Image"));
43 if (imageWidget !=
null)
45 if (!m_ImagePath.IsEmpty())
47 if (m_ImagePath.EndsWith(
"imageset") && !m_sImageSetName.IsEmpty())
49 imageWidget.LoadImageFromSet(IMAGE_INDEX, m_ImagePath, m_sImageSetName);
53 imageWidget.LoadImageTexture(IMAGE_INDEX, m_ImagePath);
59 imageWidget.GetParent().SetVisible(
false);