Skip to content

Commit a1b6ec4

Browse files
committed
release update
1 parent 79e1ef9 commit a1b6ec4

File tree

10 files changed

+40
-27
lines changed

10 files changed

+40
-27
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# socia.dot
2-
socia.dot is a minimalistic open frontend, social network clone (like Instagram, Facebook, Twitter) completely developed with Godot in GDScript, built on top of our GodotFirebase addon as a backend interface for Firebase. This is just a Demo to give a general overview about all the features provided by GodotFirebase (Authentication, Firestore, Realtime Database, Storage).
2+
socia.dot is a minimalistic open frontend, social network clone (like Instagram, Facebook, Twitter) completely developed with Godot in GDScript, built on top of our GodotFirebase addon as a backend interface for Firebase. This is just a Demo to give a general overview about all the features provided by GodotFirebase (Authentication, Firestore, Realtime Database, Storage).
3+
4+
## Libraries
5+
This demo uses our [GodotFirebase](https://github.com/GodotNuts/GodotFirebase) addon to rely completely on Firebase as a backend.
6+
To run this project locally, please install and configure [GodotFirebase](https://github.com/GodotNuts/GodotFirebase) with your credentials.
7+
8+
This demo also uses some UI components provided by [GodotFirebase-UI](https://github.com/GodotNuts/GodotFirebase-UI), a library containing drag-n-drop components to speed up the development of UI components for Firebase.
9+
10+
## Live Demo
11+
Some live demos hosted by our team are available here:
12+
- [Windows demo]()
313

414
![home](./env/screenshots/home.png)

firebase-ui/buttons/base_button/base_button.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ func set_text_color(_color : Color) -> void:
132132

133133
func _gui_input(event : InputEvent):
134134
if not pressing:
135-
$Container/Hover.global_position = event.global_position
136-
if event is InputEventMouseButton:
135+
$Container/Hover.global_position = event.position
136+
if event is InputEventMouseButton or event is InputEventScreenTouch:
137137
if event.pressed:
138138
$Container/Hover.visible = true
139139
pressing = true

main/scn/app/main.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func _ready():
2323
get_tree().get_root().set_transparent_background(true)
2424
if OS.get_name() in ["Android", "iOS"]:
2525
for child in topbar.get_children():
26-
child.hide()
26+
if child is Control: child.hide()
2727
if OS.get_name() in ["HTML5"]:
2828
topbar.hide()
2929
loading.set_loading(false)

main/scn/post/post.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func set_user_id(id : String):
115115

116116
func set_description(d : String):
117117
description = d
118-
$PostContainer/Text.set_bbcode(d)
118+
$PostContainer/Text.set_bbcode(Utilities.parse_content(description))
119119
$PostContainer/Text.show()
120120

121121

main/scn/post/post.tscn

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ margin_right = 1024.0
122122
margin_bottom = 135.0
123123
custom_styles/normal = SubResource( 4 )
124124
custom_colors/default_color = Color( 1, 1, 1, 1 )
125-
text = "some
126-
text
127-
here"
125+
bbcode_enabled = true
128126
fit_content_height = true
129127
scroll_active = false
130128

main/scn/share/share.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ func _ready():
2828

2929
func _on_files_dropped(files : PoolStringArray, screen : int):
3030
for file_dropped in files:
31+
if not file_dropped.get_extension() in ["png","jpg"]:
32+
return
3133
set_texture(file_dropped)
3234
set_image(file_dropped)
3335

main/scn/show_post/show_post.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extends Panel
22

33
onready var post_image : TextureRect = $Post/PostContainer/Image
4-
onready var post_description : Label = $Post/PostContainer/Content/Container/Description
4+
onready var post_description : RichTextLabel = $Post/PostContainer/Content/Container/Description
55
onready var timestamp : Label = $Post/PostContainer/Content/Container/Header/Timestamp
66
onready var header : InteractiveHeader = $Post/PostContainer/Content/Container/Header
77
onready var comments_container : ScrollContainer = $Post/PostContainer/Content/Container/CommentsContainer
@@ -74,7 +74,7 @@ func set_description(desc : String):
7474
description = desc
7575
if desc == "":
7676
post_description.hide()
77-
post_description.set_text(description)
77+
post_description.set_bbcode(Utilities.parse_content(description))
7878

7979
func set_user(usr):
8080
user = usr

main/scn/show_post/show_post.tscn

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,18 @@ margin_bottom = 60.0
169169
size_flags_horizontal = 11
170170
size_flags_vertical = 5
171171

172-
[node name="Description" type="Label" parent="Post/PostContainer/Content/Container"]
172+
[node name="Description" type="RichTextLabel" parent="Post/PostContainer/Content/Container"]
173173
margin_top = 65.0
174174
margin_right = 280.0
175-
margin_bottom = 92.0
176-
autowrap = true
175+
margin_bottom = 85.0
176+
bbcode_enabled = true
177+
fit_content_height = true
178+
scroll_active = false
177179

178180
[node name="ActionButtons" parent="Post/PostContainer/Content/Container" instance=ExtResource( 7 )]
179-
margin_top = 97.0
181+
margin_top = 90.0
180182
margin_right = 280.0
181-
margin_bottom = 132.0
183+
margin_bottom = 125.0
182184

183185
[node name="LikeBtn" parent="Post/PostContainer/Content/Container/ActionButtons" index="0"]
184186
margin_left = 55.0
@@ -191,24 +193,24 @@ margin_right = 225.0
191193
margin_bottom = 35.0
192194

193195
[node name="HSeparator3" type="HSeparator" parent="Post/PostContainer/Content/Container"]
194-
margin_top = 137.0
196+
margin_top = 130.0
195197
margin_right = 280.0
196-
margin_bottom = 150.0
198+
margin_bottom = 143.0
197199
rect_min_size = Vector2( 0, 13 )
198200
size_flags_vertical = 4
199201
custom_styles/separator = SubResource( 7 )
200202
custom_constants/separation = 0
201203

202204
[node name="CommentsContainer" type="ScrollContainer" parent="Post/PostContainer/Content/Container"]
203-
margin_top = 155.0
205+
margin_top = 148.0
204206
margin_right = 280.0
205207
margin_bottom = 474.0
206208
size_flags_horizontal = 3
207209
size_flags_vertical = 3
208210

209211
[node name="CommentsList" type="VBoxContainer" parent="Post/PostContainer/Content/Container/CommentsContainer"]
210212
margin_right = 280.0
211-
margin_bottom = 319.0
213+
margin_bottom = 326.0
212214
size_flags_horizontal = 3
213215
size_flags_vertical = 3
214216
custom_constants/separation = 10

main/scripts/requests_manager.gd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,28 +80,29 @@ func get_post_image(user_id : String, post_id : String, post_image : String) ->
8080
return Firebase.Storage.ref("sociadot/posts/{user_id}/{post_id}/{post_image}".format({user_id = user_id, post_id = post_id, post_image = post_image})).get_data()
8181

8282
# Add a new post Document
83-
func add_post_doc(description : String, image_path : String, timestamp : int = RequestsManager.get_time()) -> FirestoreTask:
83+
func add_post_doc(description : String, image_path : String, timestamp : int = Utilities.get_time()) -> FirestoreTask:
8484
var add_post_task : FirestoreTask = posts_collection.add("", {
8585
user = UserData.user_name,
8686
user_id = UserData.user_id,
8787
description = description,
88-
image = RequestsManager.get_image_name(image_path),
88+
image = Utilities.get_image_name(image_path),
8989
timestamp = timestamp
9090
})
9191
add_post_task.connect("add_document", self, "_on_post_added")
9292
return add_post_task
9393

94-
func _on_post_added(post_doc : FirestoreDocument):
95-
Firebase.Database.get_database_reference("sociadot/posts").update(post_doc.doc_name, { user = post_doc.doc_fields.user_id })
96-
9794
# Add a post image to Storage
9895
func add_post_image(post_id : String, image_path : String, image : PoolByteArray) -> StorageTask:
9996
return Firebase.Storage.ref("sociadot/posts/{user_id}/{post_id}/{image_path}".format({
10097
user_id = UserData.user_id,
10198
post_id = post_id,
102-
image_path = RequestsManager.get_image_name(image_path)
99+
image_path = Utilities.get_image_name(image_path)
103100
})).put_data(image)
104101

102+
func _on_post_added(post_doc : FirestoreDocument):
103+
Firebase.Database.get_database_reference("sociadot/posts").update(post_doc.doc_name, { user = post_doc.doc_fields.user_id })
104+
105+
105106

106107
func update_post_likes(likes : Array, post_db : FirebaseDatabaseReference) -> void:
107108
post_db.update("", {likes = likes})

project.godot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ _global_script_classes=[ {
119119
"language": "GDScript",
120120
"path": "res://main/scn/header/interactive/interactive_header.gd"
121121
}, {
122-
"base": "Reference",
122+
"base": "PanelContainer",
123123
"class": "PostContainer",
124124
"language": "GDScript",
125125
"path": "res://main/scn/post/post.gd"
@@ -204,7 +204,7 @@ window/stretch/aspect="keep_width"
204204

205205
[editor_plugins]
206206

207-
enabled=PoolStringArray( "godot-firebase" )
207+
enabled=PoolStringArray( "res://addons/godot-firebase/plugin.cfg" )
208208

209209
[gui]
210210

0 commit comments

Comments
 (0)