Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
serverbrowserentry.c
Go to the documentation of this file.
1 class ServerBrowserEntry extends ScriptedWidgetEventHandler
2 {
3  protected Widget m_Root;
4  protected Widget m_Favorite;
5  protected Widget m_Expand;
6 
7  //Basic info
8  protected TextWidget m_ServerName;
9  protected TextWidget m_ServerPopulation;
10  protected TextWidget m_ServerSlots;
11  protected TextWidget m_ServerPing;
12  protected ImageWidget m_ServerTime;
13  protected ImageWidget m_ServerLock;
14  protected ImageWidget m_ServerModIcon;
15  protected ImageWidget m_ServerMaKIcon;
16 
17  //Detailed info
18  protected TextWidget m_ServerShard;
19  protected TextWidget m_ServerCharacterAlive;
20  protected TextWidget m_ServerFriends;
21  protected TextWidget m_ServerMode;
22  protected TextWidget m_ServerBattleye;
23  protected TextWidget m_ServerIP;
24  protected TextWidget m_ServerAcceleration;
25  protected TextWidget m_ServerMap;
26  protected TextWidget m_ServerMods;
27  protected ButtonWidget m_ServerModsExpand;
28  protected ref array<string> m_Mods;
29 
30  protected bool m_IsExpanded;
31  protected bool m_IsFavorited;
32  protected bool m_IsOnline;
33 
34  protected ref GetServersResultRow m_ServerData;
35  protected int m_Index;
36  protected ServerBrowserTab m_Tab;
37  protected bool m_Selected;
38  protected bool m_FirstExpand = true;
39 
40  void ServerBrowserEntry( Widget parent, int index, ServerBrowserTab tab )
41  {
42  #ifdef PLATFORM_CONSOLE
43  m_Root = GetGame().GetWorkspace().CreateWidgets( "gui/layouts/new_ui/server_browser/xbox/server_browser_list_entry.layout", parent );
44  #else
45  m_Root = GetGame().GetWorkspace().CreateWidgets( "gui/layouts/new_ui/server_browser/pc/server_browser_list_entry_pages.layout", parent );
46  #endif
47 
48  m_Root.Enable( true );
49  m_Favorite = m_Root.FindAnyWidget( "favorite_button" );
50  m_Expand = m_Root.FindAnyWidget( "expand_button" );
51  m_ServerName = TextWidget.Cast( m_Root.FindAnyWidget( "server_name" ) );
52  m_ServerPopulation = TextWidget.Cast( m_Root.FindAnyWidget( "server_population" ) );
53  m_ServerSlots = TextWidget.Cast( m_Root.FindAnyWidget( "server_slots" ) );
54  m_ServerPing = TextWidget.Cast( m_Root.FindAnyWidget( "server_ping" ) );
55  m_ServerTime = ImageWidget.Cast( m_Root.FindAnyWidget( "server_time" ) );
56  m_ServerLock = ImageWidget.Cast( m_Root.FindAnyWidget( "lock_icon" ) );
57  m_ServerModIcon = ImageWidget.Cast( m_Root.FindAnyWidget( "modded_icon" ) );
58  m_ServerMaKIcon = ImageWidget.Cast( m_Root.FindAnyWidget( "mandk_icon" ) );
59 
60  m_ServerShard = TextWidget.Cast( m_Root.FindAnyWidget( "shard_text" ) );
61  m_ServerCharacterAlive = TextWidget.Cast( m_Root.FindAnyWidget( "character_alive_text" ) );
62  m_ServerFriends = TextWidget.Cast( m_Root.FindAnyWidget( "steam_friends_text" ) );
63  m_ServerMode = TextWidget.Cast( m_Root.FindAnyWidget( "mode_text" ) );
64  m_ServerBattleye = TextWidget.Cast( m_Root.FindAnyWidget( "battlleye_text" ) );
65  m_ServerIP = TextWidget.Cast( m_Root.FindAnyWidget( "ip_text" ) );
66  m_ServerAcceleration = TextWidget.Cast( m_Root.FindAnyWidget( "server_acceleration_text" ) );
67  m_ServerMap = TextWidget.Cast( m_Root.FindAnyWidget( "map_text" ) );
68  m_ServerMods = TextWidget.Cast( m_Root.FindAnyWidget( "mods_text" ) );
69  m_ServerModsExpand = ButtonWidget.Cast( m_Root.FindAnyWidget( "mods_expand" ) );
70 
71  m_Root.FindAnyWidget( "basic_info" ).Show( true );
72  m_Root.FindAnyWidget( "favorite_image" ).Update();
73  m_Root.FindAnyWidget( "unfavorite_image" ).Update();
74 
75  m_Index = index;
76  m_Tab = tab;
77  m_IsOnline = true;
78 
79  m_ServerTime.LoadImageFile( 0, "set:dayz_gui image:icon_sun" );
80  m_ServerTime.LoadImageFile( 1, "set:dayz_gui image:icon_sun_accel" );
81  m_ServerTime.LoadImageFile( 2, "set:dayz_gui image:icon_moon" );
82  m_ServerTime.LoadImageFile( 3, "set:dayz_gui image:icon_moon_accel" );
83 
84  m_Root.SetHandler( this );
85  }
86 
87  void ~ServerBrowserEntry()
88  {
89  delete m_Root;
90  }
91 
92  Widget GetRoot()
93  {
94  return m_Root;
95  }
96 
97  void Show(bool show)
98  {
99  m_Root.Show( show );
100  }
101 
102  override bool OnClick( Widget w, int x, int y, int button )
103  {
104  if (!IsOnline())
105  {
106  return false;
107  }
108 
109  #ifdef PLATFORM_CONSOLE
110  if ( w == m_Root )
111  {
112  m_Tab.Connect( this );
113  return true;
114  }
115  #endif
116 
117  if ( w == m_ServerModsExpand )
118  {
119  string mods_text;
120  if ( m_Mods && m_Mods.Count() > 0 )
121  {
122  mods_text = m_Mods[0];
123  for ( int i = 1; i < m_Mods.Count(); i++ )
124  {
125  mods_text += "\n" + m_Mods[i];
126  }
127  }
128 
129  GetGame().GetUIManager().ShowDialog( "#main_menu_mods", mods_text, 0, 0, 0, 0, GetGame().GetUIManager().GetMenu() );
130  }
131 
132  return false;
133  }
134 
135  override bool OnDoubleClick( Widget w, int x, int y, int button )
136  {
137  if (!IsOnline())
138  {
139  return false;
140  }
141 
142  if ( button == MouseState.LEFT )
143  {
144  if ( w == m_Root )
145  {
146  m_Tab.Connect( this );
147  return true;
148  }
149  }
150 
151  return false;
152  }
153 
154  override bool OnMouseButtonUp( Widget w, int x, int y, int button )
155  {
156  if ( button == MouseState.LEFT )
157  {
158  if ( w == m_Favorite )
159  {
160  ToggleFavorite();
161  return true;
162  }
163  else if ( w == m_Expand )
164  {
165  ToggleExpand();
166  return true;
167  }
168  else if ( w == m_Root )
169  {
170  Darken(w, x, y);
171  Select();
172  SetFocus( m_Root );
173  return true;
174  }
175  }
176  return false;
177  }
178 
179  override bool OnMouseEnter( Widget w, int x, int y )
180  {
181  if ( IsFocusable( w ) )
182  {
183  Preview( w, x, y );
184  return true;
185  }
186 
187  return false;
188  }
189 
190  override bool OnMouseLeave( Widget w, Widget enterW, int x, int y )
191  {
192  if ( IsFocusable( w ) && !IsFocusable( enterW ) )
193  {
194  Lighten( w, enterW, x, y );
195  return true;
196  }
197 
198  return false;
199  }
200 
201  void Focus()
202  {
203  SetFocus( m_Root );
204  }
205 
206  void ServerListFocus( bool focus )
207  {
208  m_Tab.ServerListFocus( focus, m_IsFavorited );
209  }
210 
211  override bool OnFocus( Widget w, int x, int y )
212  {
213  if ( !m_Selected )
214  {
215  if ( IsFocusable( w ) )
216  Darken( w, x, y );
217 
218  #ifdef PLATFORM_CONSOLE
219  if ( w == m_Root )
220  {
221  Select();
222  ServerListFocus( true );
223  }
224  #endif
225 
226  return true;
227  }
228  return false;
229  }
230 
231  override bool OnFocusLost( Widget w, int x, int y )
232  {
233  #ifdef PLATFORM_CONSOLE
234 
235  if ( w == m_Root )
236  {
237  Deselect();
238  ServerListFocus( false );
239  }
240  #endif
241 
242  if ( IsFocusable( w ) )
243  {
244  Lighten( w, null, x, y );
245  }
246 
247  return true;
248  return false;
249  }
250 
251  bool IsOnline()
252  {
253  return m_IsOnline;
254  }
255 
256  bool IsFocusable( Widget w )
257  {
258  if ( w )
259  return ( w == m_Root || w == m_Favorite || w == m_Expand || w == m_ServerModsExpand );
260 
261  return false;
262  }
263 
264  void FillInfo( GetServersResultRow server_info )
265  {
266  m_ServerData = server_info;
267  m_FirstExpand = true;
268 
269 #ifndef PLATFORM_CONSOLE
270  m_Root.FindAnyWidget( "detailed_info" ).Show( server_info.m_IsExpanded );
271 #endif
272 
273  SetName( server_info.m_Name );
274  SetPasswordLocked( server_info.m_IsPasswordProtected );
275  SetPopulationEx( server_info );
276  SetSlots( server_info.m_MaxPlayers );
277  SetPing( server_info.m_Ping );
278  SetTime( server_info.m_TimeOfDay, server_info.m_EnvironmentTimeMul );
279  SetFavorite( server_info.m_Favorite );
280  SetModded( server_info.m_Modded );
281  SetMapName( server_info.m_MapNameToRun );
282 
283  #ifdef PLATFORM_CONSOLE
284  SetMouseAndKeyboard( server_info.m_MouseAndKeyboardEnabled );
285  #endif
286 
287 #ifdef PLATFORM_WINDOWS
288 #ifndef PLATFORM_CONSOLE
289  SetExpand( server_info.m_IsExpanded );
290 
291  int pp = 0; // private
292  if ( server_info.m_ShardId.Length() == 3 && server_info.m_ShardId.ToInt() < 200 )
293  {
294  pp = 1; // official
295  }
296 
297  SetShard( pp );
298  SetCharacterAlive( server_info.m_CharactersAlive );
299  SetFriends( server_info.m_SteamFriends );
300  SetMode( server_info.m_Disable3rdPerson );
301  SetBattleye( server_info.m_AntiCheat );
302  SetIP( server_info.m_Id );
303  SetAcceleration( server_info.m_EnvironmentTimeMul );
304  SetServerMapName();
305 #endif
306 #endif
307  }
308 
309  void UpdateEntry()
310  {
311  if (m_ServerData.m_IsSelected)
312  {
313  Darken(m_Root, 0, 0);
314  Select();
315  SetFocus( m_Root );
316  }
317  else
318  {
319  Lighten(m_Root, null, 0, 0);
320  }
321  }
322 
323  void SetName( string name )
324  {
325  m_ServerName.SetText( name );
326  }
327 
328  void SetPasswordLocked( bool locked )
329  {
330  m_ServerLock.Show( locked );
331  }
332 
333  // DEPRECATED
334  void SetPopulation( int population, int slots )
335  {
336  int color = ARGBF(1, 1, 1, 1);
337  string pop_text = population.ToString() + "/" + slots.ToString();
338 
339  if ( slots > 0 )
340  {
341  float pop_percentage = population / slots;
342 
343  if (pop_percentage >= 1)
344  color = ARGBF( 1, 1, 0, 0 );
345  else if ( pop_percentage >= 0.8 )
346  color = ARGBF( 1, 1, 0.5, 0 );
347  }
348 
349  m_ServerPopulation.SetText(pop_text);
350  m_ServerPopulation.SetColor(color);
351  m_ServerPopulation.SetBold(true);
352  m_ServerPopulation.SetOutline(1);
353 
354  }
355 
356  private void SetPopulationEx(GetServersResultRow serverInfo)
357  {
358  string popText = "";
359  int population = serverInfo.m_CurrentNumberPlayers;
360  int maxPlayers = serverInfo.m_MaxPlayers;
361  int playersInQueue = serverInfo.m_PlayersInQueue;
362 
363  if (IsOnline())
364  {
365  // sometimes servers report a queue size even though server isn't full,
366  // in which case we ignore queue size
367  if (playersInQueue > 0 && population == maxPlayers)
368  {
369  popText = population.ToString() + "+" + playersInQueue.ToString() + "/" + maxPlayers.ToString();
370  }
371  else
372  {
373  popText = population.ToString() + "/" + maxPlayers.ToString();
374  }
375  }
376 
377  else
378  {
379  popText = "-";
380  }
381 
382  m_ServerPopulation.SetText(popText);
383  }
384 
385  void SetSlots( int slots )
386  {
387  if (IsOnline())
388  {
389  m_ServerSlots.SetText( slots.ToString() );
390  }
391  else
392  {
393  m_ServerSlots.SetText("-");
394  }
395  }
396 
397  void SetPing( int ping )
398  {
399  int color;
400  string displayValue;
401 
402  if ( ping < 50 )
403  color = ARGBF( 1, 0, 1, 0 );
404  else if( ping < 100 )
405  color = ARGBF( 1, 0.8, 0.8, 0 );
406  else if( ping < 200 )
407  color = ARGBF( 1, 1, 0.5, 0 );
408  else
409  color = ARGBF( 1, 1, 0, 0 );
410 
411  if (IsOnline())
412  {
413  displayValue = ping.ToString();
414  }
415 
416  else
417  {
418  displayValue = "-";
419  }
420 
421  m_ServerPing.SetColor( color );
422  m_ServerPing.SetText( displayValue );
423  }
424 
425  void SetTime( string time, float multiplier )
426  {
427  if ( time != "" )
428  {
429  TStringArray arr = new TStringArray;
430 
431  time.Split( ":", arr );
432 
433  if ( arr.Count() == 2 )
434  {
435  int hour = arr.Get( 0 ).ToInt();
436  int minute = arr.Get( 1 ).ToInt();
437 
438  if ( hour >= 19 || hour <= 5 ) //Night
439  {
440  if ( multiplier > 1 )
441  m_ServerTime.SetImage( 3 );
442  else
443  m_ServerTime.SetImage( 2 );
444  }
445  else //Day
446  {
447  if ( multiplier > 1 )
448  m_ServerTime.SetImage( 1 );
449  else
450  m_ServerTime.SetImage( 0 );
451  }
452  }
453  }
454  }
455 
456  void SetShard( int shard )
457  {
458  string text;
459  switch ( shard )
460  {
461  case 0:
462  {
463  text = "#server_browser_entry_private";
464  break;
465  }
466  case 1:
467  {
468  text = "#server_browser_entry_official";
469  break;
470  }
471  }
472  m_ServerShard.SetText( text );
473  }
474 
475  void SetMapName( string mapName )
476  {
477  RefreshDLCIcon();
478  }
479 
480  void RefreshDLCIcon()
481  {
482  if ( m_ServerData.m_IsDLC )
483  {
484  bool own = GetGame().VerifyWorldOwnership( GetMapToRun() );
485  m_ServerModIcon.Show( true );
486  m_ServerModIcon.FindWidget( "Owned" ).Show( own );
487  m_ServerModIcon.FindWidget( "Unowned" ).Show( !own );
488  }
489  else
490  {
491  m_ServerModIcon.FindWidget( "Owned" ).Show( false );
492  m_ServerModIcon.FindWidget( "Unowned" ).Show( false );
493  }
494  }
495 
496  void SetCharacterAlive( string char_alive )
497  {
498  if ( char_alive == "")
499  m_ServerCharacterAlive.SetText( "#STR_server_browser_char_not_alive" );
500  else
501  m_ServerCharacterAlive.SetText( char_alive );
502  }
503 
504  void SetFriends( string friends_text )
505  {
506  m_ServerFriends.SetText( friends_text );
507  }
508 
509  void SetMode( int mode )
510  {
511  string text;
512  switch ( mode )
513  {
514  case 0:
515  {
516  text = "#server_browser_entry_person_both";
517  break;
518  }
519  case 1:
520  {
521  text = "#server_browser_entry_person_first";
522  break;
523  }
524  }
525  m_ServerMode.SetText( text );
526  }
527 
528  void SetBattleye( bool battleye )
529  {
530  if ( battleye )
531  {
532  m_ServerBattleye.SetText( "#server_browser_entry_enabled" );
533  m_ServerBattleye.SetColor( ARGBF( 1, 0, 1, 0 ) );
534  }
535  else
536  {
537  m_ServerBattleye.SetText( "#server_browser_entry_disabled" );
538  m_ServerBattleye.SetColor( ARGBF( 1, 1, 0, 0 ) );
539  }
540  }
541 
542  void SetIP( string ip )
543  {
544  m_ServerIP.SetText( ip );
545  }
546 
547  string GetIP()
548  {
549  return m_ServerData.GetIP();
550  }
551 
552  int GetPort()
553  {
554  return m_ServerData.m_HostPort;
555  }
556 
557  string GetServerID()
558  {
559  return m_ServerData.m_Id;
560  }
561 
562  string GetMapToRun()
563  {
564  return m_ServerData.m_MapNameToRun;
565  }
566 
567  string GetMapName()
568  {
569  string map_name = m_ServerData.m_MapNameToRun;
570  map_name.ToLower();
571 
572  if ( map_name == "enoch" )
573  return "Livonia";
574  if ( map_name == "chernarusplus" )
575  return "Chernarus";
576 
577  return m_ServerData.m_MapNameToRun;
578  }
579 
580  void SetFavorite( bool favorite )
581  {
582  m_IsFavorited = favorite;
583  m_Root.FindAnyWidget( "favorite_image" ).Show( favorite );
584  m_Root.FindAnyWidget( "unfavorite_image" ).Show( !favorite );
585  }
586 
587  void SetAcceleration( float mult )
588  {
589  if ( mult > 1 )
590  {
591  m_ServerAcceleration.Show( true );
592  m_ServerAcceleration.SetText( mult.ToString() + "x" );
593  }
594  else
595  {
596  m_ServerAcceleration.Show( false );
597  }
598  }
599 
600  void SetModded( bool is_modded )
601  {
602  m_ServerModIcon.Show( is_modded );
603  }
604 
605  void SetServerMapName()
606  {
607  m_ServerMap.SetText( GetMapName() );
608  }
609 
610  void SetMods( array<string> mods )
611  {
612  m_Mods = mods;
613 
614  //string mods_text = "#STR_USRACT_MAP" + ": " + GetMapName() + " | ";
615  if ( mods && mods.Count() > 0 )
616  {
617  string mods_text = mods[0];
618  for ( int i = 1; i < mods.Count(); i++ )
619  mods_text += ", " + mods[i];
620 
621  m_ServerMods.SetText( mods_text );
622  }
623 
624  #ifdef PLATFORM_WINDOWS
625  m_ServerModsExpand.Show( ( mods && mods.Count() > 0 ) );
626  #endif
627  }
628 
629  void SetMouseAndKeyboard( bool is_mkenabled )
630  {
631  m_ServerMaKIcon.Show( is_mkenabled );
632  }
633 
634  void SetIsOnline(bool isOnline)
635  {
636  m_IsOnline = isOnline;
637  }
638 
639  bool ToggleFavorite()
640  {
641  m_IsFavorited = !m_IsFavorited;
642  string ip = m_ServerData.GetIP();
643 #ifdef PLATFORM_WINDOWS
644  //Save Data PC
645  m_Tab.GetRootMenu().AddFavorite(ip, m_ServerData.m_SteamQueryPort, m_IsFavorited);
646 
647  #ifdef PLATFORM_CONSOLE
648  OnlineServices.SetServerFavorited(ip, 0, m_ServerData.m_SteamQueryPort, m_IsFavorited);
649  #else
650  OnlineServices.SetServerFavorited(ip, m_ServerData.m_HostPort, m_ServerData.m_SteamQueryPort, m_IsFavorited);
651  #endif
652 #else
653  //Save Data Console
654  m_IsFavorited = m_Tab.GetRootMenu().SetFavoriteConsoles(ip, m_ServerData.m_HostPort, m_IsFavorited);
655 #endif
656 
657  m_Root.FindAnyWidget( "unfavorite_image" ).Show( !m_IsFavorited );
658  m_Root.FindAnyWidget( "favorite_image" ).Show( m_IsFavorited );
659 
660  return m_IsFavorited;
661  }
662 
663  bool ToggleExpand()
664  {
665  return SetExpand(!m_IsExpanded);
666  }
667 
668  bool SetExpand(bool expand)
669  {
670  m_IsExpanded = expand;
671  m_Root.FindAnyWidget( "collapse_image" ).Show( m_IsExpanded );
672  m_Root.FindAnyWidget( "expand_image" ).Show( !m_IsExpanded );
673  m_Root.FindAnyWidget( "detailed_info" ).Show( m_IsExpanded );
674 
675  if ( m_ServerData )
676  {
677  m_ServerData.m_IsExpanded = m_IsExpanded;
678  }
679 
680  if ( expand && m_FirstExpand )
681  {
682  if ( m_ServerData.m_Modded )
683  OnlineServices.GetServerModList( m_ServerData.m_Id );
684 /*
685  else
686  m_ServerMods.SetText( "#STR_USRACT_MAP" + ": " + GetMapName() );
687 */
688 
689  m_FirstExpand = false;
690  }
691 
692  return m_IsExpanded;
693  }
694 
695  void Select( bool notify = true )
696  {
697  if ( !m_Selected )
698  {
699  if ( notify )
700  {
701  m_Tab.SelectServer( this );
702  }
703 
704  m_ServerData.m_IsSelected = true;
705 
706  m_Selected = true;
707  #ifdef PLATFROM_XBOX
708  m_Root.SetColor( ARGB( 1, 50, 50, 50 ) );
709  #endif
710  }
711  }
712 
713  void Deselect()
714  {
715  if ( m_Selected )
716  {
717  m_ServerData.m_IsSelected = false;
718  m_Selected = false;
719 
720  Lighten( m_Root, null, 0, 0 );
721  }
722  }
723 
724  void UpdateColors()
725  {
726  float alpha = 1;
727  int maxPlayers = m_ServerData.m_MaxPlayers;
728  int whiteColor = ARGBF(1, 1, 1, 1);
729  int populationColor = whiteColor;
730  int populationOutline = 1;
731 
732  if (IsOnline())
733  {
734  if ( maxPlayers > 0 )
735  {
736  int population = m_ServerData.m_CurrentNumberPlayers;
737  float pop_percentage = population / maxPlayers;
738 
739  if (pop_percentage >= 1)
740  {
741  populationColor = ARGBF( 1, 1, 0, 0 );
742  }
743  else if ( pop_percentage >= 0.8 )
744  {
745  populationColor = ARGBF( 1, 1, 0.5, 0 );
746  }
747  }
748  }
749 
750  else
751  {
752  alpha = 0.5;
753  populationOutline = 0;
754 
755  m_ServerPing.SetColor(whiteColor);
756  }
757 
758  m_ServerTime.Show(IsOnline());
759  m_ServerName.SetColor(whiteColor);
760  m_ServerName.SetAlpha(alpha);
761  m_ServerPopulation.SetBold(IsOnline());
762  m_ServerPopulation.SetColor(populationColor);
763  m_ServerPopulation.SetOutline(populationOutline);
764  m_ServerPopulation.SetAlpha(alpha);
765  m_ServerSlots.SetAlpha(alpha);
766  m_ServerPing.SetAlpha(alpha);
767  m_Root.SetAlpha(alpha);
768 
769 #ifndef PLATFORM_CONSOLE
770  m_Expand.Show(IsOnline());
771 #endif
772  }
773 
774  //Coloring functions (Until WidgetStyles are useful)
775  void Preview( Widget w, int x, int y )
776  {
777  if ( m_Selected )
778  return;
779 
780  if ( w == m_Root || w == m_Favorite || w == m_Expand )
781  {
782  m_Root.SetColor( ARGB( 255, 0, 0, 0) );
783  m_Root.SetAlpha( 1 );
784  UpdateColors();
785 
786  m_ServerName.SetColor( ARGB( 255, 255, 0, 0 ) );
787  if (!IsOnline())
788  {
789  m_ServerName.SetAlpha(0.5);
790  }
791  }
792  }
793 
794  //Coloring functions (Until WidgetStyles are useful)
795  void Darken( Widget w, int x, int y )
796  {
797  if ( m_Selected )
798  return;
799 
800  if ( w == m_Root || w == m_Favorite || w == m_Expand )
801  {
802  m_Root.SetColor( ARGB( 255, 200, 0, 0) );
803  SetPopulationEx(m_ServerData);
804  UpdateColors();
805  }
806  }
807 
808  void Lighten( Widget w, Widget enterW, int x, int y )
809  {
810  float alpha = 0.3;
811 
812  if ( GetFocus() == w || m_Selected )
813  {
814  return;
815  }
816 
817  if ( w == m_Root && ( ( m_Favorite && enterW == m_Favorite ) || ( m_Expand && enterW == m_Expand ) ) )
818  {
819  return;
820  }
821 
822  m_Root.SetColor( ARGB( 255, 0, 0, 0) );
823  SetPopulationEx(m_ServerData);
824  UpdateColors();
825 
826  if ( m_Index % 2 )
827  {
828  alpha = 0;
829  }
830 
831  m_Root.SetAlpha( alpha );
832  }
833 }
GetGame
proto native CGame GetGame()
GetIP
string GetIP()
Definition: bioslobbyservice.c:92
Focus
void Focus()
Definition: serverbrowsertab.c:181
Show
proto native void Show(bool show, bool immedUpdate=true)
TStringArray
array< string > TStringArray
Definition: enscript.c:685
GetFocus
proto native Widget GetFocus()
y
Icon y
OnMouseLeave
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Definition: uihintpanel.c:276
OnMouseButtonUp
override bool OnMouseButtonUp(Widget w, int x, int y, int button)
Definition: radialmenu.c:668
ServerBrowserTab
Definition: serverbrowsertabconsole.c:1
OnDoubleClick
override bool OnDoubleClick(Widget w, int x, int y, int button)
Definition: missionloader.c:84
TextWidget
Definition: enwidgets.c:219
ServerListFocus
void ServerListFocus(bool focus, bool favorite)
Definition: serverbrowsertab.c:207
m_IsExpanded
bool m_IsExpanded
Definition: bioslobbyservice.c:60
SetName
proto native void SetName(string name)
OnFocusLost
override bool OnFocusLost(Widget w, int x, int y)
Definition: serverbrowsertab.c:235
ARGBF
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition: proto.c:332
MouseState
MouseState
Definition: ensystem.c:310
array< string >
SetFocus
proto native void SetFocus(Widget w)
name
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
x
Icon x
m_Favorite
bool m_Favorite
Definition: bioslobbyservice.c:81
OnFocus
override bool OnFocus(Widget w, int x, int y)
Definition: serverbrowsertab.c:217
Widget
Definition: enwidgets.c:189
OnClick
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition: dayzgame.c:146
SetTime
void SetTime(float time)
DEPRECATED.
m_Root
protected Widget m_Root
Definition: sizetochild.c:91
OnMouseEnter
override bool OnMouseEnter(Widget w, int x, int y)
Definition: uihintpanel.c:267
OnlineServices
Definition: onlineservices.c:1
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition: enwidgets.c:650
ARGB
int ARGB(int a, int r, int g, int b)
Definition: proto.c:322
IsFocusable
bool IsFocusable(Widget w)
Definition: serverbrowsertab.c:284