38 protected bool m_FirstExpand =
true;
42#ifdef PLATFORM_CONSOLE
43 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/xbox/server_browser_list_entry.layout", parent);
45 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/pc/server_browser_list_entry_pages.layout", parent);
50 m_Expand =
m_Root.FindAnyWidget(
"expand_button");
52 m_ServerPopulation =
TextWidget.Cast(
m_Root.FindAnyWidget(
"server_population"));
61 m_ServerCharacterAlive =
TextWidget.Cast(
m_Root.FindAnyWidget(
"character_alive_text"));
62 m_ServerFriends =
TextWidget.Cast(
m_Root.FindAnyWidget(
"steam_friends_text"));
66 m_ServerAcceleration =
TextWidget.Cast(
m_Root.FindAnyWidget(
"server_acceleration_text"));
71 m_Root.FindAnyWidget(
"basic_info").Show(
true);
72 m_Root.FindAnyWidget(
"favorite_image").Update();
73 m_Root.FindAnyWidget(
"unfavorite_image").Update();
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");
107#ifdef PLATFORM_CONSOLE
115 if (
w == m_ServerModsExpand)
118 if (m_Mods && m_Mods.Count() > 0)
121 for (
int i = 1;
i < m_Mods.Count();
i++)
125 GetGame().GetUIManager().ShowDialog(
"#main_menu_mods",
mods_text, 0, 0, 0, 0,
GetGame().GetUIManager().GetMenu());
157 else if (
w == m_Expand)
202 m_Tab.ServerListFocus(
focus, m_IsFavorited);
212#ifdef PLATFORM_CONSOLE
227#ifdef PLATFORM_CONSOLE
259 m_FirstExpand =
true;
261#ifndef PLATFORM_CONSOLE
275#ifdef PLATFORM_CONSOLE
279#ifdef PLATFORM_WINDOWS
280#ifndef PLATFORM_CONSOLE
303 if (m_ServerData.m_IsSelected)
315 m_ServerName.SetText(
name);
320 m_ServerLock.Show(
locked);
339 m_ServerPopulation.SetText(
pop_text);
340 m_ServerPopulation.SetColor(
color);
341 m_ServerPopulation.SetBold(
true);
342 m_ServerPopulation.SetOutline(1);
366 m_ServerPopulation.SetText(
popText);
372 m_ServerSlots.SetText(
slots.ToString());
374 m_ServerSlots.SetText(
"-");
397 m_ServerPing.SetColor(
color);
409 if (
arr.Count() == 2)
417 m_ServerTime.SetImage(3);
419 m_ServerTime.SetImage(2);
424 m_ServerTime.SetImage(1);
426 m_ServerTime.SetImage(0);
439 text =
"#server_browser_entry_private";
444 text =
"#server_browser_entry_official";
448 m_ServerShard.SetText(
text);
458 if (m_ServerData.m_IsDLC)
461 m_ServerModIcon.Show(
true);
462 m_ServerModIcon.FindWidget(
"Owned").Show(
own);
463 m_ServerModIcon.FindWidget(
"Unowned").Show(!
own);
467 m_ServerModIcon.FindWidget(
"Owned").Show(
false);
468 m_ServerModIcon.FindWidget(
"Unowned").Show(
false);
475 m_ServerCharacterAlive.SetText(
"#STR_server_browser_char_not_alive");
492 text =
"#server_browser_entry_person_both";
497 text =
"#server_browser_entry_person_first";
501 m_ServerMode.SetText(
text);
508 m_ServerBattleye.SetText(
"#server_browser_entry_enabled");
509 m_ServerBattleye.SetColor(
ARGBF(1, 0, 1, 0));
513 m_ServerBattleye.SetText(
"#server_browser_entry_disabled");
514 m_ServerBattleye.SetColor(
ARGBF(1, 1, 0, 0));
520 m_ServerIP.SetText(
ip);
525 return m_ServerData.GetIP();
530 return m_ServerData.m_HostPort;
535 return m_ServerData.m_Id;
540 return m_ServerData.m_MapNameToRun;
545 string map_name = m_ServerData.m_MapNameToRun;
553 return m_ServerData.m_MapNameToRun;
567 m_ServerAcceleration.Show(
true);
568 m_ServerAcceleration.SetText(
mult.ToString() +
"x");
571 m_ServerAcceleration.Show(
false);
592 for (
int i = 1;
i <
mods.Count();
i++)
598#ifdef PLATFORM_WINDOWS
599 m_ServerModsExpand.Show((
mods &&
mods.Count() > 0));
616 string ip = m_ServerData.GetIP();
617#ifdef PLATFORM_WINDOWS
619 m_Tab.GetRootMenu().AddFavorite(
ip, m_ServerData.m_SteamQueryPort, m_IsFavorited);
621#ifdef PLATFORM_CONSOLE
628 m_IsFavorited = m_Tab.GetRootMenu().SetFavoriteConsoles(
ip, m_ServerData.m_HostPort, m_IsFavorited);
631 m_Root.FindAnyWidget(
"unfavorite_image").Show(!m_IsFavorited);
632 m_Root.FindAnyWidget(
"favorite_image").Show(m_IsFavorited);
652 if (
expand && m_FirstExpand)
654 if (m_ServerData.m_Modded)
661 m_FirstExpand =
false;
674 m_ServerData.m_IsSelected =
true;
687 m_ServerData.m_IsSelected =
false;
706 int population = m_ServerData.m_CurrentNumberPlayers;
726 m_ServerName.SetAlpha(
alpha);
727 m_ServerPopulation.SetBold(
IsOnline());
730 m_ServerPopulation.SetAlpha(
alpha);
731 m_ServerSlots.SetAlpha(
alpha);
732 m_ServerPing.SetAlpha(
alpha);
735#ifndef PLATFORM_CONSOLE
752 m_ServerName.SetColor(
ARGB(255, 255, 0, 0));
754 m_ServerName.SetAlpha(0.5);
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
static void GetServerModList(string server_id)
static void SetServerFavorited(string ipAddress, int port, int steamQueryPort, bool is_favorited)
override void SelectServer(ServerBrowserEntry server)
proto native CGame GetGame()
array< string > TStringArray
int ARGB(int a, int r, int g, int b)
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.