1class PlayerListEntryScriptedWidget
extends ScriptedWidgetEventHandler
4 protected string m_UID;
6 protected bool m_GlobalMute;
9 protected TextWidget m_PlayerName;
10 protected ImageWidget m_PlayerAvatar;
11 protected ImageWidget m_MicrophoneIcon;
12 protected ImageWidget m_MuteIcon;
13 protected ButtonWidget m_PlayerButton;
15 protected PlayerListScriptedWidget m_Tab;
16 protected bool m_Selected;
18 void PlayerListEntryScriptedWidget( Widget parent,
string name,
string uid,
bool show_permissions, PlayerListScriptedWidget tab )
24 m_Root =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/xbox/ingamemenu_xbox/player_info_entry.layout", parent );
25 m_PlayerName = TextWidget.Cast(
m_Root.FindAnyWidget(
"Name" ) );
26 m_PlayerAvatar = ImageWidget.Cast(
m_Root.FindAnyWidget(
"Avatar" ) );
27 m_MicrophoneIcon = ImageWidget.Cast(
m_Root.FindAnyWidget(
"Microphone" ) );
28 m_MuteIcon = ImageWidget.Cast(
m_Root.FindAnyWidget(
"Muted" ) );
29 m_PlayerButton = ButtonWidget.Cast(
m_Root.FindAnyWidget(
"Button" ) );
31 m_MicrophoneIcon.Show( show_permissions && !IsLocalPlayer() );
33 m_PlayerName.SetText(
name );
37 void ~PlayerListEntryScriptedWidget()
42 Widget GetButtonWidget()
44 return m_PlayerButton;
49 foreach ( BiosPrivacyPermissionResult result : results )
53 m_GlobalMute = !result.m_IsAllowed;
54 if ( result.m_IsAllowed && !m_Mute )
56 m_MuteIcon.Show(
false );
58 else if ( !result.m_IsAllowed || m_Mute )
60 m_MuteIcon.Show(
true );
76 bool IsGloballyMuted()
81 void SetMute(
bool mute )
84 m_MuteIcon.Show( mute );
89 if( !IsLocalPlayer() && !
g_Game.GetWorld().IsDisabledReceivingVoN() )
92 if ( ScriptInputUserData.CanStoreInputUserData() && !m_GlobalMute )
94 OnlineServices.MutePlayer( m_UID, m_Mute );
95 m_MuteIcon.Show( m_Mute );
99 m_MuteIcon.Show(
true );
104 m_MicrophoneIcon.Show(
false );
105 m_MuteIcon.Show(
false );
113 #ifdef PLATFORM_CONSOLE
114 if( w == m_PlayerButton )
117 SetFocus( m_PlayerButton );
125 override bool OnMouseLeave( Widget w, Widget enterW,
int x,
int y )
127 #ifdef PLATFORM_CONSOLE
128 if( w == m_PlayerButton )
139 SetFocus(m_PlayerButton);
142 override bool OnFocus( Widget w,
int x,
int y )
146 #ifdef PLATFORM_CONSOLE
147 if( w == m_PlayerButton )
159 #ifdef PLATFORM_CONSOLE
160 if( w == m_PlayerButton )
170 if( button ==
MouseState.LEFT &&
g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer() )
172 if( !IsLocalPlayer() )
174 OnlineServices.ShowUserProfile( m_UID );
182 if( button ==
MouseState.LEFT &&
g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer() )
184 if( w == m_MicrophoneIcon && !m_GlobalMute )
196 if(
g_Game.GetUserManager() )
198 return g_Game.GetUserManager().GetSelectedUser().GetUid() == m_UID;
203 void Select(
bool notify =
true )
209 m_Tab.SelectPlayer(
this );
EBiosPrivacyPermission
EBiosPrivacyPermission represents possible privacy permissions.
array< ref BiosPrivacyPermissionResult > BiosPrivacyPermissionResultArray
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
override bool OnDoubleClick(Widget w, int x, int y, int button)
override bool OnFocusLost(Widget w, int x, int y)
override bool OnFocus(Widget w, int x, int y)
override bool OnMouseEnter(Widget w, int x, int y)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)