diff options
author | Klemmbaustein <83748124+Klemmbaustein@users.noreply.github.com> | 2023-09-02 18:53:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 18:53:06 +0200 |
commit | 9e9d7b7517e4af8df9879302d34deb93cadd9bc5 (patch) | |
tree | e5bbf0700632abada29b20f24cbebcd4b891bc6e | |
parent | 1d95b7d5f3a4b7176456c94b147f0382de04f18e (diff) | |
download | NorthstarMods-9e9d7b7517e4af8df9879302d34deb93cadd9bc5.tar.gz NorthstarMods-9e9d7b7517e4af8df9879302d34deb93cadd9bc5.zip |
Changed TriggerConnectToServerCallbacks to take in an optional server for which the callback was triggered (#688)
What's the point of this
-rw-r--r-- | Northstar.Client/mod/scripts/vscripts/ui/menu_ns_serverbrowser.nut | 10 |
1 files changed, 8 insertions, 2 deletions
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 ) ) } } |