Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_FieldManualPiece_Separator.c
Go to the documentation of this file.
1 [BaseContainerProps(insertable: false), SCR_BaseContainerCustomTitleResourceName("m_ImagePath", true, "Image: %1")]
3 {
4  [Attribute(defvalue: "20", uiwidget: UIWidgets.Slider, params: "0 100 10")]
5  protected int m_iPaddingTop;
6 
7  [Attribute(defvalue: "75", uiwidget: UIWidgets.Slider, params: "0 100 5")]
8  protected int m_iWidthPercentage;
9 
10  [Attribute(defvalue: "2", uiwidget: UIWidgets.Slider, params: "0 10 1")]
11  protected int m_iThickness;
12 
13  [Attribute(defvalue: "20", uiwidget: UIWidgets.Slider, params: "0 100 10")]
14  protected int m_iPaddingBottom;
15 
16  [Attribute(defvalue: "{B998E3D32F62BE60}UI/layouts/Menus/FieldManual/Pieces/FieldManual_Piece_Separator.layout", uiwidget: UIWidgets.EditBoxWithButton, params: "layout")]
17  protected ResourceName m_Layout;
18 
19  //------------------------------------------------------------------------------------------------
20  override void CreateWidget(notnull Widget parent)
21  {
22  WorkspaceWidget workspace = GetGame().GetWorkspace();
23 
24  Widget createdWidget = workspace.CreateWidgets(m_Layout, parent);
25  if (!createdWidget)
26  {
27  Print("could not create image widget | " + FilePath.StripPath(__FILE__) + ":" + __LINE__, LogLevel.WARNING);
28  return;
29  }
30 
31  LayoutSlot.SetPadding(createdWidget, 0, m_iPaddingTop, 0, m_iPaddingBottom);
32 
33  ImageWidget separator = ImageWidget.Cast(createdWidget.FindAnyWidget("Separator"));
34  if (!separator)
35  {
36  return;
37  }
38 
39  if (m_iWidthPercentage < 1)
40  {
41  m_iThickness = 0;
42  }
43  separator.SetSize(32, m_iThickness);
44 
45  FrameWidget spaceLeft = FrameWidget.Cast(createdWidget.FindAnyWidget("SpaceLeft"));
46  FrameWidget spaceRight = FrameWidget.Cast(createdWidget.FindAnyWidget("SpaceRight"));
47  if (spaceLeft != null && spaceRight != null)
48  {
49  float remainder = (100.0 - m_iWidthPercentage) / 2;
50  LayoutSlot.SetFillWeight(spaceLeft, remainder);
51  LayoutSlot.SetFillWeight(separator, m_iWidthPercentage);
52  LayoutSlot.SetFillWeight(spaceRight, remainder);
53  }
54  }
55 }
SCR_FieldManualPiece_Separator
Definition: SCR_FieldManualPiece_Separator.c:2
SCR_BaseContainerCustomTitleResourceName
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
Definition: SCR_CampaignMilitaryBaseComponent.c:2522
SCR_FieldManualPiece
Definition: SCR_FieldManualPiece.c:2
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_Layout
ResourceName m_Layout
Definition: SCR_ActionsToolbarEditorUIComponent.c:6
Attribute
typedef Attribute
Post-process effect of scripted camera.
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