@@ -3,18 +3,19 @@ extends PanelContainer
3
3
signal show_error ()
4
4
signal loading ()
5
5
6
- onready var posts_section : VBoxContainer = $ HomeContainer/Sections/Posts
7
- onready var post_box : VBoxContainer = posts_section .get_node ("ScrollPost/PostContainer" )
6
+ onready var sections_container : VBoxContainer = $ HomeContainer/Sections
7
+ onready var posts_section : VBoxContainer = sections_container .get_node ("Posts" )
8
+ onready var users_list_section : VBoxContainer = sections_container .get_node ("UsersList" )
9
+ onready var settings_section : VBoxContainer = sections_container .get_node ("Settings" )
10
+ onready var profile_section : VBoxContainer = sections_container .get_node ("Profile" )
8
11
9
- onready var profile_section : VBoxContainer = $ HomeContainer/Sections/Profile
12
+ onready var post_box : VBoxContainer = posts_section . get_node ( "ScrollPost/PostContainer" )
10
13
onready var profile_post_container : VBoxContainer = profile_section .get_node ("ScrollPost/PostContainer" )
11
14
12
15
onready var menu : VBoxContainer = $ HomeContainer/Menu
13
16
onready var side_bar : VBoxContainer = $ HomeContainer/SideBar
14
17
onready var friend_list : VBoxContainer = side_bar .get_node ("FriendList" )
15
18
16
- onready var users_list_section : VBoxContainer = $ HomeContainer/Sections/UsersList
17
- onready var settings_section : VBoxContainer = $ HomeContainer/Sections/Settings
18
19
19
20
onready var chat_container : GridContainer = $ AspectRatioContainer/ChatContainer
20
21
@@ -28,6 +29,8 @@ var friend_posts : Array = []
28
29
29
30
var posts_db_reference : FirebaseDatabaseReference
30
31
32
+ var window_size : Vector2
33
+
31
34
func _connect_signals ():
32
35
connect ("item_rect_changed" , self , "_on_Home_item_rect_changed" )
33
36
$ ShareSomethingContainer .connect ("share_post" , self , "add_shared_post" )
@@ -173,10 +176,7 @@ func _on_show_user_profile(user_id : String, user_name : String):
173
176
show_section (profile_section )
174
177
profile_section .load_profile (user_id , user_name )
175
178
emit_signal ("loading" , false )
176
-
177
179
178
- func display_post (post_document : Dictionary ):
179
- pass
180
180
181
181
func _on_ShareBtn_pressed ():
182
182
$ ShareSomethingContainer .show ()
@@ -201,7 +201,7 @@ func _on_show_chat(chat_node : ChatNode):
201
201
202
202
203
203
func show_section (section : Control ) -> void :
204
- for _section in $ HomeContainer/Sections .get_children ():
204
+ for _section in sections_container .get_children ():
205
205
_section .hide ()
206
206
section .show ()
207
207
@@ -234,6 +234,9 @@ func _on_NotificationsBtn_pressed():
234
234
pass
235
235
236
236
func _on_Home_item_rect_changed ():
237
+ update_chat_container ()
238
+
239
+ func update_chat_container ():
237
240
if chat_container == null :
238
241
return
239
242
chat_container .set_columns (floor (rect_size .x / 300 ))
0 commit comments