Skip to content

Commit 105b643

Browse files
authored
Update (#9)
* update 2021.04.14 * Cleaned * update v1.4 * update v1.4.2 * update v1.4.5
1 parent b4c66a6 commit 105b643

File tree

6 files changed

+78
-78
lines changed

6 files changed

+78
-78
lines changed

main/scn/app/main.gd

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ func _ready():
2727
if child is Control: child.hide()
2828
if OS.get_name() in ["HTML5"]:
2929
topbar.hide()
30+
get_parent().rect_position = Vector2(0,0)
31+
get_parent().rect_size = OS.window_size
32+
get_parent().rect_clip_content = true
3033
loading.set_loading(false)
3134
Activities.signin = Activities.signin_scene.instance()
3235
activities.add_child(Activities.signin)
@@ -48,17 +51,17 @@ func _on_signin_completed():
4851
activities.add_child(Activities.home)
4952

5053
func _on_show_error(error : String):
51-
error_container.set_size(Vector2())
54+
error_lbl.set_size(Vector2())
5255
error_lbl.set_text(error)
53-
animator.interpolate_property(error_container, "rect_position",
54-
Vector2(rect_size.x/2 - error_container.rect_size.x/2, rect_size.y + 10),
55-
Vector2(rect_size.x/2 - error_container.rect_size.x/2, rect_size.y - error_container.rect_size.y),
56+
animator.interpolate_property(error_lbl, "rect_position",
57+
Vector2(rect_size.x/2 - error_lbl.rect_size.x/2, rect_size.y + 10),
58+
Vector2(rect_size.x/2 - error_lbl.rect_size.x/2, rect_size.y - $Main.rect_position.y - error_lbl.rect_size.y - 20),
5659
0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)
5760
animator.start()
5861
yield(get_tree().create_timer(9), "timeout")
59-
animator.interpolate_property(error_container, "rect_position",
60-
error_container.rect_position,
61-
Vector2(rect_size.x/2 - error_container.rect_size.x/2, rect_size.y + 10),
62+
animator.interpolate_property(error_lbl, "rect_position",
63+
error_lbl.rect_position,
64+
Vector2(rect_size.x/2 - error_lbl.rect_size.x/2, rect_size.y + 10),
6265
0.3, Tween.TRANS_QUAD, Tween.EASE_OUT)
6366
animator.start()
6467

@@ -75,11 +78,15 @@ func _on_TopBar_minimize():
7578

7679
func _on_TopBar_resize():
7780
if OS.get_window_size().x <= 1024:
78-
OS.set_window_size(OS.get_screen_size(0) - Vector2(0, 50))
81+
get_parent().rect_position = Vector2(0,0)
7982
OS.set_window_position(Vector2.ZERO)
83+
get_parent().rect_size+=Vector2(8,8)*2
84+
OS.set_window_size(OS.get_screen_size(0) - Vector2(0, 50))
8085
else:
81-
OS.set_window_size(Vector2(1024, 600))
86+
get_parent().rect_position = Vector2(8,8)
8287
OS.set_window_position(OS.get_screen_size(0)/2 - OS.get_window_size()/2)
88+
get_parent().rect_size-=Vector2(8,8)*2
89+
OS.set_window_size(Vector2(1024, 600))
8390

8491
func _on_TopBar_moving_from_pos(event_pos : Vector2, offset : Vector2):
8592
if OS.get_window_size().x > 1024:

main/scn/app/main.tscn

Lines changed: 51 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
[ext_resource path="res://main/scripts/loading.gd" type="Script" id=8]
99

1010
[sub_resource type="StyleBoxFlat" id=1]
11-
bg_color = Color( 0.172549, 0.172549, 0.172549, 1 )
11+
bg_color = Color( 0.14902, 0.14902, 0.14902, 1 )
1212
border_blend = true
1313
corner_radius_top_left = 10
1414
corner_radius_top_right = 10
1515
corner_radius_bottom_right = 10
1616
corner_radius_bottom_left = 10
1717
corner_detail = 20
18-
shadow_color = Color( 0, 0, 0, 0.156863 )
18+
shadow_color = Color( 0, 0, 0, 0.0784314 )
19+
shadow_size = 5
1920

2021
[sub_resource type="StyleBoxFlat" id=2]
2122
bg_color = Color( 0, 1, 0.486275, 1 )
@@ -79,7 +80,7 @@ content_margin_left = 10.0
7980
content_margin_right = 10.0
8081
content_margin_top = 7.0
8182
content_margin_bottom = 6.0
82-
bg_color = Color( 0, 0, 0, 0.313726 )
83+
bg_color = Color( 0, 0, 0, 0.745098 )
8384
corner_radius_top_left = 5
8485
corner_radius_top_right = 5
8586
corner_radius_bottom_right = 5
@@ -92,17 +93,21 @@ shadow_offset = Vector2( 0, 1 )
9293
[node name="AppContainer" type="PanelContainer"]
9394
anchor_right = 1.0
9495
anchor_bottom = 1.0
95-
rect_clip_content = true
96+
margin_left = 8.0
97+
margin_top = 8.0
98+
margin_right = -8.0
99+
margin_bottom = -8.0
96100
custom_styles/panel = SubResource( 1 )
97101
__meta__ = {
98102
"_edit_use_anchors_": false
99103
}
100104

101105
[node name="MainContainer" type="VBoxContainer" parent="."]
102-
margin_right = 1024.0
103-
margin_bottom = 600.0
106+
margin_right = 1008.0
107+
margin_bottom = 584.0
104108
grow_horizontal = 2
105109
grow_vertical = 2
110+
rect_clip_content = true
106111
size_flags_horizontal = 3
107112
size_flags_vertical = 3
108113
theme = ExtResource( 1 )
@@ -114,7 +119,7 @@ __meta__ = {
114119
}
115120

116121
[node name="TopBar" type="HBoxContainer" parent="MainContainer"]
117-
margin_right = 1024.0
122+
margin_right = 1008.0
118123
margin_bottom = 35.0
119124
rect_min_size = Vector2( 0, 35 )
120125
size_flags_horizontal = 3
@@ -139,16 +144,16 @@ stretch_mode = 6
139144
[node name="Name" type="Label" parent="MainContainer/TopBar"]
140145
margin_left = 35.0
141146
margin_top = 4.0
142-
margin_right = 961.0
147+
margin_right = 945.0
143148
margin_bottom = 31.0
144149
mouse_filter = 1
145150
size_flags_horizontal = 3
146151
text = "socia.dot"
147152

148153
[node name="MinimizeBtn" type="Button" parent="MainContainer/TopBar"]
149-
margin_left = 961.0
154+
margin_left = 945.0
150155
margin_top = 11.0
151-
margin_right = 974.0
156+
margin_right = 958.0
152157
margin_bottom = 24.0
153158
rect_min_size = Vector2( 13, 13 )
154159
mouse_filter = 1
@@ -162,16 +167,16 @@ custom_styles/normal = SubResource( 3 )
162167
custom_fonts/font = SubResource( 4 )
163168

164169
[node name="VSeparator4" type="VSeparator" parent="MainContainer/TopBar"]
165-
margin_left = 974.0
166-
margin_right = 981.0
170+
margin_left = 958.0
171+
margin_right = 965.0
167172
margin_bottom = 35.0
168173
mouse_filter = 1
169174
custom_constants/separation = 7
170175

171176
[node name="ResizeBtn" type="Button" parent="MainContainer/TopBar"]
172-
margin_left = 981.0
177+
margin_left = 965.0
173178
margin_top = 11.0
174-
margin_right = 994.0
179+
margin_right = 978.0
175180
margin_bottom = 24.0
176181
rect_min_size = Vector2( 13, 13 )
177182
mouse_filter = 1
@@ -185,16 +190,16 @@ custom_styles/normal = SubResource( 6 )
185190
custom_fonts/font = SubResource( 4 )
186191

187192
[node name="VSeparator3" type="VSeparator" parent="MainContainer/TopBar"]
188-
margin_left = 994.0
189-
margin_right = 1001.0
193+
margin_left = 978.0
194+
margin_right = 985.0
190195
margin_bottom = 35.0
191196
mouse_filter = 1
192197
custom_constants/separation = 7
193198

194199
[node name="ExitBtn" type="Button" parent="MainContainer/TopBar"]
195-
margin_left = 1001.0
200+
margin_left = 985.0
196201
margin_top = 11.0
197-
margin_right = 1014.0
202+
margin_right = 998.0
198203
margin_bottom = 24.0
199204
rect_min_size = Vector2( 13, 13 )
200205
mouse_filter = 1
@@ -208,8 +213,8 @@ custom_styles/normal = SubResource( 8 )
208213
custom_fonts/font = SubResource( 4 )
209214

210215
[node name="VSeparator2" type="VSeparator" parent="MainContainer/TopBar"]
211-
margin_left = 1014.0
212-
margin_right = 1024.0
216+
margin_left = 998.0
217+
margin_right = 1008.0
213218
margin_bottom = 35.0
214219
mouse_filter = 1
215220
custom_constants/separation = 10
@@ -218,19 +223,12 @@ custom_constants/separation = 10
218223

219224
[node name="Main" type="Control" parent="MainContainer"]
220225
margin_top = 35.0
221-
margin_right = 1024.0
222-
margin_bottom = 600.0
226+
margin_right = 1008.0
227+
margin_bottom = 584.0
228+
rect_clip_content = true
223229
size_flags_horizontal = 3
224230
size_flags_vertical = 3
225231

226-
[node name="ColorRect" type="ColorRect" parent="MainContainer/Main"]
227-
anchor_right = 1.0
228-
anchor_bottom = 1.0
229-
color = Color( 0.12549, 0.12549, 0.12549, 1 )
230-
__meta__ = {
231-
"_edit_use_anchors_": false
232-
}
233-
234232
[node name="Activities" type="Control" parent="MainContainer/Main"]
235233
anchor_right = 1.0
236234
anchor_bottom = 1.0
@@ -241,6 +239,7 @@ __meta__ = {
241239
}
242240

243241
[node name="Loading" type="Control" parent="MainContainer/Main"]
242+
visible = false
244243
anchor_right = 1.0
245244
anchor_bottom = 1.0
246245
rect_clip_content = true
@@ -281,38 +280,6 @@ __meta__ = {
281280
[node name="Timer" type="Timer" parent="MainContainer/Main/Loading"]
282281
wait_time = 0.7
283282

284-
[node name="ErrorContainer" type="AspectRatioContainer" parent="MainContainer/Main"]
285-
anchor_left = 0.5
286-
anchor_top = 1.0
287-
anchor_right = 0.5
288-
anchor_bottom = 1.0
289-
margin_left = -250.0
290-
margin_top = 8.0
291-
margin_right = 250.0
292-
margin_bottom = 40.0
293-
size_flags_horizontal = 0
294-
size_flags_vertical = 0
295-
alignment_vertical = 0
296-
__meta__ = {
297-
"_edit_use_anchors_": false
298-
}
299-
300-
[node name="ERROR" type="Label" parent="MainContainer/Main/ErrorContainer"]
301-
margin_right = 500.0
302-
margin_bottom = 32.0
303-
grow_horizontal = 2
304-
rect_min_size = Vector2( 500, 0 )
305-
size_flags_horizontal = 3
306-
custom_styles/normal = SubResource( 9 )
307-
custom_colors/font_color = Color( 1, 0, 0.235294, 1 )
308-
align = 1
309-
autowrap = true
310-
__meta__ = {
311-
"_edit_use_anchors_": false
312-
}
313-
314-
[node name="Tween" type="Tween" parent="MainContainer/Main"]
315-
316283
[node name="AppInfo" type="HBoxContainer" parent="MainContainer/Main"]
317284
modulate = Color( 1, 1, 1, 0.235294 )
318285
anchor_top = 1.0
@@ -331,7 +298,28 @@ margin_bottom = 27.0
331298

332299
[node name="UserId" type="Label" parent="MainContainer/Main/AppInfo"]
333300
margin_left = 18.0
334-
margin_right = 1024.0
301+
margin_right = 1008.0
335302
margin_bottom = 27.0
336303
size_flags_horizontal = 3
337304
align = 2
305+
306+
[node name="ERROR" type="Label" parent="MainContainer/Main"]
307+
anchor_top = 1.0
308+
anchor_right = 1.0
309+
anchor_bottom = 1.0
310+
margin_left = 222.0
311+
margin_top = 19.0
312+
margin_right = -222.0
313+
margin_bottom = 51.0
314+
grow_horizontal = 2
315+
rect_min_size = Vector2( 500, 0 )
316+
size_flags_horizontal = 3
317+
custom_styles/normal = SubResource( 9 )
318+
custom_colors/font_color = Color( 1, 0, 0.235294, 1 )
319+
align = 1
320+
autowrap = true
321+
__meta__ = {
322+
"_edit_use_anchors_": false
323+
}
324+
325+
[node name="Tween" type="Tween" parent="MainContainer/Main"]

main/scn/notifications/notification/notification.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ margin_bottom = 93.0
103103
[node name="GoTo" type="ToolButton" parent="Container"]
104104
margin_left = 948.0
105105
margin_right = 1008.0
106-
visible = false
107106
margin_bottom = 93.0
108107
size_flags_horizontal = 10
109108
icon = ExtResource( 6 )

main/scn/post/post.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var comments : int
2222
var post : PostsManager.Post setget set_post
2323
var user : UsersManager.User
2424

25-
var db_reference : FirebaseDatabaseReference
25+
var post_db_reference : FirebaseDatabaseReference
2626

2727
func _connect_signals():
2828
post_image.connect("gui_input", self, "_on_Image_gui_input")
@@ -69,9 +69,9 @@ func set_menu(user : String) -> void:
6969
func set_post_id(p : String):
7070
id = p
7171
name = p
72-
db_reference = Firebase.Database.get_database_reference("sociadot/posts/"+p)
73-
db_reference.connect("new_data_update", self, "_on_db_data")
74-
db_reference.connect("patch_data_update", self, "_on_db_data")
72+
post_db_reference = Firebase.Database.get_database_reference("sociadot/posts/"+id)
73+
post_db_reference.connect("new_data_update", self, "_on_db_data")
74+
post_db_reference.connect("patch_data_update", self, "_on_db_data")
7575

7676
func set_user_id(id : String):
7777
user_id = id
@@ -162,7 +162,7 @@ func _on_LikeBtn_pressed():
162162
var love_particle : CPUParticles2D = Activities.love_particle_scene.instance()
163163
love_particle.add_to_control($PostContainer/ActionButtons/LikeBtn)
164164
RequestsManager.send_notification(UserData.user_id, user_id, "like", {post_id = id})
165-
RequestsManager.update_post_likes(likes, db_reference)
165+
RequestsManager.update_post_likes(likes, post_db_reference)
166166

167167

168168
func _on_db_data(resource : FirebaseResource):

main/scn/signin/signin.gd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func _on_auto_login(auth):
7272
func _on_SignContainer_logged(login):
7373
UserData.is_logged = true
7474
Firebase.Auth.save_auth(login)
75+
UserData.is_logged = true
7576
var firestore_task : FirestoreTask = RequestsManager.get_user(login.localid)
7677
var user_doc : FirestoreDocument = yield(firestore_task, "get_document")
7778
if user_doc.doc_fields.username == "":

project.godot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ UsersManager="*res://main/scripts/users_manager.gd"
252252
[debug]
253253

254254
gdscript/warnings/enable=false
255+
gdscript/completion/autocomplete_setters_and_getters=true
255256

256257
[display]
257258

@@ -280,6 +281,10 @@ environment_variables/clientId=""
280281
environment_variables/clientSecret=""
281282
environment_variables/domainUriPrefix=""
282283

284+
[global]
285+
286+
shadow=true
287+
283288
[gui]
284289

285290
theme/use_hidpi=true

0 commit comments

Comments
 (0)