Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_SlotLabelsComponent2.c
Go to the documentation of this file.
1 class SCR_SlotLabelsComponent2 : ScriptedWidgetComponent
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 };
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
GenericEntity
SCR_GenericBoxEntityClass GenericEntity
SCR_SlotLabelsComponent2
Definition: SCR_SlotLabelsComponent2.c:1