Skip to content

Commit 3d21b81

Browse files
committed
update v1.4.2
1 parent e8aef32 commit 3d21b81

File tree

5 files changed

+42
-46
lines changed

5 files changed

+42
-46
lines changed

main/scn/notifications/notification/notification.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func _connect_signals() -> void:
2323
go_to.connect("pressed", self, "goto_pressed")
2424

2525
func _ready() -> void:
26+
$Container/GoTo.hide()
2627
hide()
2728
_connect_signals()
2829

main/scn/notifications/notification/notification.tscn

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,23 @@ margin_top = 8.0
6363
margin_right = 1016.0
6464
margin_bottom = 101.0
6565

66+
[node name="Notification" type="Label" parent="Container"]
67+
margin_right = 10.0
68+
margin_bottom = 10.0
69+
rect_min_size = Vector2( 10, 10 )
70+
size_flags_horizontal = 0
71+
size_flags_vertical = 0
72+
custom_styles/normal = SubResource( 2 )
73+
custom_fonts/font = SubResource( 3 )
74+
autowrap = true
75+
__meta__ = {
76+
"_edit_use_anchors_": false
77+
}
78+
6679
[node name="Icon" type="TextureRect" parent="Container"]
80+
margin_left = 18.0
6781
margin_top = 26.0
68-
margin_right = 40.0
82+
margin_right = 58.0
6983
margin_bottom = 66.0
7084
rect_min_size = Vector2( 40, 40 )
7185
size_flags_horizontal = 4
@@ -74,8 +88,8 @@ expand = true
7488
stretch_mode = 4
7589

7690
[node name="Header" type="VBoxContainer" parent="Container"]
77-
margin_left = 48.0
78-
margin_right = 171.0
91+
margin_left = 66.0
92+
margin_right = 189.0
7993
margin_bottom = 93.0
8094

8195
[node name="UserHeader" parent="Container/Header" instance=ExtResource( 1 )]
@@ -87,25 +101,10 @@ margin_right = 123.0
87101
margin_bottom = 93.0
88102

89103
[node name="GoTo" type="ToolButton" parent="Container"]
90-
visible = false
91-
margin_left = 930.0
92-
margin_right = 990.0
104+
margin_left = 948.0
105+
margin_right = 1008.0
93106
margin_bottom = 93.0
94107
size_flags_horizontal = 10
95108
icon = ExtResource( 6 )
96109

97-
[node name="Notification" type="Label" parent="Container"]
98-
margin_left = 179.0
99-
margin_right = 189.0
100-
margin_bottom = 10.0
101-
rect_min_size = Vector2( 10, 10 )
102-
size_flags_horizontal = 8
103-
size_flags_vertical = 0
104-
custom_styles/normal = SubResource( 2 )
105-
custom_fonts/font = SubResource( 3 )
106-
autowrap = true
107-
__meta__ = {
108-
"_edit_use_anchors_": false
109-
}
110-
111110
[node name="Tween" type="Tween" parent="."]

main/scn/notifications/notifications.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func manage_notification(resource : FirebaseResource) -> void:
1313
notification_node.connect("header_pressed", Activities.home, "_on_show_user_profile")
1414
notification_node.connect("show_post", Activities.home, "_on_open_post")
1515
notifications_list.add_child(notification_node)
16-
notifications_list.move_child(notification_node, 0)
16+
# notifications_list.move_child(notification_node, 0)
1717
notification_node.load_notification(resource)
1818

1919
func view_notifications() -> void:

main/scn/signin/signin.gd

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ onready var update_picture : TextureRect = $UpdateProfile/VBox/UpdatePicture
1212
var extension : String
1313
var profile_picture : String
1414

15-
var logged : bool = false
16-
1715
var task : int = -1
1816

1917
func _connect_signals():
@@ -22,6 +20,7 @@ func _connect_signals():
2220
signin_container.connect("logged", self, "_on_SignContainer_logged")
2321
signin_container.connect("logging", self, "_on_SignContainer_logging")
2422
signin_container.connect("signed", self, "_on_SignContainer_signed")
23+
Firebase.Auth.connect("token_refresh_succeeded", self, "_on_auto_login")
2524
$UpdateProfile/VBox/UpdatePicture/CameraIcon.connect("pressed", self, "_on_CameraIcon_pressed")
2625
$UpdateProfile/VBox/ConfirmBtn.connect("pressed", self, "_on_ConfirmBtn_pressed")
2726

@@ -63,17 +62,17 @@ func _on_SignContainer_error(message):
6362
Activities.show_error( message)
6463
Activities.loading( false)
6564

65+
func _on_auto_login(auth):
66+
if not UserData.is_logged:
67+
_on_SignContainer_logged(auth)
68+
6669

6770
func _on_SignContainer_logged(login):
68-
print("logged")
69-
if logged:
70-
emit_signal("show_error", "User already logged")
71-
return
7271
Firebase.Auth.save_auth(login)
72+
UserData.is_logged = true
7373
var firestore_task : FirestoreTask = RequestsManager.get_user(login.localid)
7474
var user_doc : FirestoreDocument = yield(firestore_task, "get_document")
7575
if user_doc.doc_fields.username == "":
76-
Firebase.Auth.save_auth(login)
7776
UserData.user_id = login.localid
7877
UserData.user_email = login.email
7978
Activities.loading(false)
@@ -89,7 +88,6 @@ func _on_SignContainer_logged(login):
8988
Activities.loading(false)
9089
UserData.map_user(user_doc, user_picture)
9190
RequestsManager.update_user()
92-
logged = true
9391
emit_signal("sign_in")
9492

9593
func _on_SignContainer_signed(signup):
@@ -124,21 +122,17 @@ func _on_ChosePicture_file_selected(path):
124122

125123

126124
func _on_ConfirmBtn_pressed():
127-
if logged:
128-
emit_signal("show_error", "User already logged")
129-
return
130125
if update_picture.texture != null and not update_username.get_text() in [""," "]:
131126
Activities.loading( true)
132127
UserData.user_name = update_username.get_text()
133128
UserData.last_logged = OS.get_datetime()
134-
UserData.is_logged = logged
129+
UserData.is_logged = true
135130
var update_task : FirestoreTask = RequestsManager.update_user()
136131
yield(update_task, "update_document" )
137132
var put_file : StorageTask = RequestsManager.update_user_picture(profile_picture)
138133
yield(put_file, "task_finished")
139134
animate_UpdateProfile(false)
140135
Activities.loading( false)
141-
logged = true
142136
emit_signal("sign_in")
143137

144138
func _on_SignContainer_logging():

main/scn/signin/signin.tscn

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@
1010
[ext_resource path="res://main/res/imgs/avatar.svg" type="Texture" id=8]
1111
[ext_resource path="res://main/scn/buttons/firebase_btn/button.tscn" type="PackedScene" id=9]
1212

13-
[sub_resource type="DynamicFont" id=8]
13+
[sub_resource type="DynamicFont" id=1]
1414
size = 30
1515
font_data = ExtResource( 1 )
1616

17-
[sub_resource type="DynamicFont" id=5]
17+
[sub_resource type="DynamicFont" id=2]
1818
size = 49
1919
font_data = ExtResource( 2 )
2020

21-
[sub_resource type="StyleBoxFlat" id=6]
21+
[sub_resource type="StyleBoxFlat" id=3]
2222
content_margin_left = 15.0
2323
content_margin_right = 15.0
2424
content_margin_top = 15.0
2525
content_margin_bottom = 15.0
2626
bg_color = Color( 1, 0.886275, 0.639216, 0 )
2727

28-
[sub_resource type="VisualShaderNodeTexture" id=9]
28+
[sub_resource type="VisualShaderNodeTexture" id=4]
2929
texture = ExtResource( 8 )
3030

31-
[sub_resource type="VisualShaderNodeTexture" id=10]
31+
[sub_resource type="VisualShaderNodeTexture" id=5]
3232
source = 2
3333

34-
[sub_resource type="VisualShader" id=3]
34+
[sub_resource type="VisualShader" id=6]
3535
code = "shader_type canvas_item;
3636
uniform sampler2D tex_frg_2;
3737

@@ -71,15 +71,15 @@ void light() {
7171
graph_offset = Vector2( -441, 170 )
7272
mode = 1
7373
flags/light_only = false
74-
nodes/fragment/2/node = SubResource( 9 )
74+
nodes/fragment/2/node = SubResource( 4 )
7575
nodes/fragment/2/position = Vector2( -80, 300 )
76-
nodes/fragment/3/node = SubResource( 10 )
76+
nodes/fragment/3/node = SubResource( 5 )
7777
nodes/fragment/3/position = Vector2( 20, 120 )
7878
nodes/fragment/connections = PoolIntArray( 2, 1, 0, 1, 3, 0, 0, 0 )
7979

8080
[sub_resource type="ShaderMaterial" id=7]
8181
resource_local_to_scene = true
82-
shader = SubResource( 3 )
82+
shader = SubResource( 6 )
8383

8484
[node name="SignIn" type="CenterContainer"]
8585
anchor_right = 1.0
@@ -120,7 +120,7 @@ custom_constants/separation = 0
120120
[node name="Label" type="Label" parent="SignContainer/VBoxContainer/VBoxContainer"]
121121
margin_right = 320.0
122122
margin_bottom = 36.0
123-
custom_fonts/font = SubResource( 8 )
123+
custom_fonts/font = SubResource( 1 )
124124
custom_colors/font_color_shadow = Color( 0.432587, 0.449886, 0.878906, 1 )
125125
custom_constants/shadow_offset_x = 2
126126
custom_constants/shadow_offset_y = 2
@@ -133,7 +133,7 @@ margin_right = 320.0
133133
margin_bottom = 96.0
134134
rect_min_size = Vector2( 0, 60 )
135135
rect_clip_content = false
136-
custom_fonts/normal_font = SubResource( 5 )
136+
custom_fonts/normal_font = SubResource( 2 )
137137
custom_colors/font_color_shadow = Color( 0.341176, 0.356863, 0.811765, 1 )
138138
custom_constants/shadow_offset_x = 3
139139
custom_constants/shadow_offset_y = 3
@@ -152,7 +152,7 @@ margin_right = 320.0
152152
margin_bottom = 372.0
153153
size_flags_horizontal = 3
154154
size_flags_vertical = 3
155-
custom_styles/panel = SubResource( 6 )
155+
custom_styles/panel = SubResource( 3 )
156156

157157
[node name="UpdateProfile" type="PanelContainer" parent="."]
158158
margin_left = 377.0
@@ -206,5 +206,7 @@ size_flags_vertical = 10
206206
text = "Confirm"
207207

208208
[node name="ChosePicture" parent="." instance=ExtResource( 5 )]
209+
current_dir = "/COMPUTER/GodotEngine/FirebaseDemo-SociaDot"
210+
current_path = "/COMPUTER/GodotEngine/FirebaseDemo-SociaDot/"
209211

210212
[node name="Tween" type="Tween" parent="."]

0 commit comments

Comments
 (0)