Skip to content

Commit 2a7f3ef

Browse files
authored
Revert "Update (#5)" (#6)
This reverts commit f56974a.
1 parent f56974a commit 2a7f3ef

19 files changed

+35
-398
lines changed

main/res/icons/arrow_forward_white_36dp.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

main/res/icons/arrow_forward_white_36dp.svg.import

Lines changed: 0 additions & 34 deletions
This file was deleted.

main/scn/app/main.gd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ func _on_show_error(error : String):
6464

6565
# ..... top bar signals
6666
func _on_TopBar_close():
67-
UserData.is_logged = false
68-
UserData.last_logged = OS.get_datetime()
69-
loading.set_loading(true)
70-
yield(RequestsManager.update_user(), "task_finished")
7167
get_tree().quit()
7268

7369
func _on_TopBar_minimize():

main/scn/header/header.gd

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
extends HBoxContainer
22

3-
signal pressed(user_id, user_name)
4-
5-
var user_id : String
63
var user_name : String
74
var user_picture : ImageTexture
85

@@ -23,11 +20,9 @@ func load_from_user(user_obj : UsersManager.User):
2320
user_obj.connect("update_picture", self, "set_picture")
2421
set_picture(user_obj.picture)
2522
set_user_name(user_obj.username)
26-
user_id = user_obj.id
2723

2824
func load_from_document(document : FirestoreDocument):
2925
set_user_name(document.doc_fields.username)
30-
user_id = document.doc_fields.localid
3126

3227
func set_picture(picture : ImageTexture):
3328
user_picture = picture
@@ -38,7 +33,3 @@ func set_picture(picture : ImageTexture):
3833
func set_user_name(_name : String):
3934
user_name = _name
4035
$Name.set_text(_name)
41-
42-
43-
func _on_Name_pressed() -> void:
44-
emit_signal("pressed", user_id, user_name)

main/scn/header/header.tscn

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
margin_right = 168.0
99
margin_bottom = 60.0
1010
size_flags_vertical = 4
11-
custom_constants/separation = 15
1211
script = ExtResource( 3 )
1312
__meta__ = {
1413
"_edit_use_anchors_": false
@@ -25,11 +24,9 @@ expand = true
2524
stretch_mode = 1
2625

2726
[node name="Name" type="LinkButton" parent="."]
28-
margin_left = 75.0
27+
margin_left = 68.0
2928
margin_top = 17.0
30-
margin_right = 123.0
29+
margin_right = 116.0
3130
margin_bottom = 42.0
3231
size_flags_vertical = 4
3332
text = "user"
34-
35-
[connection signal="pressed" from="Name" to="." method="_on_Name_pressed"]

main/scn/header/interactive/interactive_header.gd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func _on_ConnecBtn_pressed():
6464
yield(friend_task, "update_document")
6565
if check_friend():
6666
emit_signal("connected", user, $ConnecBtn)
67-
RequestsManager.send_notification(UserData.user_id, user_id, "connect")
6867
else:
6968
emit_signal("disconnect", user)
7069

main/scn/home/home.gd

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,25 @@ onready var users_list_section : VBoxContainer = sections_container.get_node("Us
99
onready var settings_section : VBoxContainer = sections_container.get_node("Settings")
1010
onready var profile_section : VBoxContainer = sections_container.get_node("Profile")
1111

12-
onready var notifications_section : VBoxContainer = sections_container.get_node("Notifications")
13-
14-
1512
onready var post_box : VBoxContainer = posts_section.get_node("ScrollPost/PostContainer")
1613
onready var profile_post_container : VBoxContainer = profile_section.get_node("ScrollPost/PostContainer")
1714

1815
onready var menu : VBoxContainer = $HomeContainer/Menu
1916
onready var side_bar : VBoxContainer = $HomeContainer/SideBar
2017
onready var friend_list : VBoxContainer = side_bar.get_node("FriendList")
2118

22-
onready var notification_lbl : Label = $HomeContainer/Menu/NotificationsBtn/Notification
2319

2420
onready var chat_container : GridContainer = $AspectRatioContainer/ChatContainer
2521

2622
onready var show_post : Control = $ShowPost
2723

24+
onready var notification_lbl : Label = $HomeContainer/Menu/NotificationsBtn/Notification
2825

2926
var fr_posts : FirestoreCollection = Firebase.Firestore.collection("posts")
3027

3128
var friend_posts : Array = []
3229

3330
var posts_db_reference : FirebaseDatabaseReference
34-
var notifications_db_reference : FirebaseDatabaseReference
35-
36-
var window_size : Vector2
3731

3832
var window_size : Vector2
3933

@@ -49,8 +43,6 @@ func _connect_signals():
4943
$HomeContainer/Menu/UsersListBtn.connect("pressed", self, "_on_UsersListBtn_pressed")
5044
$HomeContainer/Menu/NotificationsBtn.connect("pressed", self, "_on_NotificationsBtn_pressed")
5145
$HomeContainer/Menu/SettingsBtn.connect("pressed", self, "_on_SettingsBtn_pressed")
52-
53-
notifications_section.connect("visibility_changed", self, "_on_notification_section_visibility")
5446

5547
func _ready():
5648
_connect_signals()
@@ -65,7 +57,8 @@ func _ready():
6557
animate_Home(true)
6658
load_posts()
6759
friend_list.load_friend_list()
68-
connect_notifications()
60+
61+
6962

7063
func animate_Home(display : bool):
7164
if display:
@@ -107,14 +100,6 @@ func load_posts():
107100
posts_db_reference = Firebase.Database.get_database_reference("sociadot/posts")
108101
posts_db_reference.connect("new_data_update", self, "_on_new_post")
109102

110-
func connect_notifications() -> void:
111-
notifications_db_reference = Firebase.Database.get_database_reference("sociadot/notifications/"+UserData.user_id)
112-
notifications_db_reference.connect("new_data_update", self, "_on_new_notification")
113-
114-
func _on_new_notification(notification : FirebaseResource):
115-
notifications_section.manage_notification(notification)
116-
if not notification.data.viewed:
117-
notification_lbl.show()
118103

119104
func check_friend_posts_list(post_doc : FirestoreDocument) -> bool:
120105
for post in friend_posts:
@@ -246,12 +231,7 @@ func _on_open_post(post : PostsManager.Post):
246231
show_post.show_post(post, UsersManager.get_user_by_id(post.user_id))
247232

248233
func _on_NotificationsBtn_pressed():
249-
show_section(notifications_section)
250-
notification_lbl.hide()
251-
252-
func _on_notification_section_visibility():
253-
if not notifications_section.visible:
254-
notifications_section.view_notifications()
234+
pass
255235

256236
func _on_Home_item_rect_changed():
257237
update_chat_container()

main/scn/home/home.tscn

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,24 @@
1313
[ext_resource path="res://main/scn/profile/profile.tscn" type="PackedScene" id=11]
1414
[ext_resource path="res://main/res/icons/notifications_none_white_24dp.svg" type="Texture" id=12]
1515
[ext_resource path="res://main/scn/show_post/show_post.tscn" type="PackedScene" id=13]
16-
[ext_resource path="res://main/scn/notifications/notifications.gd" type="Script" id=14]
1716
[ext_resource path="res://main/res/icons/groups_white_24dp.svg" type="Texture" id=15]
1817
[ext_resource path="res://main/res/icons/settings-24px.svg" type="Texture" id=16]
1918
[ext_resource path="res://main/scn/settings/settings.tscn" type="PackedScene" id=17]
20-
[ext_resource path="res://main/scn/labels_icons/color_round_s.tscn" type="PackedScene" id=18]
2119

2220
[sub_resource type="StyleBoxEmpty" id=1]
2321

2422
[sub_resource type="StyleBoxEmpty" id=2]
2523

24+
[sub_resource type="StyleBoxFlat" id=3]
25+
bg_color = Color( 1, 0.352941, 0.247059, 1 )
26+
corner_radius_top_left = 40
27+
corner_radius_top_right = 40
28+
corner_radius_bottom_right = 40
29+
corner_radius_bottom_left = 40
30+
corner_detail = 20
31+
32+
[sub_resource type="DynamicFont" id=4]
33+
2634
[sub_resource type="DynamicFont" id=5]
2735
size = 25
2836
font_data = ExtResource( 2 )
@@ -128,7 +136,19 @@ texture_active = ExtResource( 12 )
128136
texture_inactive = ExtResource( 12 )
129137
color = Color( 1, 0.627451, 0.294118, 1 )
130138

131-
[node name="Notification" parent="HomeContainer/Menu/NotificationsBtn" instance=ExtResource( 18 )]
139+
[node name="Notification" type="Label" parent="HomeContainer/Menu/NotificationsBtn"]
140+
visible = false
141+
margin_right = 10.0
142+
margin_bottom = 10.0
143+
rect_min_size = Vector2( 10, 10 )
144+
size_flags_horizontal = 0
145+
size_flags_vertical = 0
146+
custom_styles/normal = SubResource( 3 )
147+
custom_fonts/font = SubResource( 4 )
148+
autowrap = true
149+
__meta__ = {
150+
"_edit_use_anchors_": false
151+
}
132152

133153
[node name="SettingsBtn" parent="HomeContainer/Menu" instance=ExtResource( 10 )]
134154
margin_left = 15.0
@@ -203,42 +223,6 @@ size_flags_horizontal = 3
203223
size_flags_vertical = 3
204224
custom_constants/separation = 30
205225

206-
[node name="Notifications" type="VBoxContainer" parent="HomeContainer/Sections"]
207-
visible = false
208-
margin_top = 302.0
209-
margin_right = 564.0
210-
margin_bottom = 600.0
211-
size_flags_vertical = 3
212-
script = ExtResource( 14 )
213-
__meta__ = {
214-
"_edit_use_anchors_": false
215-
}
216-
217-
[node name="Label" type="Label" parent="HomeContainer/Sections/Notifications"]
218-
margin_right = 564.0
219-
margin_bottom = 39.0
220-
custom_fonts/font = SubResource( 5 )
221-
text = "Notifications"
222-
align = 1
223-
224-
[node name="ScrollNotifications" type="ScrollContainer" parent="HomeContainer/Sections/Notifications"]
225-
margin_top = 43.0
226-
margin_right = 564.0
227-
margin_bottom = 298.0
228-
size_flags_horizontal = 3
229-
size_flags_vertical = 3
230-
custom_styles/bg = SubResource( 6 )
231-
scroll_horizontal_enabled = false
232-
233-
[node name="NotificationsContainer" type="VBoxContainer" parent="HomeContainer/Sections/Notifications/ScrollNotifications"]
234-
margin_left = 10.0
235-
margin_top = 10.0
236-
margin_right = 554.0
237-
margin_bottom = 245.0
238-
size_flags_horizontal = 3
239-
size_flags_vertical = 3
240-
custom_constants/separation = 5
241-
242226
[node name="Profile" parent="HomeContainer/Sections" instance=ExtResource( 11 )]
243227
visible = false
244228
anchor_right = 0.0

main/scn/labels_icons/color_round_s.tscn

Lines changed: 0 additions & 25 deletions
This file was deleted.

main/scn/notifications/notification/notification.gd

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)