Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add virtual keyboard VR #230

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading