aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut
diff options
context:
space:
mode:
authorF1F7Y <64418963+F1F7Y@users.noreply.github.com>2022-01-09 15:45:58 +0100
committerGitHub <noreply@github.com>2022-01-09 11:45:58 -0300
commit974134d142e54f650cfa3c8e46e0d58542a39fb1 (patch)
tree03d07ffc61091b717ae084a8341d0230b33fb62b /Northstar.Client/mod/scripts/vscripts/ui/menu_ns_connect_password.nut
parenta9e1b4fa8558ee07732c0f60a935980fd15d4e44 (diff)
downloadNorthstarMods-974134d142e54f650cfa3c8e46e0d58542a39fb1.tar.gz
NorthstarMods-974134d142e54f650cfa3c8e46e0d58542a39fb1.zip
Improve server browser backend; fix error (#58)
Improves sort backend Fixes crash when TAB is pressed while console is open Improves MouseDelta handler logic Increases doubleclick from 0.2 to 0.3 Fixes issue Pasting does not work for server passwords #91 Fix issue #91
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.nut42
1 files changed, 34 insertions, 8 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 e1ed8991d..56db0cccf 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,5 +1,13 @@
global function AddNorthstarConnectWithPasswordMenu
+struct
+{
+ var menu
+ var enterPasswordBox
+ var enterPasswordDummy
+ var connectButton
+} file
+
void function AddNorthstarConnectWithPasswordMenu()
{
AddMenu( "ConnectWithPasswordMenu", $"resource/ui/menus/connect_password.menu", InitConnectWithPasswordMenu, "#MENU_CONNECT" )
@@ -7,24 +15,42 @@ void function AddNorthstarConnectWithPasswordMenu()
void function InitConnectWithPasswordMenu()
{
- AddMenuEventHandler( GetMenu( "ConnectWithPasswordMenu" ), eUIEvent.MENU_OPEN, OnConnectWithPasswordMenuOpened )
- AddMenuFooterOption( GetMenu( "ConnectWithPasswordMenu" ), BUTTON_B, "#B_BUTTON_BACK", "#BACK" )
+ file.menu = GetMenu( "ConnectWithPasswordMenu" )
+
+ file.enterPasswordBox = Hud_GetChild( file.menu, "EnterPasswordBox")
+ file.enterPasswordDummy = Hud_GetChild( file.menu, "EnterPasswordBoxDummy")
+ file.connectButton = Hud_GetChild( file.menu, "ConnectButton")
+
+ AddMenuEventHandler( file.menu, eUIEvent.MENU_OPEN, OnConnectWithPasswordMenuOpened )
+ AddMenuFooterOption( file.menu, BUTTON_B, "#B_BUTTON_BACK", "#BACK" )
+
+ AddButtonEventHandler( file.connectButton, UIE_CLICK, ConnectWithPassword )
+
+ AddButtonEventHandler( file.enterPasswordBox, UIE_CHANGE, UpdatePasswordLabel )
- AddButtonEventHandler( Hud_GetChild( GetMenu( "ConnectWithPasswordMenu" ), "ConnectButton" ), UIE_CLICK, ConnectWithPassword )
RegisterButtonPressedCallback( KEY_ENTER, ConnectWithPassword )
}
+void function UpdatePasswordLabel( var n )
+{
+ string hiddenPSWD
+ for ( int i = 0; i < Hud_GetUTF8Text( file.enterPasswordBox ).len(); i++)
+ hiddenPSWD += "*"
+ Hud_SetText( file.enterPasswordDummy, hiddenPSWD )
+}
+
void function OnConnectWithPasswordMenuOpened()
{
UI_SetPresentationType( ePresentationType.KNOWLEDGEBASE_SUB )
- Hud_SetText( Hud_GetChild( GetMenu( "ConnectWithPasswordMenu" ), "Title" ), "#MENU_TITLE_CONNECT_PASSWORD" )
- Hud_SetText( Hud_GetChild( GetMenu( "ConnectWithPasswordMenu" ), "ConnectButton" ), "#MENU_CONNECT_MENU_CONNECT" )
- Hud_SetText( Hud_GetChild( GetMenu( "ConnectWithPasswordMenu" ), "EnterPasswordBox" ), "" )
+ Hud_SetText( Hud_GetChild( file.menu, "Title" ), "#MENU_TITLE_CONNECT_PASSWORD" )
+ Hud_SetText( file.connectButton, "#MENU_CONNECT_MENU_CONNECT" )
+ Hud_SetText( file.enterPasswordBox, "" )
+ Hud_SetText( file.enterPasswordDummy, "" )
}
void function ConnectWithPassword( var button )
{
- if ( GetTopNonDialogMenu() == GetMenu( "ConnectWithPasswordMenu" ) )
- thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( GetMenu( "ConnectWithPasswordMenu" ), "EnterPasswordBox" ) ) )
+ if ( GetTopNonDialogMenu() == file.menu )
+ thread ThreadedAuthAndConnectToServer( Hud_GetUTF8Text( Hud_GetChild( file.menu, "EnterPasswordBox" ) ) )
} \ No newline at end of file