diff --git a/Northstar.Client/mod.json b/Northstar.Client/mod.json index 8040c14c4..346d87e36 100644 --- a/Northstar.Client/mod.json +++ b/Northstar.Client/mod.json @@ -1,136 +1,142 @@ { - "Name": "Northstar.Client", - "Description": "Various ui and client changes to fix bugs and add better support for mods", - "Version": "1.16.0", - "LoadPriority": 0, - "InitScript": "cl_northstar_client_init.nut", - "ConVars": [ - { - "Name": "filter_hide_empty", - "DefaultValue": "0" - }, - { - "Name": "filter_hide_full", - "DefaultValue": "0" - }, - { - "Name": "filter_hide_protected", - "DefaultValue": "0" - }, - { - "Name": "filter_map", - "DefaultValue": "0" - }, - { - "Name": "filter_gamemode", - "DefaultValue": "0" - }, - { - "Name": "filter_mods", - "DefaultValue": "0" - }, - { - "Name": "filter_map_hide_locked", - "DefaultValue": "0" - }, - { - "Name": "modlist_show_convars", - "DefaultValue": "0", - "Flags": 16777216 - }, - { - "Name": "modlist_reverse", - "DefaultValue": "0", - "Flags": 16777216 - } - ], - "Scripts": [ - { - "Path": "_custom_codecallbacks_client.gnut", - "RunOn": "CLIENT" - }, - { - "Path": "client/cl_chat.gnut", - "RunOn": "CLIENT" - }, - { - "Path": "ui/menu_ns_modmenu.nut", - "RunOn": "UI", - "UICallback": { - "Before": "AddNorthstarModMenu", - "After": "AddNorthstarModMenu_MainMenuFooter" - } - }, - { - "Path": "ui/menu_ns_setversionlabel.nut", - "RunOn": "UI", - "UICallback": { - "After": "NS_SetVersionLabel" - } - }, - { - "Path": "presence/ui_presence.nut", - "RunOn": "UI", - "UICallback": { - "After": "NSUpdateGameStateUIStart" - } - }, - { - "Path": "presence/cl_presence.nut", - "RunOn": "CLIENT", - "ClientCallback": { - "After": "NSUpdateGameStateClientStart" - } - }, - { - "Path": "ui/menu_ns_serverbrowser.nut", - "RunOn": "UI", - "UICallback": { - "Before": "AddNorthstarServerBrowserMenu" - } - }, - { - "Path": "ui/menu_ns_connect_password.nut", - "RunOn": "UI", - "UICallback": { - "Before": "AddNorthstarConnectWithPasswordMenu" - } - }, - { - "Path": "ui/menu_ns_custom_match_settings_categories.nut", - "RunOn": "UI", - "UICallback": { - "Before": "AddNorthstarCustomMatchSettingsCategoryMenu" - } - }, - { - "Path": "ui/menu_ns_custom_match_settings.nut", - "RunOn": "UI", - "UICallback": { - "Before": "AddNorthstarCustomMatchSettingsMenu" - } - }, - { - "Path": "ui/controller_prompts.nut", - "RunOn": "UI" - }, - { - "Path": "ui/ns_slider.nut", - "RunOn": "UI" - }, - { - "Path": "ui/menu_mod_settings.nut", - "RunOn": "UI", - "UICallback":{ - "Before": "AddModSettingsMenu" - } - }, - { - "Path": "ui/ui_mouse_capture.nut", - "RunOn": "UI" - } - ], - "Localisation": [ - "resource/northstar_client_localisation_%language%.txt" - ] + "Name": "Northstar.Client", + "Description": "Various ui and client changes to fix bugs and add better support for mods", + "Version": "1.18.1", + "LoadPriority": 0, + "InitScript": "cl_northstar_client_init.nut", + "ConVars": [ + { + "Name": "ns_max_load_time", + "DefaultValue": "30", + "HelpString": "Amount of time (in seconds) until a loading screen returns to menu", + "Flags": "ARCHIVE_PLAYERPROFILE" + }, + { + "Name": "filter_hide_empty", + "DefaultValue": "0" + }, + { + "Name": "filter_hide_full", + "DefaultValue": "0" + }, + { + "Name": "filter_hide_protected", + "DefaultValue": "0" + }, + { + "Name": "filter_map", + "DefaultValue": "0" + }, + { + "Name": "filter_gamemode", + "DefaultValue": "0" + }, + { + "Name": "filter_mods", + "DefaultValue": "0" + }, + { + "Name": "filter_map_hide_locked", + "DefaultValue": "0" + }, + { + "Name": "modlist_show_convars", + "DefaultValue": "0", + "Flags": 16777216 + }, + { + "Name": "modlist_reverse", + "DefaultValue": "0", + "Flags": 16777216 + } + ], + "Scripts": [ + { + "Path": "_custom_codecallbacks_client.gnut", + "RunOn": "CLIENT" + }, + { + "Path": "client/cl_chat.gnut", + "RunOn": "CLIENT" + }, + { + "Path": "ui/menu_ns_modmenu.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddNorthstarModMenu", + "After": "AddNorthstarModMenu_MainMenuFooter" + } + }, + { + "Path": "ui/menu_ns_setversionlabel.nut", + "RunOn": "UI", + "UICallback": { + "After": "NS_SetVersionLabel" + } + }, + { + "Path": "presence/ui_presence.nut", + "RunOn": "UI", + "UICallback": { + "After": "NSUpdateGameStateUIStart" + } + }, + { + "Path": "presence/cl_presence.nut", + "RunOn": "CLIENT", + "ClientCallback": { + "After": "NSUpdateGameStateClientStart" + } + }, + { + "Path": "ui/menu_ns_serverbrowser.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddNorthstarServerBrowserMenu" + } + }, + { + "Path": "ui/menu_ns_connect_password.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddNorthstarConnectWithPasswordMenu" + } + }, + { + "Path": "ui/menu_ns_custom_match_settings_categories.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddNorthstarCustomMatchSettingsCategoryMenu" + } + }, + { + "Path": "ui/menu_ns_custom_match_settings.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddNorthstarCustomMatchSettingsMenu" + } + }, + { + "Path": "ui/controller_prompts.nut", + "RunOn": "UI" + }, + { + "Path": "ui/ns_slider.nut", + "RunOn": "UI" + }, + { + "Path": "ui/menu_mod_settings.nut", + "RunOn": "UI", + "UICallback": { + "Before": "AddModSettingsMenu" + } + }, + { + "Path": "ui/ui_mouse_capture.nut", + "RunOn": "UI" + } + ], + "Localisation": [ + "resource/northstar_client_localisation_%language%.txt" + ] } diff --git a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt index 5dabd5398..f028e825d 100644 Binary files a/Northstar.Client/mod/resource/northstar_client_localisation_english.txt and b/Northstar.Client/mod/resource/northstar_client_localisation_english.txt differ diff --git a/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut b/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut index c83381fdb..72f083786 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/_menus.nut @@ -178,6 +178,23 @@ void function UICodeCallback_ToggleInGameMenu() } } + +void function TimeoutHandler() +{ + //Singleplayer "Continue" counts as finished loading and shouldn't be affected + printt( "TimeoutHandler has Initialized" ) + EndSignal( uiGlobal.signalDummy, "LevelShutdown" ) // Cancels thread if map is unloaded + + wait GetConVarFloat( "ns_max_load_time" ) + if ( uiGlobal.isLoading == true ) //Disconnects client after 30 seconds of loading + { + printt( "TimeoutHandler disconnected because loading took too long" ) + UICodeCallback_LevelLoadingFinished( true ) //Removes loading screen + Disconnect() // Loads menu + OpenErrorDialog( format( "Loading timed out (Over %i seconds)", GetConVarInt( "ns_max_load_time" ) ) ) //Opens error dialog to notify user + } +} + // Return true to show load screen, false to not show load screen. // levelname can be "" because the level to load isn't always known when the load screen starts bool function UICodeCallback_LevelLoadingStarted( string levelname ) @@ -204,7 +221,7 @@ bool function UICodeCallback_LevelLoadingStarted( string levelname ) if ( !Console_IsSignedIn() ) return false #endif - + thread TimeoutHandler() return true } diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_mod_settings.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_mod_settings.nut index a45082c71..c48697ad1 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_mod_settings.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_mod_settings.nut @@ -82,6 +82,9 @@ struct { void function AddModSettingsMenu() { AddMenu( "ModSettings", $"resource/ui/menus/mod_settings.menu", InitModMenu ) + AddModTitle( "^656dce00Northstar.Client" ) + AddModCategory( "#MISC" ) + ModSettings_AddSetting( "ns_max_load_time", "#MAX_LOAD", "int" ) } void function InitModMenu() @@ -343,6 +346,7 @@ void function UpdateListSliderHeight() void function UpdateList() { + Hud_SetFocused( Hud_GetChild( file.menu, "BtnModsSearch" ) ) file.updatingList = true @@ -445,7 +449,7 @@ void function UpdateList() } file.updatingList = false - if ( file.conVarList.len() <= 0 ) + if ( file.conVarList.len() <= 6 ) { Hud_SetVisible( Hud_GetChild( file.menu, "NoResultLabel" ), true ) Hud_SetText( Hud_GetChild( file.menu, "NoResultLabel" ), "#NO_MODS" ) @@ -949,6 +953,7 @@ void function SendTextPanelChanges( var textPanel ) ThrowInvalidValue( "This setting is an integer, and only accepts whole numbers." ) Hud_SetText( textPanel, GetConVarString( c.conVar ) ) } + break case "bool": if ( newSetting != "0" && newSetting != "1" ) {