From e4b3cc7d3ee17488053cae24c8a8c981dbe95eab Mon Sep 17 00:00:00 2001 From: Klemmbaustein <83748124+Klemmbaustein@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:45:17 +0200 Subject: Add a generic "JoinServer" function (#693) Adds a function that allows the client to join a server from a `ServerInfo` struct. This also changes the server browser to use this function. --- .../mod/scripts/vscripts/ui/menu_ns_connect_password.nut | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut') diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut index b89e665b8..acc6bb36f 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut @@ -1,4 +1,5 @@ global function AddNorthstarConnectWithPasswordMenu +global function SetPasswordTargetServer struct { @@ -6,6 +7,7 @@ struct var enterPasswordBox var enterPasswordDummy var connectButton + ServerInfo& targetServer } file void function AddNorthstarConnectWithPasswordMenu() @@ -51,11 +53,16 @@ void function OnConnectWithPasswordMenuOpened() } +void function SetPasswordTargetServer( ServerInfo server ) +{ + file.targetServer = server +} + void function ConnectWithPassword( var button ) { if ( GetTopNonDialogMenu() == file.menu ) { TriggerConnectToServerCallbacks() - thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ), true ) + thread JoinServer( file.targetServer, Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ) ) } } \ No newline at end of file -- cgit v1.2.3