Skip to content

Commit b4c66a6

Browse files
authored
Update (#8)
* update 2021.04.14 * Cleaned * update v1.4 * update v1.4.2
1 parent 8e9b45d commit b4c66a6

File tree

6 files changed

+42
-47
lines changed

6 files changed

+42
-47
lines changed

main/scn/home/home.gd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ onready var posts_section : VBoxContainer = sections_container.get_node("Posts")
88
onready var users_list_section : VBoxContainer = sections_container.get_node("UsersList")
99
onready var settings_section : VBoxContainer = sections_container.get_node("Settings")
1010
onready var profile_section : VBoxContainer = sections_container.get_node("Profile")
11-
1211
onready var notifications_section : VBoxContainer = sections_container.get_node("Notifications")
1312

14-
1513
onready var post_box : VBoxContainer = posts_section.get_node("ScrollPost/PostContainer")
1614
onready var profile_post_container : VBoxContainer = profile_section.get_node("ScrollPost/PostContainer")
1715

@@ -35,8 +33,6 @@ var notifications_db_reference : FirebaseDatabaseReference
3533

3634
var window_size : Vector2
3735

38-
var window_size : Vector2
39-
4036
func _connect_signals():
4137
connect("item_rect_changed", self, "_on_Home_item_rect_changed")
4238
$ShareSomethingContainer.connect("share_post", self, "add_shared_post")

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 & 19 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,11 @@ margin_right = 123.0
87101
margin_bottom = 93.0
88102

89103
[node name="GoTo" type="ToolButton" parent="Container"]
104+
margin_left = 948.0
105+
margin_right = 1008.0
90106
visible = false
91-
margin_left = 930.0
92-
margin_right = 990.0
93107
margin_bottom = 93.0
94108
size_flags_horizontal = 10
95109
icon = ExtResource( 6 )
96110

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-
111111
[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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func _connect_signals():
2222
signin_container.connect("logged", self, "_on_SignContainer_logged")
2323
signin_container.connect("logging", self, "_on_SignContainer_logging")
2424
signin_container.connect("signed", self, "_on_SignContainer_signed")
25-
Firebase.Auth.connect("token_refresh_succeeded", self, "_on_SignContainer_logged")
25+
Firebase.Auth.connect("token_refresh_succeeded", self, "_on_auto_login")
2626
$UpdateProfile/VBox/UpdatePicture/CameraIcon.connect("pressed", self, "_on_CameraIcon_pressed")
2727
$UpdateProfile/VBox/ConfirmBtn.connect("pressed", self, "_on_ConfirmBtn_pressed")
2828

@@ -64,17 +64,17 @@ func _on_SignContainer_error(message):
6464
Activities.show_error( message)
6565
Activities.loading( false)
6666

67+
func _on_auto_login(auth):
68+
if not UserData.is_logged:
69+
_on_SignContainer_logged(auth)
70+
6771

6872
func _on_SignContainer_logged(login):
69-
print("logged")
70-
if logged:
71-
emit_signal("show_error", "User already logged")
72-
return
73+
UserData.is_logged = true
7374
Firebase.Auth.save_auth(login)
7475
var firestore_task : FirestoreTask = RequestsManager.get_user(login.localid)
7576
var user_doc : FirestoreDocument = yield(firestore_task, "get_document")
7677
if user_doc.doc_fields.username == "":
77-
Firebase.Auth.save_auth(login)
7878
UserData.user_id = login.localid
7979
UserData.user_email = login.email
8080
Activities.loading(false)
@@ -90,7 +90,6 @@ func _on_SignContainer_logged(login):
9090
Activities.loading(false)
9191
UserData.map_user(user_doc, user_picture)
9292
RequestsManager.update_user()
93-
logged = true
9493
emit_signal("sign_in")
9594

9695
func _on_SignContainer_signed(signup):
@@ -125,15 +124,12 @@ func _on_ChosePicture_file_selected(path):
125124

126125

127126
func _on_ConfirmBtn_pressed():
128-
if logged:
129-
emit_signal("show_error", "User already logged")
130-
return
131127
if update_picture.texture != null and not update_username.get_text() in [""," "]:
132128
logged = true
133129
Activities.loading( true)
134130
UserData.user_name = update_username.get_text()
135131
UserData.last_logged = OS.get_datetime()
136-
UserData.is_logged = logged
132+
UserData.is_logged = true
137133
var update_task : FirestoreTask = RequestsManager.update_user()
138134
yield(update_task, "update_document" )
139135
var put_file : StorageTask = RequestsManager.update_user_picture(profile_picture)

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)