diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-20 21:31:33 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-12-20 21:31:33 +0000 |
commit | dade102a0d4d14ba5ee560022b8e2f1ddf960977 (patch) | |
tree | 136e096242c08a1041f6a45919326bd7ac3d1b53 /Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut | |
parent | c02ec0cce39b36a6264e414a4741c8ea131f5286 (diff) | |
download | NorthstarMods-dade102a0d4d14ba5ee560022b8e2f1ddf960977.tar.gz NorthstarMods-dade102a0d4d14ba5ee560022b8e2f1ddf960977.zip |
near-release fixes
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut')
-rw-r--r-- | Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut index 9a0850c03..ffd9bc80f 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/panel_mainmenu.nut @@ -82,6 +82,9 @@ void function InitMainMenuPanel() Hud_AddEventHandler( file.mpButton, UIE_CLICK, OnPlayMPButton_Activate ) file.fdButton = AddComboButton( comboStruct, headerIndex, buttonIndex++, "#MENU_LAUNCH_NORTHSTAR" ) Hud_AddEventHandler( file.fdButton, UIE_CLICK, OnPlayFDButton_Activate ) + Hud_SetLocked( file.fdButton, true ) + + thread TryUnlockNorthstarButton() headerIndex++ buttonIndex = 0 @@ -436,17 +439,8 @@ void function UpdatePlayButton( var button ) ComboButton_SetText( file.mpButton, buttonText ) - //if ( Hud_IsLocked( button ) || buttonText == "#MENU_GET_THE_FULL_GAME" ) - //{ - // ComboButton_SetText( file.fdButton, "" ) - // Hud_SetEnabled( file.fdButton, false ) - //} - //else - //{ - //ComboButton_SetText( file.fdButton, "#MULTIPLAYER_LAUNCH_FD" ) - ComboButton_SetText( file.fdButton, "#MENU_LAUNCH_NORTHSTAR" ) // this needs to use localised text at some point when we have a modular way of doing that - Hud_SetEnabled( file.fdButton, true ) - //} + ComboButton_SetText( file.fdButton, "#MENU_LAUNCH_NORTHSTAR" ) + Hud_SetEnabled( file.fdButton, true ) if ( file.installing ) message = "" @@ -495,19 +489,26 @@ void function MainMenuButton_Activate( var button ) file.buttonData[buttonID].activateFunc.call( this ) } -void function OnPlayFDButton_Activate( var button ) // repurposed for launching northstar lobby +void function TryUnlockNorthstarButton() { - //if ( file.mpButtonActivateFunc == null ) - // printt( "file.mpButtonActivateFunc is null" ) + // unlock "Launch Northstar" button until you're authed with masterserver, are allowing insecure auth, or 7.5 seconds have passed + float time = Time() + + while ( Time() < time + 7.5 || GetConVarInt( "ns_has_agreed_to_send_token" ) != NS_AGREED_TO_SEND_TOKEN ) + { + if ( NSIsMasterServerAuthenticated() || GetConVarBool( "ns_auth_allow_insecure" ) ) + break + + WaitFrame() + } + + Hud_SetLocked( file.fdButton, false ) +} - if ( !Hud_IsLocked( button ) )// && file.mpButtonActivateFunc != null ) +void function OnPlayFDButton_Activate( var button ) // repurposed for launching northstar lobby +{ + if ( !Hud_IsLocked( button ) ) { - //Lobby_SetAutoFDOpen( true ) - //// Lobby_SetFDMode( true ) - //thread file.mpButtonActivateFunc() - - //ClientCommand( "setplaylist tdm" ) - //ClientCommand( "map mp_lobby" ) SetConVarBool( "ns_is_modded_server", true ) NSTryAuthWithLocalServer() |