aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut
diff options
context:
space:
mode:
authorKlemmbaustein <83748124+Klemmbaustein@users.noreply.github.com>2024-07-30 00:45:17 +0200
committerGitHub <noreply@github.com>2024-07-30 00:45:17 +0200
commite4b3cc7d3ee17488053cae24c8a8c981dbe95eab (patch)
treef82c7b13143f73194f1a2aa5a7272c62d400f71b /Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut
parentd5b35ee69a1ad7f9c6515ed70474babfb33519f7 (diff)
downloadNorthstarMods-e4b3cc7d3ee17488053cae24c8a8c981dbe95eab.tar.gz
NorthstarMods-e4b3cc7d3ee17488053cae24c8a8c981dbe95eab.zip
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.
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut9
1 files changed, 8 insertions, 1 deletions
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