Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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")]
7  protected ResourceName m_ImagePath;
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")]
16  ResourceName m_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 }
SCR_FieldManualPiece
Definition: SCR_FieldManualPiece.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
m_Layout
ResourceName m_Layout
Definition: SCR_ActionsToolbarEditorUIComponent.c:6
SCR_WidgetHelper
Definition: SCR_WidgetHelper.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_FieldManualPiece_Header
Definition: SCR_FieldManualPiece_Header.c:2
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468
m_sText
class SCR_BaseEditorAttribute m_sText