Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore "install more mods" notification for #651 #691

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 140 additions & 134 deletions Northstar.Client/mod.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
Binary file not shown.
19 changes: 18 additions & 1 deletion Northstar.Client/mod/scripts/vscripts/ui/_menus.nut
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -204,7 +221,7 @@ bool function UICodeCallback_LevelLoadingStarted( string levelname )
if ( !Console_IsSignedIn() )
return false
#endif

thread TimeoutHandler()
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -343,6 +346,7 @@ void function UpdateListSliderHeight()

void function UpdateList()
{

Hud_SetFocused( Hud_GetChild( file.menu, "BtnModsSearch" ) )
file.updatingList = true

Expand Down Expand Up @@ -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" )
Expand Down Expand Up @@ -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" )
{
Expand Down
Loading