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

Fix Infinite Loading Screen + Fix Modsettings "int" functionality #651

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
961a80d
Fix infinite loading screen
EnderBoy9217 Jun 17, 2023
a91a22c
Update Northstar.Client/mod/scripts/vscripts/ui/_menus.nut
EnderBoy9217 Jun 17, 2023
a94610d
Update _menus.nut
EnderBoy9217 Jun 17, 2023
da65be2
Update _menus.nut
EnderBoy9217 Jun 17, 2023
3246c7d
Update _menus.nut
EnderBoy9217 Jun 17, 2023
4eed346
Merge branch 'main' into main
EnderBoy9217 Jul 6, 2023
9817a55
Add files via upload
EnderBoy9217 Jul 7, 2023
b9ee00c
Merge branch 'R2Northstar:main' into main
EnderBoy9217 Jul 27, 2023
d766fc3
remove other pr stuffs
EnderBoy9217 Jul 27, 2023
eb5fd2c
Update _menus.nut
EnderBoy9217 Jul 27, 2023
bae3ca7
Merge pull request #1 from EnderBoy9217/NS-default
EnderBoy9217 Jul 27, 2023
5248da4
Merge branch 'main' into main
EnderBoy9217 Aug 18, 2023
d4fa01c
Re-add loading screen fix
EnderBoy9217 Aug 18, 2023
fd63458
New localization
EnderBoy9217 Aug 25, 2023
bfb7656
Use convar
EnderBoy9217 Aug 25, 2023
8b7863b
New ConVar
EnderBoy9217 Aug 25, 2023
873d372
Create Northstar.Client section
EnderBoy9217 Aug 25, 2023
75379a3
Fix indent
EnderBoy9217 Aug 26, 2023
299685e
Fix indent (again)
EnderBoy9217 Aug 26, 2023
58024fe
localized and changed to float from int
EnderBoy9217 Aug 26, 2023
bbc9992
update localization
EnderBoy9217 Aug 26, 2023
5db9983
fix whitespace change
EnderBoy9217 Aug 26, 2023
e082165
Add whitespace between required stuff and northstar section
EnderBoy9217 Aug 26, 2023
9cdda7b
Update Northstar.Client/mod/scripts/vscripts/ui/_menus.nut
EnderBoy9217 Aug 26, 2023
4a7dd0e
reformatting or something because nerd
EnderBoy9217 Aug 26, 2023
33a2781
Update Northstar.Client/mod/scripts/vscripts/ui/_menus.nut
EnderBoy9217 Aug 26, 2023
6618aac
optimization
EnderBoy9217 Aug 26, 2023
29365df
Update _menus.nut text
EnderBoy9217 Aug 26, 2023
e398515
Fix not connected error
EnderBoy9217 Aug 27, 2023
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
6 changes: 6 additions & 0 deletions Northstar.Client/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
"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"
Expand Down
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
EnderBoy9217 marked this conversation as resolved.
Show resolved Hide resolved
EndSignal( uiGlobal.signalDummy, "LevelShutdown" ) // Cancels thread if map is unloaded

float maxLoadTime = GetConVarFloat( "ns_max_load_time" )
wait maxLoadTime
if ( uiGlobal.isLoading ) //Disconnects client specified amount of time ( Default 30 seconds )
{
printt( format( "TimeoutHandler disconnected because loading took too long (%f seconds)", maxLoadTime ) )
UICodeCallback_LevelLoadingFinished( true ) //Removes loading screen
Disconnect() // Loads menu
OpenErrorDialog( format( Localize( "#MAX_LOAD_ERROR" ), maxLoadTime ) ) //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,10 @@ struct {
void function AddModSettingsMenu()
{
AddMenu( "ModSettings", $"resource/ui/menus/mod_settings.menu", InitModMenu )

AddModTitle( "^656dce00Northstar.Client" )
EnderBoy9217 marked this conversation as resolved.
Show resolved Hide resolved
AddModCategory( "#STATS_MISC" )
ModSettings_AddSetting( "ns_max_load_time", "#MAX_LOAD", "float" )
}

void function InitModMenu()
Expand Down Expand Up @@ -445,7 +449,7 @@ void function UpdateList()
}
file.updatingList = false

if ( file.conVarList.len() <= 0 )
if ( file.conVarList.len() <= 6 )
EnderBoy9217 marked this conversation as resolved.
Show resolved Hide resolved
{
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