31 #ifdef PLATFORM_CONSOLE
32 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/xbox/server_browser.layout");
33 m_FavoritesTab =
new ServerBrowserFavoritesTabConsolePages(layoutRoot.FindAnyWidget(
"Tab_0"),
this,
TabType.FAVORITE);
37 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/pc/server_browser.layout");
38 m_FavoritesTab =
new ServerBrowserFavoritesTabPc(layoutRoot.FindAnyWidget(
"Tab_0"),
this,
TabType.FAVORITE);
44 layoutRoot.FindAnyWidget(
"Tabber").GetScript(m_Tabber);
46 m_Play = layoutRoot.FindAnyWidget(
"play");
47 m_PlayButtonLabel = TextWidget.Cast(m_Play.FindAnyWidget(
"play_label"));
48 m_OpenStoreButtonLabel = TextWidget.Cast(m_Play.FindAnyWidget(
"open_store_label"));
49 m_Back = layoutRoot.FindAnyWidget(
"back_button");
50 m_CustomizeCharacter = layoutRoot.FindAnyWidget(
"customize_character");
51 m_PlayerName = TextWidget.Cast(layoutRoot.FindAnyWidget(
"character_name_text"));
54 #ifndef PLATFORM_CONSOLE
55 layoutRoot.FindAnyWidget(
"customize_character").Show(
false);
56 layoutRoot.FindAnyWidget(
"character").Show(
false);
64 #ifdef PLATFORM_CONSOLE
65 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
66 if (
GetGame().GetInput().IsEnabledMouseAndKeyboard())
68 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
false);
77 version =
"#main_menu_version" +
" " + version;
84 m_Tabber.m_OnTabSwitch.Insert(OnTabSwitch);
86 m_FavoritesTab.RefreshList();
88 #ifdef PLATFORM_CONSOLE
91 TextWidget sort_text = TextWidget.Cast(layoutRoot.FindAnyWidget(
"SortText"));
92 sort_text.SetText(
"#str_serverbrowserroot_toolbar_bg_consoletoolbar_sort_sorttext0");
95 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Start(
new Param1<float>(0.5));
100 #ifdef PLATFORM_WINDOWS
101 GetGame().GetInput().EnableGamepad(
false);
137 switch (pInputDeviceType)
140 #ifdef PLATFORM_CONSOLE
142 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
true);
143 layoutRoot.FindAnyWidget(
"ConsoleControls").Show(
true);
144 layoutRoot.FindAnyWidget(
"PlayIcon0").Show(
false);
145 layoutRoot.FindAnyWidget(
"BackIcon0").Show(
false);
146 if (
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
148 GetGame().GetUIManager().ShowUICursor(
false);
154 #ifdef PLATFORM_CONSOLE
155 if (
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
157 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(
false);
158 layoutRoot.FindAnyWidget(
"ConsoleControls").Show(
false);
159 layoutRoot.FindAnyWidget(
"PlayIcon0").Show(
true);
160 layoutRoot.FindAnyWidget(
"BackIcon0").Show(
true);
161 GetGame().GetUIManager().ShowUICursor(
true);
254 g_Game.GetUIManager().ShowDialog(
"#layout_notification_info_warning",
"#STR_MaxFavouriteReached", 0, DBT_OK, DBB_YES, DMT_EXCLAMATION,
this);
266 string serverId = ipAddress +
":" + port;
269 if (favorite && !isFavorited)
271 m_Favorites.Insert(serverId);
273 else if (isFavorited)
275 m_Favorites.RemoveItem(serverId);
276 m_OfficialTab.Unfavorite(serverId);
277 m_CommunityTab.Unfavorite(serverId);
278 m_FavoritesTab.Unfavorite(serverId);
279#ifndef PLATFORM_CONSOLE
280 m_LANTab.Unfavorite(serverId);
504 if (
GetUApi().GetInputByID(UAUIThumbRight).LocalPress())
509 if (
GetUApi().GetInputByID(UAUITabLeft).LocalPress())
511 m_Tabber.PreviousTab();
514 if (
GetUApi().GetInputByID(UAUITabRight).LocalPress())
519 if (
GetUApi().GetInputByID(UAUINextDown).LocalPress())
524 if (
GetUApi().GetInputByID(UAUINextUp).LocalPress())
529 if (
GetUApi().GetInputByID(UAUISelect).LocalPress())
534 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
539 if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
544 if (
GetUApi().GetInputByID(UAUILeft).LocalPress())
550 if (
GetUApi().GetInputByID(UAUILeft).LocalHold())
556 if (
GetUApi().GetInputByID(UAUILeft).LocalRelease())
561 if (
GetUApi().GetInputByID(UAUIRight).LocalPress())
567 if (
GetUApi().GetInputByID(UAUIRight).LocalHold())
573 if (
GetUApi().GetInputByID(UAUIRight).LocalRelease())
578 if (
GetUApi().GetInputByID(UAUIUp).LocalPress())
583 if (
GetUApi().GetInputByID(UAUIDown).LocalPress())
588 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
594 super.Update(timeslice);
692 if (!
g_Game.VerifyWorldOwnership(mapNM))
702 GetGame().GetUIManager().ShowDialog(
"#server_browser_connect_label",
"#mod_detail_info_warning", 232, DBT_OK, DBB_NONE, DMT_INFO,
GetGame().GetUIManager().GetMenu());
703 g_Game.GoBuyWorldDLC(mapNM);
710 g_Game.ConnectFromServerBrowserEx(ip, port, steamQueryPort,
"");