Skip to content

Commit

Permalink
Add virtual keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
RevoluPowered committed Aug 3, 2024
1 parent 67206b9 commit 57b07e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mirror-godot-app/ui/login/login_code_ui.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extends Control
@onready var login_code = $VBoxContainer/SignInMenu/MarginContainer/LoginContainer/LoginCode

func _on_sign_in_pressed() -> void:
DisplayServer.virtual_keyboard_hide()
if login_code.text.is_empty():
return
var session_promise = Net.mirror_auth_client.check_login_code(login_code.text)
Expand All @@ -17,6 +18,13 @@ func _on_sign_in_pressed() -> void:
print("login code data: ", data)
await LoginService.login_as_user_deeplink("", data.refreshToken, data.spaceId, get_tree() )


func _gui_input_for_login_code(event: InputEvent):
if event is InputEventMouseButton:
if event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
DisplayServer.virtual_keyboard_show(login_code.text)


func _ready():
var login_code: bool = ProjectSettings.get_setting("feature_flags/force_enable_login_code", false)
if login_code:
Expand Down
2 changes: 1 addition & 1 deletion mirror-godot-app/ui/login/login_code_ui.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ color = Color(1, 1, 1, 0.2)
base_font = ExtResource("11_eftmn")

[node name="LoginUIVR" type="Control"]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
Expand Down Expand Up @@ -176,4 +175,5 @@ text = "Sign In"
[node name="ButtonSound" parent="." instance=ExtResource("19_rxcc2")]

[connection signal="pressed" from="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/SignUpHereContainer/SignUpHere" to="." method="_on_sign_up_here_pressed"]
[connection signal="gui_input" from="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/LoginCode" to="." method="_gui_input_for_login_code"]
[connection signal="pressed" from="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/SignIn" to="." method="_on_sign_in_pressed"]

0 comments on commit 57b07e4

Please sign in to comment.