aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 16:03:50 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-05 16:03:50 +0000
commit51e16034230f4dd759900c7922b8db43941e0a70 (patch)
tree6492337f6855e2403db0376b8d1021196df80879 /Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut
parentb48fd143624f2b887699acd98d9a4c55b792ab0e (diff)
downloadNorthstarMods-51e16034230f4dd759900c7922b8db43941e0a70.tar.gz
NorthstarMods-51e16034230f4dd759900c7922b8db43941e0a70.zip
big commit for playtesting
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut38
1 files changed, 23 insertions, 15 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut
index c6ef5f3a7..fb05adbc0 100644
--- a/Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut
+++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_main.nut
@@ -26,6 +26,7 @@ void function InitMainMenu()
var menu = GetMenu( "MainMenu" )
file.menu = menu
+ ClientCommand( "exec autoexec_ns_client" )
AddMenuEventHandler( menu, eUIEvent.MENU_OPEN, OnMainMenu_Open )
AddMenuEventHandler( menu, eUIEvent.MENU_NAVIGATE_BACK, OnMainMenu_NavigateBack )
@@ -54,21 +55,6 @@ void function InitMainMenu()
if ( DevStartPoints() )
AddMenuFooterOption( menu, BUTTON_Y, "#Y_BUTTON_DEV_MENU", "#DEV_MENU", OpenSinglePlayerDevMenu )
#endif // DEV
-
- // do +map stuff
- if ( Dev_CommandLineHasParm( "+map" ) )
- thread DelayedMapCommand()
-}
-
-void function DelayedMapCommand()
-{
- // if we do this too early, game won't run the map command, so we have to wait a bit
- // 5.0 was determined exclusively by trial and error but seems to work pretty well
- // might be possible to just do this in native instead, but idk effort
- wait 5.0
- SetConVarBool( "ns_auth_allow_insecure", true ) // good for testing
- ClientCommand( "map " + Dev_CommandLineParmValue( "+map" ) )
- Dev_CommandLineRemoveParm( "+map" )
}
#if CONSOLE_PROG
@@ -94,6 +80,28 @@ void function OnMainMenu_Open()
thread UpdateTrialLabel()
+ // do +map stuff
+ if ( Dev_CommandLineHasParm( "+map" ) )
+ {
+ SetConVarBool( "ns_auth_allow_insecure", true ) // good for testing
+ ClientCommand( "map " + Dev_CommandLineParmValue( "+map" ) )
+ Dev_CommandLineRemoveParm( "+map" )
+ }
+
+ // do agree to ns remote auth dialog
+ if ( !GetConVarBool( "ns_has_agreed_to_send_token" ) )
+ {
+ // todo: this should be in localisation
+ DialogData dialogData
+ dialogData.header = "Thanks for installing Northstar!"
+ dialogData.image = $"rui/menu/fd_menu/upgrade_northstar_chassis"
+ dialogData.message = "For Northstar to work, it needs to authenticate using the Northstar master server. This will require sending your origin token to the master server, it will not be stored or used for any other purposes.\n" +
+ "Press Yes if you agree to this. This choice can be changed in the mods menu at any time."
+ AddDialogButton( dialogData, "#YES", void function() { SetConVarInt( "ns_has_agreed_to_send_token", 1 ) } )
+ AddDialogButton( dialogData, "#NO", void function() { SetConVarInt( "ns_has_agreed_to_send_token", 2 ) } )
+ OpenDialog( dialogData )
+ }
+
#if PC_PROG
ActivatePanel( GetPanel( "MainMenuPanel" ) )
return