52 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/main_menu.layout");
54 m_Play = layoutRoot.FindAnyWidget(
"play");
55 m_ChooseServer = layoutRoot.FindAnyWidget(
"choose_server");
56 m_CustomizeCharacter = layoutRoot.FindAnyWidget(
"customize_character");
57 m_PlayVideo = layoutRoot.FindAnyWidget(
"play_video");
58 m_Tutorials = layoutRoot.FindAnyWidget(
"tutorials");
59 m_TutorialButton = layoutRoot.FindAnyWidget(
"tutorial_button");
60 m_MessageButton = layoutRoot.FindAnyWidget(
"message_button");
61 m_SettingsButton = layoutRoot.FindAnyWidget(
"settings_button");
62 m_Exit = layoutRoot.FindAnyWidget(
"exit_button");
63 m_PrevCharacter = layoutRoot.FindAnyWidget(
"prev_character");
64 m_NextCharacter = layoutRoot.FindAnyWidget(
"next_character");
66 m_DlcFrame = layoutRoot.FindAnyWidget(
"dlc_Frame");
67 m_Version =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"version"));
69 m_CharacterRotationFrame = layoutRoot.FindAnyWidget(
"character_rotation_frame");
71 m_LastPlayedTooltip = layoutRoot.FindAnyWidget(
"last_server_info");
72 m_LastPlayedTooltip.Show(
false);
73 m_LastPlayedTooltipLabel = m_LastPlayedTooltip.FindAnyWidget(
"last_server_info_label");
74 m_LastPlayedTooltipName =
TextWidget.Cast(m_LastPlayedTooltip.FindAnyWidget(
"last_server_info_name"));
75 m_LastPlayedTooltipIP =
TextWidget.Cast(m_LastPlayedTooltip.FindAnyWidget(
"last_server_info_ip"));
76 m_LastPlayedTooltipPort =
TextWidget.Cast(m_LastPlayedTooltip.FindAnyWidget(
"last_server_info_port"));
78 m_LastPlayedTooltipTimer =
new WidgetFadeTimer();
80 m_Stats =
new MainMenuStats(layoutRoot.FindAnyWidget(
"character_stats_root"));
84 m_LastFocusedButton = m_Play;
91 m_PlayVideo.Show(
false);
93 m_PlayerName =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"character_name_text"));
98 m_Version.SetText(
"#main_menu_version" +
" " + version);
100 GetGame().GetUIManager().ScreenFadeOut(0);
110 GetGame().GetMission().GetOnModMenuVisibilityChanged().Insert(ShowDlcFrame);
228 m_LastFocusedButton = m_Play;
232 else if (
w == m_ChooseServer)
234 m_LastFocusedButton = m_ChooseServer;
235 OpenMenuServerBrowser();
238 else if (
w == m_CustomizeCharacter)
240 OpenMenuCustomizeCharacter();
243 else if (
w == m_TutorialButton)
248 else if (
w == m_MessageButton)
253 else if (
w == m_SettingsButton)
258 else if (
w == m_Exit)
263 else if (
w == m_PrevCharacter)
268 else if (
w == m_NextCharacter)
273 else if (
w == m_PlayVideo)
275 m_LastFocusedButton = m_PlayVideo;
279 else if (
w == m_Tutorials)
281 m_LastFocusedButton = m_Tutorials;