Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SlotLabelsComponent2.c
Go to the documentation of this file.
2{
3 override void HandlerAttached(Widget w)
4 {
5 #ifdef WORKBENCH
6 Game g = GetGame();
7 GenericEntity world = GetGame().GetWorldEntity();
8
9 if (world)
10 return;
11
12 Widget slot = w.GetChildren();
13
14 while (slot)
15 {
16 if (SizeLayoutWidget.Cast(slot))
17 {
18 OverlayWidget overlay = OverlayWidget.Cast(GetGame().GetWorkspace().CreateWidget(WidgetType.OverlayWidgetTypeID, WidgetFlags.VISIBLE, new Color(1,1,1,1), 0, slot));
19 SizeLayoutSlot.SetHorizontalAlign(overlay, LayoutHorizontalAlign.Stretch);
20 SizeLayoutSlot.SetVerticalAlign(overlay, LayoutHorizontalAlign.Stretch);
21
22 ImageWidget img = ImageWidget.Cast(GetGame().GetWorkspace().CreateWidget(WidgetType.ImageWidgetTypeID, WidgetFlags.VISIBLE, new Color(Math.RandomFloat(0,0.8),Math.RandomFloat(0,0.8),Math.RandomFloat(0,0.8),1), 0, overlay));
23 OverlaySlot.SetHorizontalAlign(img, LayoutHorizontalAlign.Stretch);
24 OverlaySlot.SetVerticalAlign(img, LayoutHorizontalAlign.Stretch);
25
26 TextWidget text = TextWidget.Cast(GetGame().GetWorkspace().CreateWidget(WidgetType.TextWidgetTypeID, WidgetFlags.VISIBLE, new Color(1,1,1,1), 0, overlay));
27 text.SetText(slot.GetName());
28 text.SetFont("{3E7733BAC8C831F6}UI/Fonts/RobotoCondensed/RobotoCondensed_Regular.fnt");
29 text.SetExactFontSize(18);
30 }
31
32 slot = slot.GetSibling();
33 }
34 #endif
35 }
36};
ArmaReforgerScripted GetGame()
Definition game.c:1398
override void CreateWidget(Widget parent)
Definition Color.c:13
Definition Game.c:8
Definition Math.c:13
WidgetFlags
Widget flags. See enf::Widget::SetFlags().
Definition WidgetFlags.c:14
LayoutHorizontalAlign