Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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")]
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}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_CampaignMilitaryBaseComponent SCR_MilitaryBaseComponent SCR_BaseContainerCustomTitleResourceName("m_sBaseName", true)
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