Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerToolbarItemEditorUIComponent.c
Go to the documentation of this file.
2{
3 [Attribute()]
4 protected string m_sPlayerNameWidgetName;
5
6 [Attribute()]
7 protected string m_sPlayerPlatformIconName;
8
11
12 //------------------------------------------------------------------------------------------------
14 {
15 super.SetEntity(entity, widget, slotManager);
16
17 SCR_EditablePlayerDelegateComponent delegate = SCR_EditablePlayerDelegateComponent.Cast(entity);
18 if (!delegate)
19 return;
20
21 int playerID = delegate.GetPlayerID();
22 PlayerManager playerManager = GetGame().GetPlayerManager();
23 if (!playerManager)
24 return;
25
26 m_wPlayerName = TextWidget.Cast(widget.FindAnyWidget(m_sPlayerNameWidgetName));
27 if (m_wPlayerName)
28 m_wPlayerName.SetText(SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(playerID));
29
32 {
34 if (playerController)
35 playerController.SetPlatformImageToKind(playerManager.GetPlatformKind(playerID), m_wPlatformIconWidget, showOnPC: true, showOnXbox: true);
36 }
37 }
38
39 //------------------------------------------------------------------------------------------------
40 override bool OnFocus(Widget w, int x, int y)
41 {
42 super.OnFocus(w, x, y);
43
44 if (m_wPlayerName)
45 m_wPlayerName.SetColor(Color.FromInt(UIColors.HIGHLIGHTED.PackToInt()));
46
47 return false;
48 }
49
50 //------------------------------------------------------------------------------------------------
51 override bool OnFocusLost(Widget w, int x, int y)
52 {
53 super.OnFocusLost(w, x, y);
54
55 if (m_wPlayerName)
56 m_wPlayerName.SetColor(Color.FromInt(Color.WHITE));
57
58 return false;
59 }
60}
ArmaReforgerScripted GetGame()
Definition game.c:1398
Definition Color.c:13
override void SetEntity(SCR_EditableEntityComponent entity, Widget widget, SCR_EditableEntitySlotManagerUIComponent slotManager)
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()