From 9e9d7b7517e4af8df9879302d34deb93cadd9bc5 Mon Sep 17 00:00:00 2001 From: Klemmbaustein <83748124+Klemmbaustein@users.noreply.github.com> Date: Sat, 2 Sep 2023 18:53:06 +0200 Subject: Changed TriggerConnectToServerCallbacks to take in an optional server for which the callback was triggered (#688) What's the point of this --- .../mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Northstar.Client/mod/scripts/vscripts/ui') diff --git a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut index c4046132..efc8d66c 100644 --- a/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut +++ b/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut @@ -1274,10 +1274,16 @@ void function RemoveConnectToServerCallback( void functionref( ServerInfo ) call file.connectCallbacks.fastremovebyvalue( callback ) } -void function TriggerConnectToServerCallbacks() +void function TriggerConnectToServerCallbacks( ServerInfo ornull targetServer = null ) { + ServerInfo server; + if (targetServer == null) + { + targetServer = file.lastSelectedServer + } + foreach( callback in file.connectCallbacks ) { - callback( file.lastSelectedServer ) + callback( expect ServerInfo( targetServer ) ) } } -- cgit v1.2.3