-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add forced login code for VR * Allows login using the login code and auto-joins the space id. This means for VR we can give out a code to join a space easily and quickly. No password or email required for VR.
- Loading branch information
1 parent
17e933e
commit 67206b9
Showing
5 changed files
with
227 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
extends Control | ||
|
||
@onready var login_code = $VBoxContainer/SignInMenu/MarginContainer/LoginContainer/LoginCode | ||
|
||
func _on_sign_in_pressed() -> void: | ||
if login_code.text.is_empty(): | ||
return | ||
var session_promise = Net.mirror_auth_client.check_login_code(login_code.text) | ||
var data = await session_promise.wait_till_fulfilled() | ||
if session_promise.is_error(): | ||
Notify.error("Failed to login with code", session_promise.get_error_message()) | ||
return | ||
assert(data.userId) | ||
assert(data.refreshToken) | ||
assert(data.spaceId) | ||
assert(data.loginCode) | ||
print("login code data: ", data) | ||
await LoginService.login_as_user_deeplink("", data.refreshToken, data.spaceId, get_tree() ) | ||
|
||
func _ready(): | ||
var login_code: bool = ProjectSettings.get_setting("feature_flags/force_enable_login_code", false) | ||
if login_code: | ||
show() | ||
await get_tree().process_frame | ||
GameUI.instance.login_ui.hide() | ||
else: | ||
hide() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
[gd_scene load_steps=23 format=3 uid="uid://bb7qixdwwk0il"] | ||
|
||
[ext_resource type="Theme" uid="uid://ggwm8asxintx" path="res://ui/common/themes/menu_ui.theme.tres" id="1_qcy1r"] | ||
[ext_resource type="Script" path="res://ui/login/login_code_ui.gd" id="2_pm0hu"] | ||
[ext_resource type="Texture2D" uid="uid://cteylgdhn7712" path="res://ui/login/new_bg.jpg" id="3_wbicg"] | ||
[ext_resource type="Texture2D" uid="uid://b8a6plrtwhc1x" path="res://ui/login/mirror_light_horizontal_new.png" id="4_x0h3t"] | ||
[ext_resource type="Script" path="res://ui/login/app_logo_branding_from_config.gd" id="5_q0xtk"] | ||
[ext_resource type="Shader" path="res://ui/common/shaders/ui_blurr.gdshader" id="6_n3wu6"] | ||
[ext_resource type="StyleBox" uid="uid://nen4cpg1225q" path="res://ui/common/panels/panel_basic_rounded.stylebox.tres" id="7_wg3xc"] | ||
[ext_resource type="StyleBox" uid="uid://b14r8oqdqptk8" path="res://ui/common/panels/panel_round_border_only.tres" id="8_7qtch"] | ||
[ext_resource type="FontFile" uid="uid://s44wjlc18fo7" path="res://ui/ui_rect_and_font/montserrat/static/montserrat_bold.ttf" id="9_h5s0f"] | ||
[ext_resource type="FontFile" uid="uid://wnq6gpmrsr6v" path="res://ui/ui_rect_and_font/montserrat/static/montserrat_medium.ttf" id="10_6y5oa"] | ||
[ext_resource type="FontFile" uid="uid://bjwepurchoc75" path="res://ui/ui_rect_and_font/montserrat/static/montserrat_semi_bold.ttf" id="11_eftmn"] | ||
[ext_resource type="StyleBox" uid="uid://cfnh350gqlauw" path="res://ui/common/buttons/blue_underline/blue_underline_hover.stylebox.tres" id="12_dopow"] | ||
[ext_resource type="StyleBox" uid="uid://ca63qjc22p8ek" path="res://ui/common/buttons/blue_underline/blue_underline_normal.stylebox.tres" id="13_uh7qe"] | ||
[ext_resource type="PackedScene" uid="uid://b58iveuspbtyj" path="res://ui/button_sound/button_sound.tscn" id="19_rxcc2"] | ||
|
||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_rk4rc"] | ||
|
||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_tm8vm"] | ||
shader = ExtResource("6_n3wu6") | ||
|
||
[sub_resource type="Theme" id="Theme_ij11x"] | ||
|
||
[sub_resource type="FontVariation" id="Font_mbwka"] | ||
base_font = ExtResource("9_h5s0f") | ||
|
||
[sub_resource type="FontVariation" id="Font_d5673"] | ||
base_font = ExtResource("10_6y5oa") | ||
variation_embolden = 0.5 | ||
|
||
[sub_resource type="FontVariation" id="Font_oqr4b"] | ||
base_font = ExtResource("11_eftmn") | ||
|
||
[sub_resource type="StyleBoxLine" id="StyleBoxLine_secha"] | ||
color = Color(1, 1, 1, 0.2) | ||
|
||
[sub_resource type="FontVariation" id="Font_3a6vw"] | ||
base_font = ExtResource("11_eftmn") | ||
|
||
[node name="LoginUIVR" type="Control"] | ||
visible = false | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme = ExtResource("1_qcy1r") | ||
script = ExtResource("2_pm0hu") | ||
|
||
[node name="TextureRect" type="TextureRect" parent="."] | ||
self_modulate = Color(0.239216, 0.247059, 0.309804, 0.878431) | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
texture = ExtResource("3_wbicg") | ||
expand_mode = 1 | ||
stretch_mode = 6 | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="."] | ||
layout_mode = 0 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -329.0 | ||
offset_top = -369.0 | ||
offset_right = 329.0 | ||
offset_bottom = 369.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
metadata/_edit_layout_mode = 1 | ||
|
||
[node name="TextureRect" type="TextureRect" parent="VBoxContainer"] | ||
custom_minimum_size = Vector2(0, 56) | ||
layout_mode = 2 | ||
texture = ExtResource("4_x0h3t") | ||
expand_mode = 1 | ||
stretch_mode = 5 | ||
script = ExtResource("5_q0xtk") | ||
|
||
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"] | ||
custom_minimum_size = Vector2(0, 30) | ||
layout_mode = 2 | ||
theme_override_styles/separator = SubResource("StyleBoxEmpty_rk4rc") | ||
|
||
[node name="SignInMenu" type="Panel" parent="VBoxContainer"] | ||
material = SubResource("ShaderMaterial_tm8vm") | ||
custom_minimum_size = Vector2(500, 500) | ||
layout_mode = 2 | ||
size_flags_vertical = 3 | ||
theme_override_styles/panel = ExtResource("7_wg3xc") | ||
|
||
[node name="Border" type="Panel" parent="VBoxContainer/SignInMenu"] | ||
layout_mode = 0 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme = SubResource("Theme_ij11x") | ||
theme_override_styles/panel = ExtResource("8_7qtch") | ||
|
||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/SignInMenu"] | ||
layout_mode = 0 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme_override_constants/margin_left = 150 | ||
theme_override_constants/margin_top = 100 | ||
theme_override_constants/margin_right = 150 | ||
theme_override_constants/margin_bottom = 100 | ||
metadata/_edit_layout_mode = 1 | ||
|
||
[node name="LoginContainer" type="VBoxContainer" parent="VBoxContainer/SignInMenu/MarginContainer"] | ||
unique_name_in_owner = true | ||
layout_mode = 2 | ||
theme_override_constants/separation = 30 | ||
|
||
[node name="Label" type="Label" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer"] | ||
layout_mode = 2 | ||
theme_override_fonts/font = SubResource("Font_mbwka") | ||
theme_override_font_sizes/font_size = 40 | ||
text = "Sign In - Login Code" | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="SignUpHereContainer" type="HBoxContainer" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer"] | ||
layout_direction = 2 | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
size_flags_vertical = 6 | ||
theme_override_constants/separation = 0 | ||
alignment = 1 | ||
|
||
[node name="Label2" type="Label" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/SignUpHereContainer"] | ||
layout_mode = 2 | ||
theme_override_fonts/font = SubResource("Font_d5673") | ||
theme_override_font_sizes/font_size = 14 | ||
text = "Please enter the login code from your meeting or your email." | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="SignUpHere" type="Button" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/SignUpHereContainer"] | ||
visible = false | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
theme_override_colors/font_color = Color(0.145098, 0.419608, 0.984314, 1) | ||
theme_override_fonts/font = SubResource("Font_oqr4b") | ||
theme_override_font_sizes/font_size = 14 | ||
theme_override_styles/hover = ExtResource("12_dopow") | ||
theme_override_styles/normal = ExtResource("13_uh7qe") | ||
text = "sign up here" | ||
|
||
[node name="LineSeparator" type="HSeparator" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer"] | ||
custom_minimum_size = Vector2(450, 1) | ||
layout_mode = 2 | ||
theme_override_styles/separator = SubResource("StyleBoxLine_secha") | ||
|
||
[node name="LoginCode" type="LineEdit" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer"] | ||
custom_minimum_size = Vector2(0, 40) | ||
layout_mode = 2 | ||
placeholder_text = "Login Code" | ||
caret_blink = true | ||
|
||
[node name="SignIn" type="Button" parent="VBoxContainer/SignInMenu/MarginContainer/LoginContainer"] | ||
custom_minimum_size = Vector2(0, 50) | ||
layout_mode = 2 | ||
theme_override_fonts/font = SubResource("Font_3a6vw") | ||
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="pressed" from="VBoxContainer/SignInMenu/MarginContainer/LoginContainer/SignIn" to="." method="_on_sign_in_pressed"] |