Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SlotUIComponent.c
Go to the documentation of this file.
1
7{
8 [Attribute()]
9 private float AnchorLeft;
10
11 [Attribute()]
12 private float AnchorTop;
13
14 [Attribute()]
15 private float AnchorRight;
16
17 [Attribute()]
18 private float AnchorBottom;
19
20 [Attribute()]
21 private float PositionX;
22
23 [Attribute()]
24 private float PositionY;
25
26 [Attribute()]
27 private float SizeX;
28
29 [Attribute()]
30 private float SizeY;
31
32 [Attribute()]
33 private float AlignmentX;
34
35 [Attribute()]
36 private float AlignmentY;
37
38 [Attribute()]
39 private bool SizeToContent;
40
41 protected Widget m_widget;
42
43 override void HandlerAttached(Widget w)
44 {
45 m_widget = w;
46
47 if (!w.GetParent())
48 {
49 Print(string.Format("Cannot initialize SCR_SlotUIComponent, widget '%1' has no parent!", w.GetName()), LogLevel.WARNING);
50 return;
51 }
52
53 if (w.GetParent().GetTypeID() != WidgetType.FrameWidgetTypeID)
54 {
55 Print(string.Format("Cannot initialize SCR_SlotUIComponent, parent of widget '%1' is not a FrameWidget!", w.GetName()), LogLevel.WARNING);
56 return;
57 }
58
59 FrameSlot.SetAlignment(w, AlignmentX, AlignmentY);
60 FrameSlot.SetSizeToContent(w, SizeToContent);
61 FrameSlot.SetOffsets(w, AnchorLeft, AnchorTop, AnchorRight, AnchorBottom);
62 FrameSlot.SetAnchorMin(w, AnchorLeft, AnchorTop);
63 FrameSlot.SetAnchorMax(w, AnchorRight, AnchorBottom);
64 if (AnchorLeft == AnchorRight)
65 {
66 FrameSlot.SetPosX(w, PositionX);
67 FrameSlot.SetSizeX(w, SizeX);
68 }
69 if (AnchorTop == AnchorBottom)
70 {
71 FrameSlot.SetPosY(w, PositionY);
72 FrameSlot.SetSizeY(w, SizeY);
73 }
74 }
75
76 void SetPosX( float x )
77 {
78 FrameSlot.SetPosX( m_widget, x );
79 }
80
81 void SetPosY( float y )
82 {
83 FrameSlot.SetPosY( m_widget, y );
84 }
85
86 float GetPosX()
87 {
88 return FrameSlot.GetPosX( m_widget );
89 }
90
91 float GetPosY()
92 {
93 return FrameSlot.GetPosY( m_widget );
94 }
95
96};
override void HandlerAttached(Widget w)
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