Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_PlayerToolbarItemEditorUIComponent.c
Go to the documentation of this file.
2 {
3  [Attribute()]
4  protected string m_sPlayerNameWidgetName;
5 
6  protected TextWidget m_wPlayerName;
7 
8  //------------------------------------------------------------------------------------------------
9  override void SetEntity(SCR_EditableEntityComponent entity, Widget widget, SCR_EditableEntitySlotManagerUIComponent slotManager)
10  {
11  super.SetEntity(entity, widget, slotManager);
12 
13  SCR_EditablePlayerDelegateComponent delegate = SCR_EditablePlayerDelegateComponent.Cast(entity);
14  if (!delegate)
15  return;
16 
17  int playerID = delegate.GetPlayerID();
18 
19  m_wPlayerName = TextWidget.Cast(widget.FindAnyWidget(m_sPlayerNameWidgetName));
20  if (m_wPlayerName)
21  m_wPlayerName.SetText(GetGame().GetPlayerManager().GetPlayerName(playerID));
22  }
23 
24  //------------------------------------------------------------------------------------------------
25  override bool OnFocus(Widget w, int x, int y)
26  {
27  super.OnFocus(w, x, y);
28 
29  if (m_wPlayerName)
30  m_wPlayerName.SetColor(Color.FromInt(UIColors.HIGHLIGHTED.PackToInt()));
31 
32  return false;
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  override bool OnFocusLost(Widget w, int x, int y)
37  {
38  super.OnFocusLost(w, x, y);
39 
40  if (m_wPlayerName)
41  m_wPlayerName.SetColor(Color.FromInt(Color.WHITE));
42 
43  return false;
44  }
45 }
SCR_EntityToolbarItemEditorUIComponent
Definition: SCR_EntityToolbarItemEditorUIComponent.c:1
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_PlayerToolbarItemEditorUIComponent
Definition: SCR_PlayerToolbarItemEditorUIComponent.c:1
SCR_EditableEntitySlotManagerUIComponent
Definition: SCR_EditableEntitySlotManagerUIComponent.c:1
Attribute
typedef Attribute
Post-process effect of scripted camera.
UIColors
Definition: Constants.c:16
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13