-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from TaloDev/develop
Release 0.8.0
- Loading branch information
Showing
14 changed files
with
213 additions
and
686 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
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
27 changes: 27 additions & 0 deletions
27
addons/talo/samples/authentication/states/delete_account.gd
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 Node2D | ||
|
||
signal delete_account_success | ||
signal go_to_game | ||
|
||
@onready var current_password: TextEdit = %CurrentPassword | ||
@onready var validation_label: Label = %ValidationLabel | ||
|
||
func _on_delete_pressed() -> void: | ||
validation_label.text = "" | ||
|
||
if not current_password.text: | ||
validation_label.text = "Current password is required" | ||
return | ||
|
||
var res = await Talo.player_auth.delete_account(current_password.text) | ||
if res != OK: | ||
match Talo.player_auth.last_error.get_code(): | ||
TaloAuthError.ErrorCode.INVALID_CREDENTIALS: | ||
validation_label.text = "Current password is incorrect" | ||
_: | ||
validation_label.text = Talo.player_auth.last_error.get_string() | ||
else: | ||
delete_account_success.emit() | ||
|
||
func _on_cancel_pressed() -> void: | ||
go_to_game.emit() |
93 changes: 93 additions & 0 deletions
93
addons/talo/samples/authentication/states/delete_account.tscn
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,93 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://d17bvaxw1qew4"] | ||
|
||
[ext_resource type="Script" path="res://addons/talo/samples/authentication/states/delete_account.gd" id="1_ggdf5"] | ||
[ext_resource type="Theme" uid="uid://ce2uyi827vc5x" path="res://addons/talo/samples/authentication/assets/theme.tres" id="2_n2cbx"] | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xxxlc"] | ||
bg_color = Color(0.784314, 0.156863, 0.156863, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fa3fr"] | ||
bg_color = Color(0.690196, 0.129412, 0.129412, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hijpl"] | ||
bg_color = Color(0.603922, 0.105882, 0.105882, 1) | ||
|
||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wems6"] | ||
bg_color = Color(0.603922, 0.105882, 0.105882, 1) | ||
|
||
[node name="DeleteAccount" type="Node2D"] | ||
script = ExtResource("1_ggdf5") | ||
|
||
[node name="UI" type="Control" parent="."] | ||
layout_mode = 3 | ||
anchors_preset = 0 | ||
offset_right = 1080.0 | ||
offset_bottom = 720.0 | ||
|
||
[node name="Background" type="ColorRect" parent="UI"] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
color = Color(0.121569, 0.160784, 0.215686, 1) | ||
|
||
[node name="MarginContainer" type="MarginContainer" parent="UI"] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
theme_override_constants/margin_left = 40 | ||
theme_override_constants/margin_top = 40 | ||
theme_override_constants/margin_right = 40 | ||
theme_override_constants/margin_bottom = 40 | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="UI/MarginContainer"] | ||
layout_mode = 2 | ||
size_flags_vertical = 4 | ||
theme_override_constants/separation = 24 | ||
|
||
[node name="Title" type="Label" parent="UI/MarginContainer/VBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_vertical = 0 | ||
theme = ExtResource("2_n2cbx") | ||
text = "Delete account" | ||
horizontal_alignment = 1 | ||
|
||
[node name="CurrentPassword" type="TextEdit" parent="UI/MarginContainer/VBoxContainer"] | ||
unique_name_in_owner = true | ||
custom_minimum_size = Vector2(400, 40) | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
theme = ExtResource("2_n2cbx") | ||
placeholder_text = "Current password" | ||
|
||
[node name="Delete" type="Button" parent="UI/MarginContainer/VBoxContainer"] | ||
custom_minimum_size = Vector2(200, 40) | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
theme = ExtResource("2_n2cbx") | ||
theme_override_styles/normal = SubResource("StyleBoxFlat_xxxlc") | ||
theme_override_styles/hover = SubResource("StyleBoxFlat_fa3fr") | ||
theme_override_styles/pressed = SubResource("StyleBoxFlat_hijpl") | ||
theme_override_styles/focus = SubResource("StyleBoxFlat_wems6") | ||
text = "Delete account" | ||
|
||
[node name="Cancel" type="Button" parent="UI/MarginContainer/VBoxContainer"] | ||
custom_minimum_size = Vector2(200, 40) | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
theme = ExtResource("2_n2cbx") | ||
text = "Cancel" | ||
|
||
[node name="ValidationLabel" type="Label" parent="UI/MarginContainer/VBoxContainer"] | ||
unique_name_in_owner = true | ||
custom_minimum_size = Vector2(400, 2.08165e-12) | ||
layout_mode = 2 | ||
size_flags_horizontal = 4 | ||
|
||
[connection signal="pressed" from="UI/MarginContainer/VBoxContainer/Delete" to="." method="_on_delete_pressed"] | ||
[connection signal="pressed" from="UI/MarginContainer/VBoxContainer/Cancel" to="." method="_on_cancel_pressed"] |
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
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