├── .gitignore
├── README.md
├── firebase-ui
├── auth
│ ├── google_sign_container
│ │ ├── google_sign_container.gd
│ │ └── google_sign_container.tscn
│ └── sign_container
│ │ ├── sign_container.gd
│ │ └── sign_container.tscn
├── buttons
│ ├── anonymous_button
│ │ └── anonymous_button.tscn
│ ├── base_button
│ │ ├── base_button.gd
│ │ └── base_button.tscn
│ ├── email_button
│ │ └── email_button.tscn
│ ├── facebook_button
│ │ └── facebook_button.tscn
│ ├── github_button
│ │ └── github_button.tscn
│ ├── google_button
│ │ ├── google_button.gd
│ │ └── google_button.tscn
│ ├── google_token_button
│ │ ├── google_token_button.gd
│ │ └── google_token_button.tscn
│ ├── res
│ │ └── icons
│ │ │ ├── LICENSE
│ │ │ ├── anonymous.svg
│ │ │ ├── anonymous.svg.import
│ │ │ ├── facebook-24px.svg
│ │ │ ├── facebook-24px.svg.import
│ │ │ ├── forward_to_inbox-24px.svg
│ │ │ ├── forward_to_inbox-24px.svg.import
│ │ │ ├── github.svg
│ │ │ ├── github.svg.import
│ │ │ ├── google-glass-logo.svg
│ │ │ ├── google-glass-logo.svg.import
│ │ │ ├── hover.svg
│ │ │ ├── hover.svg.import
│ │ │ ├── mail-24px.svg
│ │ │ ├── mail-24px.svg.import
│ │ │ ├── token.svg
│ │ │ ├── token.svg.import
│ │ │ ├── twitter.svg
│ │ │ └── twitter.svg.import
│ └── twitter_button
│ │ └── twitter_button.tscn
├── database_box_containers
│ ├── base_boxcontainer
│ │ ├── CircularContainer.gd
│ │ └── FirebaseContainer.gd
│ ├── circularboxcontainer
│ │ └── FirebaseCircularContainer.tscn
│ ├── hboxcontainer
│ │ └── FirebaseHBoxContainer.tscn
│ └── vboxcontainer
│ │ └── FirebaseVBoxContainer.tscn
├── field_containers
│ ├── base_field_container
│ │ ├── field_container.gd
│ │ └── field_container.tscn
│ ├── email_field
│ │ ├── email_field.tscn
│ │ └── email_logic.gd
│ ├── icons
│ │ ├── LICENSE
│ │ ├── generating_tokens_black_36dp.svg
│ │ ├── generating_tokens_black_36dp.svg.import
│ │ ├── mail.svg
│ │ ├── mail.svg.import
│ │ ├── password.svg
│ │ └── password.svg.import
│ ├── password_field
│ │ └── password_field.tscn
│ └── token_field
│ │ └── token_field.tscn
├── res
│ └── fonts
│ │ └── Roboto-Medium.ttf
└── tilemaps
│ └── firestore_tilemap
│ ├── firestore_tilemap.gd
│ └── firestore_tilemap.tscn
├── icon.png
└── images
├── .gdignore
└── demo_1.gif
/.gitignore:
--------------------------------------------------------------------------------
1 | # Project-specific ignores
2 | addons/
3 | test/
4 | project.godot
5 | icon.png.import
6 | default_env.tres
7 |
8 | # Godot-specific ignores
9 | .import/
10 | export.cfg
11 | export_presets.cfg
12 |
13 | # Imported translations (automatically generated from CSV files)
14 | *.translation
15 |
16 | # Mono-specific ignores
17 | .mono/
18 | data_*/
19 |
20 | .DS_Store
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GodotFirebase-UI
2 |
3 | A library for Godot Engine built on top of [GodotFirebase addon](), and provides drop-in nodes with self-contained Authentication, Firestore, and Database functions.
4 | Instance a component, connect its signals, and you are ready!
5 |
6 | ## FirebaseUI
7 | This library is inspired by [FirebaseUI](https://firebase.google.com/docs/auth/web/firebaseui), which is a library specifically built to implement ready-to-use components on top of the Firebase SDK.
8 | Along with the development of our addon [GodotFirebase], we decided to provide our own collection of Godot Engine components in the form of ready-to-use nodes, already configured to communicate with our library to facilitate Authentication, Firestore, and Database management, and so on.
9 |
10 | ## Components
11 | *Components* are simple nodes with custom scripts and styles in a way that they are configurable both with GDScript and within the Inspector.
12 | Components can be grouped in three main categories:
13 | - Base Components, such as base buttons and fields: they can be further customized in aspect and functions
14 | - Top Components, such as ready to use buttons (Google button, Anonymous login button), fields (email field, password field), containers (Auth, Firestore, Database).
15 | - Dynamic Components, such as a TileMap that has CRUD operations operating against Firestore for extremely dynamic map generation.
16 |
17 | ### List of available components
18 | |Component|Usage|
19 | |-|-|
20 | |`CustomBaseButton (/buttons/base_button/base_button.tscn)`|A customizable basic button with icon and colored text|
21 | |`EmailButton (/buttons/email_button/email_button.tscn)`|A button for email sign-up / sign-in processes|
22 | |`EmailField (/field_containers/email_field/email_field.tscn)`|A field container for emails, with email-check logic|
23 | |`SignContainer (/auth/sign_container/sign_container.tscn)`|A container for Firebase Authentication|
24 | |`FirestoreTileMap (/tilemaps/firestore_tilemap/firestore_tilemap.tscn)`|A TileMap which provides CRUD operations combined with Firestore|
25 | 
--------------------------------------------------------------------------------
/firebase-ui/auth/google_sign_container/google_sign_container.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends Control
3 |
4 | onready var token_field : FieldContainer = $Container/TokenField
5 |
6 | var token : String
7 |
8 | signal logging()
9 | signal signed(signup)
10 | signal error(message)
11 |
12 | func _connect() -> void:
13 | Firebase.Auth.connect("login_failed", self, "_on_login_failed")
14 | Firebase.Auth.connect("login_succeeded", self, "_on_login_succeeded")
15 |
16 | func _disconnect() -> void:
17 | Firebase.Auth.disconnect("login_failed", self, "_on_login_failed")
18 | Firebase.Auth.disconnect("login_succeeded", self, "_on_login_succeeded")
19 |
20 | func _ready():
21 | pass
22 |
23 | func verify_fields() -> bool:
24 | token = token_field.get_text()
25 | return not (token in [""," "])
26 |
27 | func _on_GoogleButton_pressed() -> void:
28 | if verify_fields():
29 | _connect()
30 | emit_signal("logging")
31 | Firebase.Auth.login_with_oauth(token)
32 | else:
33 | printerr("ERROR invalid_login: a token must be use to login.")
34 |
35 | func _on_login_failed(code, message):
36 | printerr("ERROR %s: %s" % [code, message])
37 | emit_signal("error", message)
38 | _disconnect()
39 |
40 | func _on_login_succeeded(login : Dictionary):
41 | emit_signal("logged", login)
42 | _disconnect()
43 |
44 | func _clean():
45 | token = ""
46 | token_field.set_text(token)
47 |
--------------------------------------------------------------------------------
/firebase-ui/auth/google_sign_container/google_sign_container.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=8 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/auth/google_sign_container/google_sign_container.gd" type="Script" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/google_button/google_button.tscn" type="PackedScene" id=2]
5 | [ext_resource path="res://firebase-ui/field_containers/token_field/token_field.tscn" type="PackedScene" id=3]
6 |
7 | [sub_resource type="StyleBoxFlat" id=1]
8 | content_margin_left = 15.0
9 | content_margin_right = 15.0
10 | content_margin_top = 15.0
11 | content_margin_bottom = 15.0
12 | bg_color = Color( 1, 0.886275, 0.639216, 0 )
13 |
14 | [sub_resource type="StyleBoxFlat" id=2]
15 | resource_local_to_scene = true
16 | resource_name = "FieldContainerResource"
17 | content_margin_left = 20.0
18 | content_margin_right = 25.0
19 | content_margin_top = 10.0
20 | content_margin_bottom = 10.0
21 | bg_color = Color( 1, 1, 1, 1 )
22 | corner_radius_top_left = 25
23 | corner_radius_top_right = 25
24 | corner_radius_bottom_right = 25
25 | corner_radius_bottom_left = 25
26 | shadow_color = Color( 0, 0, 0, 0.117647 )
27 | shadow_size = 4
28 | shadow_offset = Vector2( 0, 3 )
29 |
30 | [sub_resource type="StyleBoxEmpty" id=3]
31 |
32 | [sub_resource type="StyleBoxFlat" id=4]
33 | resource_local_to_scene = true
34 | resource_name = "GoogleButtonResource"
35 | content_margin_left = 0.0
36 | content_margin_right = 0.0
37 | content_margin_top = 0.0
38 | content_margin_bottom = 0.0
39 | bg_color = Color( 1, 1, 1, 1 )
40 | corner_radius_top_left = 8
41 | corner_radius_top_right = 8
42 | corner_radius_bottom_right = 8
43 | corner_radius_bottom_left = 8
44 | corner_detail = 20
45 | shadow_color = Color( 0, 0, 0, 0.117647 )
46 | shadow_size = 4
47 | shadow_offset = Vector2( 0, 2 )
48 |
49 | [node name="GoogleSignContainer" type="PanelContainer"]
50 | anchor_right = 0.312
51 | anchor_bottom = 0.306667
52 | margin_right = 0.511993
53 | custom_styles/panel = SubResource( 1 )
54 | script = ExtResource( 1 )
55 | __meta__ = {
56 | "_edit_use_anchors_": true
57 | }
58 |
59 | [node name="Container" type="VBoxContainer" parent="."]
60 | margin_left = 15.0
61 | margin_top = 15.0
62 | margin_right = 305.0
63 | margin_bottom = 169.0
64 | rect_min_size = Vector2( 290, 0 )
65 | custom_constants/separation = 10
66 | __meta__ = {
67 | "_edit_use_anchors_": true
68 | }
69 |
70 | [node name="TokenField" parent="Container" instance=ExtResource( 3 )]
71 | anchor_right = 0.0
72 | anchor_bottom = 0.0
73 | margin_right = 290.0
74 | margin_bottom = 52.0
75 | custom_styles/panel = SubResource( 2 )
76 |
77 | [node name="HSeparator" type="HSeparator" parent="Container"]
78 | margin_top = 62.0
79 | margin_right = 290.0
80 | margin_bottom = 82.0
81 | custom_styles/separator = SubResource( 3 )
82 | custom_constants/separation = 20
83 |
84 | [node name="ButtonsContainer" type="VBoxContainer" parent="Container"]
85 | margin_top = 92.0
86 | margin_right = 290.0
87 | margin_bottom = 154.0
88 | size_flags_vertical = 10
89 | custom_constants/separation = 10
90 |
91 | [node name="GoogleButton" parent="Container/ButtonsContainer" instance=ExtResource( 2 )]
92 | anchor_right = 0.0
93 | anchor_bottom = 0.0
94 | margin_right = 290.0
95 | margin_bottom = 62.0
96 | custom_styles/panel = SubResource( 4 )
97 |
98 | [connection signal="pressed" from="Container/ButtonsContainer/GoogleButton" to="." method="_on_GoogleButton_pressed"]
99 |
--------------------------------------------------------------------------------
/firebase-ui/auth/sign_container/sign_container.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends Control
3 |
4 | export (bool) var automatic_signup : bool = true setget set_automatic_signup
5 | export (bool) var anonymous_signup : bool = false setget set_anonymous_signup
6 |
7 | onready var email_field : FieldContainer = $Container/EmailField
8 | onready var password_field : FieldContainer = $Container/PasswordField
9 |
10 | var email : String
11 | var password : String
12 |
13 | signal logging()
14 | signal logged(login)
15 | signal signed(signup)
16 | signal error(message)
17 |
18 | func _ready():
19 | pass
20 |
21 | func _connect() -> void:
22 | Firebase.Auth.connect("login_failed", self, "_on_login_failed")
23 | Firebase.Auth.connect("login_succeeded", self, "_on_login_succeeded")
24 | Firebase.Auth.connect("signup_succeeded", self, "_on_signup_succeeded")
25 |
26 | func _disconnect() -> void:
27 | Firebase.Auth.disconnect("login_failed", self, "_on_login_failed")
28 | Firebase.Auth.disconnect("login_succeeded", self, "_on_login_succeeded")
29 | Firebase.Auth.disconnect("signup_succeeded", self, "_on_signup_succeeded")
30 |
31 | func verify_fields() -> bool:
32 | email = email_field.get_text()
33 | password = password_field.get_text()
34 | return not (email in [""," "] and password in [""," "])
35 |
36 | func set_automatic_signup(automatic : bool):
37 | automatic_signup = automatic
38 | if has_node("Container/ButtonsContainer/SignupButton"):
39 | $Container/ButtonsContainer/SignupButton.visible = not automatic_signup
40 | $Container/ButtonsContainer/Separator.visible = false if (automatic_signup and not anonymous_signup) else true
41 |
42 | func set_anonymous_signup(anonymous : bool):
43 | anonymous_signup = anonymous
44 | if has_node("Container/ButtonsContainer/AnonymousButton"):
45 | $Container/ButtonsContainer/AnonymousButton.visible = anonymous_signup
46 | $Container/ButtonsContainer/Separator.visible = false if (automatic_signup and not anonymous_signup) else true
47 |
48 | func _on_EmailButton_pressed():
49 | if verify_fields():
50 | _connect()
51 | emit_signal("logging")
52 | Firebase.Auth.login_with_email_and_password(email, password)
53 | else:
54 | print("Email and Password must be valid and non-empty.")
55 |
56 | func _on_SignupButton_pressed():
57 | _connect()
58 | if verify_fields():
59 | emit_signal("logging")
60 | Firebase.Auth.signup_with_email_and_password(email, password)
61 | else:
62 | print("Email and Password must be valid and non-empty.")
63 |
64 |
65 | func _on_AnonymousButton_pressed():
66 | _connect()
67 | Firebase.Auth.login_anonymous()
68 |
69 | func _on_login_failed(code, message):
70 | print("ERROR %s: %s" % [code, message])
71 | match message:
72 | "EMAIL_NOT_FOUND":
73 | if automatic_signup:
74 | Firebase.Auth.signup_with_email_and_password(email, password)
75 | return
76 | "EMAIL_EXISTS":
77 | pass
78 | "INVALID_PASSWORD":
79 | pass
80 | emit_signal("error", message)
81 | _disconnect()
82 |
83 | func _on_login_succeeded(login : Dictionary):
84 | emit_signal("logged", login)
85 | _disconnect()
86 |
87 | func _on_signup_succeeded(signup : Dictionary):
88 | emit_signal("signed", signup)
89 | _disconnect()
90 |
--------------------------------------------------------------------------------
/firebase-ui/auth/sign_container/sign_container.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=17 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/field_containers/password_field/password_field.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/field_containers/email_field/email_field.tscn" type="PackedScene" id=2]
5 | [ext_resource path="res://firebase-ui/buttons/email_button/email_button.tscn" type="PackedScene" id=3]
6 | [ext_resource path="res://firebase-ui/buttons/res/icons/forward_to_inbox-24px.svg" type="Texture" id=4]
7 | [ext_resource path="res://firebase-ui/auth/sign_container/sign_container.gd" type="Script" id=5]
8 | [ext_resource path="res://firebase-ui/buttons/anonymous_button/anonymous_button.tscn" type="PackedScene" id=6]
9 | [ext_resource path="res://firebase-ui/field_containers/base_field_container/field_container.gd" type="Script" id=7]
10 |
11 | [sub_resource type="StyleBoxFlat" id=1]
12 | content_margin_left = 15.0
13 | content_margin_right = 15.0
14 | content_margin_top = 15.0
15 | content_margin_bottom = 15.0
16 | bg_color = Color( 0.6, 0.6, 0.6, 0 )
17 |
18 | [sub_resource type="StyleBoxFlat" id=2]
19 | resource_local_to_scene = true
20 | content_margin_left = 20.0
21 | content_margin_right = 25.0
22 | content_margin_top = 10.0
23 | content_margin_bottom = 10.0
24 | bg_color = Color( 1, 1, 1, 1 )
25 | corner_radius_top_left = 25
26 | corner_radius_top_right = 25
27 | corner_radius_bottom_right = 25
28 | corner_radius_bottom_left = 25
29 | shadow_color = Color( 0, 0, 0, 0.117647 )
30 | shadow_size = 4
31 | shadow_offset = Vector2( 0, 3 )
32 |
33 | [sub_resource type="StyleBoxFlat" id=3]
34 | resource_local_to_scene = true
35 | content_margin_left = 20.0
36 | content_margin_right = 25.0
37 | content_margin_top = 10.0
38 | content_margin_bottom = 10.0
39 | bg_color = Color( 1, 1, 1, 1 )
40 | corner_radius_top_left = 25
41 | corner_radius_top_right = 25
42 | corner_radius_bottom_right = 25
43 | corner_radius_bottom_left = 25
44 | shadow_color = Color( 0, 0, 0, 0.117647 )
45 | shadow_size = 4
46 | shadow_offset = Vector2( 0, 3 )
47 |
48 | [sub_resource type="StyleBoxEmpty" id=4]
49 |
50 | [sub_resource type="StyleBoxFlat" id=5]
51 | resource_local_to_scene = true
52 | content_margin_left = 0.0
53 | content_margin_right = 0.0
54 | content_margin_top = 0.0
55 | content_margin_bottom = 0.0
56 | bg_color = Color( 0.815686, 0.00784314, 0.105882, 1 )
57 | corner_radius_top_left = 8
58 | corner_radius_top_right = 8
59 | corner_radius_bottom_right = 8
60 | corner_radius_bottom_left = 8
61 | corner_detail = 20
62 | shadow_color = Color( 0, 0, 0, 0.117647 )
63 | shadow_size = 4
64 | shadow_offset = Vector2( 0, 2 )
65 |
66 | [sub_resource type="StyleBoxLine" id=6]
67 | color = Color( 0.458824, 0.458824, 0.458824, 1 )
68 |
69 | [sub_resource type="StyleBoxEmpty" id=7]
70 | content_margin_left = 10.0
71 | content_margin_right = 10.0
72 |
73 | [sub_resource type="StyleBoxFlat" id=8]
74 | resource_local_to_scene = true
75 | content_margin_left = 0.0
76 | content_margin_right = 0.0
77 | content_margin_top = 0.0
78 | content_margin_bottom = 0.0
79 | bg_color = Color( 0.815686, 0.00784314, 0.105882, 1 )
80 | corner_radius_top_left = 8
81 | corner_radius_top_right = 8
82 | corner_radius_bottom_right = 8
83 | corner_radius_bottom_left = 8
84 | corner_detail = 20
85 | shadow_color = Color( 0, 0, 0, 0.117647 )
86 | shadow_size = 4
87 | shadow_offset = Vector2( 0, 2 )
88 |
89 | [sub_resource type="StyleBoxFlat" id=9]
90 | resource_local_to_scene = true
91 | resource_name = "AnonymousButtonResource"
92 | content_margin_left = 0.0
93 | content_margin_right = 0.0
94 | content_margin_top = 0.0
95 | content_margin_bottom = 0.0
96 | bg_color = Color( 0.956863, 0.705882, 0, 1 )
97 | corner_radius_top_left = 8
98 | corner_radius_top_right = 8
99 | corner_radius_bottom_right = 8
100 | corner_radius_bottom_left = 8
101 | corner_detail = 20
102 | shadow_color = Color( 0, 0, 0, 0.117647 )
103 | shadow_size = 4
104 | shadow_offset = Vector2( 0, 2 )
105 |
106 | [node name="SignContainer" type="PanelContainer"]
107 | anchor_right = 0.321766
108 | anchor_bottom = 0.426667
109 | margin_right = -9.48801
110 | custom_styles/panel = SubResource( 1 )
111 | script = ExtResource( 5 )
112 | __meta__ = {
113 | "_edit_use_anchors_": true
114 | }
115 |
116 | [node name="Container" type="VBoxContainer" parent="."]
117 | margin_left = 15.0
118 | margin_top = 15.0
119 | margin_right = 305.0
120 | margin_bottom = 241.0
121 | rect_min_size = Vector2( 290, 0 )
122 | custom_constants/separation = 10
123 | __meta__ = {
124 | "_edit_use_anchors_": true
125 | }
126 |
127 | [node name="EmailField" parent="Container" instance=ExtResource( 2 )]
128 | anchor_right = 0.0
129 | anchor_bottom = 0.0
130 | margin_right = 290.0
131 | margin_bottom = 52.0
132 | custom_styles/panel = SubResource( 2 )
133 |
134 | [node name="PasswordField" parent="Container" instance=ExtResource( 1 )]
135 | margin_top = 62.0
136 | margin_right = 290.0
137 | margin_bottom = 114.0
138 | custom_styles/panel = SubResource( 3 )
139 | script = ExtResource( 7 )
140 | size = Vector2( 32, 32 )
141 | text = ""
142 |
143 | [node name="HSeparator" type="HSeparator" parent="Container"]
144 | margin_top = 124.0
145 | margin_right = 290.0
146 | margin_bottom = 154.0
147 | custom_styles/separator = SubResource( 4 )
148 | custom_constants/separation = 30
149 |
150 | [node name="ButtonsContainer" type="VBoxContainer" parent="Container"]
151 | margin_top = 164.0
152 | margin_right = 290.0
153 | margin_bottom = 226.0
154 | size_flags_vertical = 10
155 | custom_constants/separation = 10
156 |
157 | [node name="EmailButton" parent="Container/ButtonsContainer" instance=ExtResource( 3 )]
158 | anchor_right = 0.0
159 | anchor_bottom = 0.0
160 | margin_right = 290.0
161 | margin_bottom = 62.0
162 | custom_styles/panel = SubResource( 5 )
163 |
164 | [node name="Separator" type="HBoxContainer" parent="Container/ButtonsContainer"]
165 | visible = false
166 | margin_top = 72.0
167 | margin_right = 290.0
168 | margin_bottom = 86.0
169 |
170 | [node name="LSeparator" type="HSeparator" parent="Container/ButtonsContainer/Separator"]
171 | margin_right = 124.0
172 | margin_bottom = 14.0
173 | size_flags_horizontal = 3
174 | custom_styles/separator = SubResource( 6 )
175 |
176 | [node name="Or" type="Label" parent="Container/ButtonsContainer/Separator"]
177 | margin_left = 128.0
178 | margin_right = 161.0
179 | margin_bottom = 14.0
180 | custom_styles/normal = SubResource( 7 )
181 | custom_colors/font_color = Color( 0.458824, 0.458824, 0.458824, 1 )
182 | text = "or"
183 |
184 | [node name="RSeparator" type="HSeparator" parent="Container/ButtonsContainer/Separator"]
185 | margin_left = 165.0
186 | margin_right = 290.0
187 | margin_bottom = 14.0
188 | size_flags_horizontal = 3
189 | custom_styles/separator = SubResource( 6 )
190 |
191 | [node name="SignupButton" parent="Container/ButtonsContainer" instance=ExtResource( 3 )]
192 | visible = false
193 | anchor_right = 0.0
194 | anchor_bottom = 0.0
195 | margin_top = 96.0
196 | margin_right = 290.0
197 | margin_bottom = 158.0
198 | custom_styles/panel = SubResource( 8 )
199 | texture = ExtResource( 4 )
200 | text = "Sign up with email"
201 |
202 | [node name="AnonymousButton" parent="Container/ButtonsContainer" instance=ExtResource( 6 )]
203 | visible = false
204 | anchor_right = 0.0
205 | anchor_bottom = 0.0
206 | margin_top = 96.0
207 | margin_right = 290.0
208 | margin_bottom = 158.0
209 | custom_styles/panel = SubResource( 9 )
210 |
211 | [connection signal="pressed" from="Container/ButtonsContainer/EmailButton" to="." method="_on_EmailButton_pressed"]
212 | [connection signal="pressed" from="Container/ButtonsContainer/SignupButton" to="." method="_on_SignupButton_pressed"]
213 | [connection signal="pressed" from="Container/ButtonsContainer/AnonymousButton" to="." method="_on_AnonymousButton_pressed"]
214 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/anonymous_button/anonymous_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/anonymous.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "AnonymousButtonResource"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 0.956863, 0.705882, 0, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [node name="AnonymousButton" instance=ExtResource( 1 )]
24 | margin_bottom = 0.199997
25 | custom_styles/panel = SubResource( 1 )
26 | texture = ExtResource( 2 )
27 | text = "Sign in anonymously"
28 | text_color = Color( 1, 1, 1, 1 )
29 |
30 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
31 | texture = ExtResource( 2 )
32 |
33 | [node name="Text" parent="Container/ButtonContainer" index="1"]
34 | custom_colors/font_color = Color( 1, 1, 1, 1 )
35 | text = "Sign in anonymously"
36 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/base_button/base_button.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends PanelContainer
3 | class_name CustomBaseButton
4 |
5 | signal pressed()
6 | signal released()
7 |
8 | var texture : Texture = null setget set_texture
9 | var expand : bool = false setget set_expand
10 | var size : Vector2 = Vector2(32, 32) setget _set_size
11 | var modulate_color : Color = Color.white setget set_texture_modulate
12 |
13 | var text : String = "" setget set_text
14 | var text_color : Color = Color.white setget set_text_color
15 |
16 | var pressing : bool = false
17 |
18 | func _get_property_list():
19 | return [
20 | {
21 | "class_name": "CustomBaseButton",
22 | "hint": PROPERTY_HINT_NONE,
23 | "usage": PROPERTY_USAGE_CATEGORY,
24 | "name": "CustomBaseButton",
25 | "type": TYPE_STRING
26 | },
27 | {
28 | "usage": PROPERTY_USAGE_GROUP,
29 | "name": "Icon",
30 | "type": TYPE_STRING
31 | },
32 | {
33 | "hint": PROPERTY_HINT_RESOURCE_TYPE,
34 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
35 | "name": "texture",
36 | "hint_string": "Texture",
37 | "type": TYPE_OBJECT
38 | },
39 | {
40 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
41 | "name": "modulate_color",
42 | "type": TYPE_COLOR
43 | },
44 | {
45 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
46 | "name": "expand",
47 | "type": TYPE_BOOL
48 | },
49 | {
50 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
51 | "name": "size",
52 | "type": TYPE_VECTOR2
53 | },
54 | {
55 | "usage": PROPERTY_USAGE_GROUP,
56 | "name": "Contents",
57 | "type": TYPE_STRING
58 | },
59 | {
60 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
61 | "name": "text",
62 | "type": TYPE_STRING
63 | },
64 | {
65 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
66 | "name": "text_color",
67 | "type": TYPE_COLOR
68 | },
69 |
70 | ]
71 |
72 | func _set(property, value):
73 | match property:
74 | "texture":
75 | set_texture(value)
76 | return true
77 | "expand":
78 | set_expand(value)
79 | return true
80 | "size":
81 | _set_size(value)
82 | return true
83 | "modulate_color":
84 | set_texture_modulate(value)
85 | return true
86 | "text":
87 | set_text(value)
88 | return true
89 | "text_color":
90 | set_text_color(value)
91 | return true
92 |
93 | func _ready():
94 | set_texture(texture)
95 | set_text(text)
96 | set_text_color(text_color)
97 | _set_size(size)
98 | set_texture_modulate(modulate_color)
99 | $Container/Hover.scale = Vector2()
100 |
101 | func set_texture(_texture : Texture) -> void:
102 | texture = _texture
103 | if has_node("Container/ButtonContainer/Icon"):
104 | $Container/ButtonContainer/Icon.set_texture(texture)
105 |
106 |
107 | func set_expand(_expand : bool):
108 | expand = _expand
109 | if has_node("Container/ButtonContainer/Icon"):
110 | $Container/ButtonContainer/Icon.expand = expand
111 |
112 | func _set_size(_size : Vector2):
113 | size = _size
114 | if has_node("Container/ButtonContainer/Icon"):
115 | $Container/ButtonContainer/Icon.rect_min_size = size
116 |
117 | func set_texture_modulate(_color : Color) -> void:
118 | modulate_color = _color
119 | if has_node("Container/ButtonContainer/Icon"):
120 | $Container/ButtonContainer/Icon.modulate = modulate_color
121 |
122 | func set_text(_text : String) -> void:
123 | text = _text
124 | if has_node("Container/ButtonContainer/Text"):
125 | $Container/ButtonContainer/Text.set_text(text)
126 |
127 |
128 | func set_text_color(_color : Color) -> void:
129 | text_color = _color
130 | if has_node("Container/ButtonContainer/Text"):
131 | $Container/ButtonContainer/Text.set("custom_colors/font_color", text_color)
132 |
133 | func _gui_input(event : InputEvent):
134 | if not pressing:
135 | $Container/Hover.global_position = event.global_position
136 | if event is InputEventMouseButton:
137 | if event.pressed:
138 | $Container/Hover.visible = true
139 | pressing = true
140 | _pressed()
141 | emit_signal("pressed")
142 | else:
143 | $Container/Hover.visible = false
144 | $Container/Hover.scale = Vector2()
145 | pressing = false
146 | _released()
147 | emit_signal("released")
148 |
149 | func _process(delta : float):
150 | if pressing:
151 | $Container/Hover.scale += Vector2(delta*30,delta*30)
152 |
153 | func _pressed() -> void:
154 | pass
155 |
156 | func _released() -> void:
157 | pass
158 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/base_button/base_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=5 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.gd" type="Script" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/hover.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "GithubButtonResource"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 1, 1, 1, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [sub_resource type="StyleBoxEmpty" id=2]
24 | content_margin_left = 15.0
25 | content_margin_right = 15.0
26 | content_margin_top = 15.0
27 | content_margin_bottom = 15.0
28 |
29 | [node name="CustomBaseButton" type="PanelContainer"]
30 | anchor_right = 0.3125
31 | anchor_bottom = 0.103
32 | margin_bottom = -9.8
33 | custom_styles/panel = SubResource( 1 )
34 | script = ExtResource( 1 )
35 | __meta__ = {
36 | "_edit_use_anchors_": true
37 | }
38 | texture = null
39 | modulate_color = Color( 1, 1, 1, 1 )
40 | expand = true
41 | size = Vector2( 32, 32 )
42 | text = ""
43 | text_color = Color( 0, 0, 0, 1 )
44 |
45 | [node name="Container" type="PanelContainer" parent="."]
46 | margin_right = 320.0
47 | margin_bottom = 62.0
48 | rect_clip_content = true
49 | mouse_filter = 1
50 | custom_styles/panel = SubResource( 2 )
51 |
52 | [node name="ButtonContainer" type="HBoxContainer" parent="Container"]
53 | margin_left = 15.0
54 | margin_top = 15.0
55 | margin_right = 305.0
56 | margin_bottom = 47.0
57 |
58 | [node name="Icon" type="TextureRect" parent="Container/ButtonContainer"]
59 | margin_right = 32.0
60 | margin_bottom = 32.0
61 | rect_min_size = Vector2( 32, 32 )
62 | size_flags_vertical = 4
63 | expand = true
64 |
65 | [node name="Text" type="Label" parent="Container/ButtonContainer"]
66 | margin_left = 36.0
67 | margin_top = 9.0
68 | margin_right = 290.0
69 | margin_bottom = 23.0
70 | size_flags_horizontal = 3
71 | custom_colors/font_color = Color( 0, 0, 0, 1 )
72 | align = 1
73 |
74 | [node name="Hover" type="Sprite" parent="Container"]
75 | modulate = Color( 1, 1, 1, 0.0588235 )
76 | position = Vector2( 152, 32 )
77 | scale = Vector2( 1e-05, 1e-05 )
78 | texture = ExtResource( 2 )
79 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/email_button/email_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/mail-24px.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "EmailButtonResource"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 0.815686, 0.00784314, 0.105882, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [node name="EmailButton" instance=ExtResource( 1 )]
24 | anchor_right = 0.312
25 | anchor_bottom = 0.107
26 | margin_right = 0.511993
27 | margin_bottom = -2.2
28 | custom_styles/panel = SubResource( 1 )
29 | texture = ExtResource( 2 )
30 | text = "Sign in with email"
31 | text_color = Color( 1, 1, 1, 1 )
32 |
33 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
34 | texture = ExtResource( 2 )
35 |
36 | [node name="Text" parent="Container/ButtonContainer" index="1"]
37 | custom_colors/font_color = Color( 1, 1, 1, 1 )
38 | text = "Sign in with email"
39 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/facebook_button/facebook_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/facebook-24px.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "FacebookButton"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 0.231373, 0.34902, 0.596078, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [node name="FacebookButton" instance=ExtResource( 1 )]
24 | anchor_right = 0.312
25 | margin_right = 0.511993
26 | margin_bottom = 0.199997
27 | custom_styles/panel = SubResource( 1 )
28 | texture = ExtResource( 2 )
29 | text = "Sign in with Facebook"
30 | text_color = Color( 1, 1, 1, 1 )
31 |
32 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
33 | texture = ExtResource( 2 )
34 |
35 | [node name="Text" parent="Container/ButtonContainer" index="1"]
36 | custom_colors/font_color = Color( 1, 1, 1, 1 )
37 | text = "Sign in with Facebook"
38 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/github_button/github_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/github.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "GithubButtonResource"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 0.141176, 0.160784, 0.180392, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [node name="GithubButton" instance=ExtResource( 1 )]
24 | margin_bottom = 0.199997
25 | custom_styles/panel = SubResource( 1 )
26 | texture = ExtResource( 2 )
27 | text = "Sign in with GitHub"
28 | text_color = Color( 1, 1, 1, 1 )
29 |
30 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
31 | texture = ExtResource( 2 )
32 |
33 | [node name="Text" parent="Container/ButtonContainer" index="1"]
34 | custom_colors/font_color = Color( 1, 1, 1, 1 )
35 | text = "Sign in with GitHub"
36 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/google_button/google_button.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends CustomBaseButton
3 |
4 | var oauth : String = ""
5 |
6 | func _pressed() -> void:
7 | pass
8 |
9 | func _released() -> void:
10 | pass
11 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/google_button/google_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=5 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/google-glass-logo.svg" type="Texture" id=2]
5 | [ext_resource path="res://firebase-ui/buttons/google_button/google_button.gd" type="Script" id=3]
6 |
7 | [sub_resource type="StyleBoxFlat" id=1]
8 | resource_local_to_scene = true
9 | resource_name = "GoogleButtonResource"
10 | content_margin_left = 0.0
11 | content_margin_right = 0.0
12 | content_margin_top = 0.0
13 | content_margin_bottom = 0.0
14 | bg_color = Color( 1, 1, 1, 1 )
15 | corner_radius_top_left = 8
16 | corner_radius_top_right = 8
17 | corner_radius_bottom_right = 8
18 | corner_radius_bottom_left = 8
19 | corner_detail = 20
20 | shadow_color = Color( 0, 0, 0, 0.117647 )
21 | shadow_size = 4
22 | shadow_offset = Vector2( 0, 2 )
23 |
24 | [node name="GoogleButton" instance=ExtResource( 1 )]
25 | anchor_bottom = 0.103333
26 | margin_bottom = 0.0
27 | custom_styles/panel = SubResource( 1 )
28 | script = ExtResource( 3 )
29 | texture = ExtResource( 2 )
30 | modulate_color = Color( 0, 0, 0, 1 )
31 | text = "Sign in with Google"
32 |
33 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
34 | modulate = Color( 0, 0, 0, 1 )
35 | texture = ExtResource( 2 )
36 |
37 | [node name="Text" parent="Container/ButtonContainer" index="1"]
38 | text = "Sign in with Google"
39 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/google_token_button/google_token_button.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends CustomBaseButton
3 |
4 | func _pressed() -> void:
5 | pass
6 |
7 | func _released() -> void:
8 | Firebase.Auth.get_google_auth()
9 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/google_token_button/google_token_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=6 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/google_token_button/google_token_button.gd" type="Script" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/token.svg" type="Texture" id=2]
5 | [ext_resource path="res://firebase-ui/buttons/res/icons/hover.svg" type="Texture" id=3]
6 |
7 | [sub_resource type="StyleBoxFlat" id=1]
8 | resource_local_to_scene = true
9 | resource_name = "GoogleButtonResource"
10 | content_margin_left = 0.0
11 | content_margin_right = 0.0
12 | content_margin_top = 0.0
13 | content_margin_bottom = 0.0
14 | bg_color = Color( 1, 1, 1, 1 )
15 | corner_radius_top_left = 8
16 | corner_radius_top_right = 8
17 | corner_radius_bottom_right = 8
18 | corner_radius_bottom_left = 8
19 | corner_detail = 20
20 | shadow_color = Color( 0, 0, 0, 0.117647 )
21 | shadow_size = 4
22 | shadow_offset = Vector2( 0, 2 )
23 |
24 | [sub_resource type="StyleBoxEmpty" id=2]
25 | content_margin_left = 15.0
26 | content_margin_right = 15.0
27 | content_margin_top = 15.0
28 | content_margin_bottom = 15.0
29 |
30 | [node name="GoogleButton" type="PanelContainer"]
31 | anchor_right = 0.3125
32 | anchor_bottom = 0.103333
33 | custom_styles/panel = SubResource( 1 )
34 | script = ExtResource( 1 )
35 | __meta__ = {
36 | "_edit_use_anchors_": true
37 | }
38 | texture = ExtResource( 2 )
39 | modulate_color = Color( 0, 0, 0, 1 )
40 | expand = true
41 | size = Vector2( 32, 32 )
42 | text = "Get Google Token"
43 | text_color = Color( 0, 0, 0, 1 )
44 |
45 | [node name="Container" type="PanelContainer" parent="."]
46 | margin_right = 320.0
47 | margin_bottom = 62.0
48 | rect_clip_content = true
49 | mouse_filter = 1
50 | custom_styles/panel = SubResource( 2 )
51 |
52 | [node name="ButtonContainer" type="HBoxContainer" parent="Container"]
53 | margin_left = 15.0
54 | margin_top = 15.0
55 | margin_right = 305.0
56 | margin_bottom = 47.0
57 |
58 | [node name="Icon" type="TextureRect" parent="Container/ButtonContainer"]
59 | modulate = Color( 0, 0, 0, 1 )
60 | margin_right = 32.0
61 | margin_bottom = 32.0
62 | rect_min_size = Vector2( 32, 32 )
63 | size_flags_vertical = 4
64 | texture = ExtResource( 2 )
65 | expand = true
66 |
67 | [node name="Text" type="Label" parent="Container/ButtonContainer"]
68 | margin_left = 36.0
69 | margin_top = 9.0
70 | margin_right = 290.0
71 | margin_bottom = 23.0
72 | size_flags_horizontal = 3
73 | custom_colors/font_color = Color( 0, 0, 0, 1 )
74 | text = "Get Google Token"
75 | align = 1
76 |
77 | [node name="Hover" type="Sprite" parent="Container"]
78 | modulate = Color( 1, 1, 1, 0.0588235 )
79 | position = Vector2( 152, 32 )
80 | scale = Vector2( 1e-05, 1e-05 )
81 | texture = ExtResource( 3 )
82 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/LICENSE:
--------------------------------------------------------------------------------
1 | # Icons : Apache 2.0
2 | Copyright 2021 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/anonymous.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/anonymous.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/anonymous.svg-b7c63d1dff0cb89a2a3340dbae4577e2.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/anonymous.svg"
13 | dest_files=[ "res://.import/anonymous.svg-b7c63d1dff0cb89a2a3340dbae4577e2.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=0.1
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/facebook-24px.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/facebook-24px.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/facebook-24px.svg-d24e8bd94e15fdeb4b2e76ae5b45c236.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/facebook-24px.svg"
13 | dest_files=[ "res://.import/facebook-24px.svg-d24e8bd94e15fdeb4b2e76ae5b45c236.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=2.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/forward_to_inbox-24px.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/forward_to_inbox-24px.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/forward_to_inbox-24px.svg-fc526454e2634587816bb6bd14cfcdee.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/forward_to_inbox-24px.svg"
13 | dest_files=[ "res://.import/forward_to_inbox-24px.svg-fc526454e2634587816bb6bd14cfcdee.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=2.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/github.svg:
--------------------------------------------------------------------------------
1 |
2 |
66 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/github.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/github.svg-5bc1979192eda2e663ea4bbda1f3cab2.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/github.svg"
13 | dest_files=[ "res://.import/github.svg-5bc1979192eda2e663ea4bbda1f3cab2.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=true
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=3.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/google-glass-logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
44 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/google-glass-logo.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/google-glass-logo.svg-11d0b6e9a33fa4e6215635cb25d2897a.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/google-glass-logo.svg"
13 | dest_files=[ "res://.import/google-glass-logo.svg-11d0b6e9a33fa4e6215635cb25d2897a.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=0.1
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/hover.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/hover.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/hover.svg-28f22e4173f08faa9debe54a2510fa60.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/hover.svg"
13 | dest_files=[ "res://.import/hover.svg-28f22e4173f08faa9debe54a2510fa60.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=true
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=false
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=1.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/mail-24px.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/mail-24px.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/mail-24px.svg-cc243c080a18326b52a34464d6aca079.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/mail-24px.svg"
13 | dest_files=[ "res://.import/mail-24px.svg-cc243c080a18326b52a34464d6aca079.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=2.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/token.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/token.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/token.svg-d5ede286313de3812d701347545571d1.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/token.svg"
13 | dest_files=[ "res://.import/token.svg-d5ede286313de3812d701347545571d1.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=true
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=1.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
67 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/res/icons/twitter.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/twitter.svg-00578c69490df28b6b78e0a49a388328.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/buttons/res/icons/twitter.svg"
13 | dest_files=[ "res://.import/twitter.svg-00578c69490df28b6b78e0a49a388328.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=true
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=false
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=3.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/buttons/twitter_button/twitter_button.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/buttons/base_button/base_button.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/buttons/res/icons/twitter.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "TwitterButton"
9 | content_margin_left = 0.0
10 | content_margin_right = 0.0
11 | content_margin_top = 0.0
12 | content_margin_bottom = 0.0
13 | bg_color = Color( 0.356863, 0.666667, 0.956863, 1 )
14 | corner_radius_top_left = 8
15 | corner_radius_top_right = 8
16 | corner_radius_bottom_right = 8
17 | corner_radius_bottom_left = 8
18 | corner_detail = 20
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 2 )
22 |
23 | [node name="TwitterButton" instance=ExtResource( 1 )]
24 | margin_bottom = 0.199993
25 | custom_styles/panel = SubResource( 1 )
26 | texture = ExtResource( 2 )
27 | text = "Sign in with Twitter"
28 | text_color = Color( 1, 1, 1, 1 )
29 |
30 | [node name="Icon" parent="Container/ButtonContainer" index="0"]
31 | texture = ExtResource( 2 )
32 |
33 | [node name="Text" parent="Container/ButtonContainer" index="1"]
34 | custom_colors/font_color = Color( 1, 1, 1, 1 )
35 | text = "Sign in with Twitter"
36 |
--------------------------------------------------------------------------------
/firebase-ui/database_box_containers/base_boxcontainer/CircularContainer.gd:
--------------------------------------------------------------------------------
1 | tool
2 | class_name CircularContainer
3 | extends FirebaseContainer
4 |
5 | export (float) var Radius setget set_radius
6 | export (float) var OffsetInRadians setget set_offset
7 |
8 | func set_radius(value):
9 | if value:
10 | Radius = value
11 | layout_all_children()
12 |
13 | func set_offset(value):
14 | if value:
15 | OffsetInRadians = value
16 | layout_all_children()
17 |
18 | var tween
19 |
20 | func _ready():
21 | tween = get_parent().get_node("Tween")
22 |
23 | func add_child(node : Node, legible_unique_name := false):
24 | .add_child(node, legible_unique_name)
25 | layout_all_children()
26 | pass
27 |
28 | func remove_child(node: Node):
29 | .remove_child(node)
30 | layout_all_children()
31 |
32 | func layout_all_children():
33 | var child_count = get_child_count()
34 | if child_count > 0:
35 | var current_angle_amount = deg2rad(360.0 / child_count)
36 | for idx in child_count:
37 | var child = get_child(idx)
38 | var current_angle = (current_angle_amount * idx) + OffsetInRadians
39 | var cart = polar2cartesian(Radius, current_angle)
40 | if child.rect_global_position == rect_global_position:
41 | child.rect_global_position = ((rect_global_position + rect_size) / 2.0)
42 | var new_pos = cart + ((rect_global_position + rect_size) / 2.0)
43 | tween.interpolate_property(child, "rect_global_position", child.rect_global_position, new_pos, 0.5, Tween.TRANS_LINEAR, Tween.EASE_IN_OUT, 2.0)
44 | tween.start()
45 |
--------------------------------------------------------------------------------
/firebase-ui/database_box_containers/base_boxcontainer/FirebaseContainer.gd:
--------------------------------------------------------------------------------
1 | tool
2 | class_name FirebaseContainer
3 | extends Control
4 |
5 | signal item_selected(item, id, template)
6 | signal item_deleted(item, id, template)
7 |
8 | export (PackedScene) var ItemTemplate
9 |
10 | var tracked_values = {}
11 |
12 | export (String) var CurrentPath
13 | export (bool) var OneShot = false
14 | export (String) var SpecifiedKey
15 | var db_ref
16 |
17 | func _ready():
18 | if Firebase.Auth.auth.keys().empty():
19 | Firebase.Auth.connect("login_succeeded", self, "on_login_succeeded")
20 | Firebase.Auth.connect("signup_succeeded", self, "on_login_succeeded")
21 | else:
22 | connect_to_database()
23 |
24 | func on_login_succeeded(_auth_token):
25 | connect_to_database()
26 |
27 | func connect_to_database():
28 | if !SpecifiedKey:
29 | db_ref = Firebase.Database.get_database_reference(CurrentPath, { })
30 | else:
31 | db_ref = Firebase.Database.get_database_reference(CurrentPath + "/" + SpecifiedKey)
32 |
33 | db_ref.connect("new_data_update", self, "on_new_update", [], CONNECT_ONESHOT if OneShot else CONNECT_PERSIST)
34 | if !OneShot:
35 | db_ref.connect("patch_data_update", self, "on_patch_update")
36 |
37 | func on_new_update(data):
38 | if data.data:
39 | var item = data.data
40 | var template = ItemTemplate.instance()
41 | add_child(template)
42 | template.set_item(item)
43 | on_item_added(item, null, template)
44 |
45 | func on_item_added(item, key, template):
46 | # yield(get_tree(), "idle_frame")
47 | # get_parent().scroll_vertical = get_parent().get_v_scrollbar().max_value
48 | pass
49 |
50 | func on_patch_update(data):
51 | if data.data and data.path:
52 | if tracked_values.has(data.path):
53 | tracked_values[data.path].template.set_item(data.data)
54 |
55 | func delete_child(key):
56 | var item = tracked_values[key]
57 | remove_child(item.template)
58 | tracked_values.erase(key)
59 |
60 | func on_data_delete(data):
61 | if data:
62 | for key in data.keys():
63 | if tracked_values.has(key):
64 | delete_child(key)
65 |
--------------------------------------------------------------------------------
/firebase-ui/database_box_containers/circularboxcontainer/FirebaseCircularContainer.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/database_box_containers/circularboxcontainer/CircularContainer.gd" type="Script" id=1]
4 |
5 | [node name="CircularContainer" type="Container"]
6 | margin_right = 1024.0
7 | margin_bottom = 464.0
8 | size_flags_horizontal = 3
9 | size_flags_vertical = 3
10 | script = ExtResource( 1 )
11 |
12 |
--------------------------------------------------------------------------------
/firebase-ui/database_box_containers/hboxcontainer/FirebaseHBoxContainer.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/database_box_containers/base_boxcontainer/FirebaseContainer.gd" type="Script" id=1]
4 |
5 |
6 | [node name="FirebaseHBoxContainer" type="HBoxContainer"]
7 | margin_left = 512.0
8 | margin_right = 512.0
9 | grow_vertical = 0
10 | size_flags_horizontal = 6
11 | alignment = 1
12 | script = ExtResource( 1 )
13 |
14 |
--------------------------------------------------------------------------------
/firebase-ui/database_box_containers/vboxcontainer/FirebaseVBoxContainer.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/database_box_containers/base_boxcontainer/FirebaseContainer.gd" type="Script" id=1]
4 |
5 |
6 | [node name="FirebaseVBoxContainer" type="VBoxContainer"]
7 | margin_left = 512.0
8 | margin_right = 512.0
9 | grow_vertical = 0
10 | size_flags_horizontal = 6
11 | alignment = 1
12 | script = ExtResource( 1 )
13 |
14 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/base_field_container/field_container.gd:
--------------------------------------------------------------------------------
1 | tool
2 | extends PanelContainer
3 | class_name FieldContainer
4 |
5 |
6 | var texture : Texture = null setget set_texture
7 | var expand : bool = false setget set_expand
8 | var size : Vector2 = Vector2(32, 32) setget _set_size
9 | var modulate_color : Color = Color.white setget set_texture_modulate
10 |
11 | var text : String = "" setget set_text
12 | var text_color : Color = Color.white setget set_text_color
13 |
14 | var pressing : bool = false
15 |
16 | func _get_property_list():
17 | return [
18 | {
19 | "class_name": "FieldContainer",
20 | "hint": PROPERTY_HINT_NONE,
21 | "usage": PROPERTY_USAGE_CATEGORY,
22 | "name": "FieldContainer",
23 | "type": TYPE_STRING
24 | },
25 | {
26 | "usage": PROPERTY_USAGE_GROUP,
27 | "name": "Icon",
28 | "type": TYPE_STRING
29 | },
30 | {
31 | "hint": PROPERTY_HINT_RESOURCE_TYPE,
32 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
33 | "name": "texture",
34 | "hint_string": "Texture",
35 | "type": TYPE_OBJECT
36 | },
37 | {
38 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
39 | "name": "modulate_color",
40 | "type": TYPE_COLOR
41 | },
42 | {
43 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
44 | "name": "expand",
45 | "type": TYPE_BOOL
46 | },
47 | {
48 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
49 | "name": "size",
50 | "type": TYPE_VECTOR2
51 | },
52 | {
53 | "usage": PROPERTY_USAGE_GROUP,
54 | "name": "Contents",
55 | "type": TYPE_STRING
56 | },
57 | {
58 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
59 | "name": "text",
60 | "type": TYPE_STRING
61 | },
62 | {
63 | "usage": PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_SCRIPT_VARIABLE,
64 | "name": "text_color",
65 | "type": TYPE_COLOR
66 | },
67 |
68 | ]
69 |
70 | func _set(property, value):
71 | match property:
72 | "texture":
73 | set_texture(value)
74 | return true
75 | "expand":
76 | set_expand(value)
77 | return true
78 | "size":
79 | _set_size(value)
80 | return true
81 | "modulate_color":
82 | set_texture_modulate(value)
83 | return true
84 | "text":
85 | set_text(value)
86 | return true
87 | "text_color":
88 | set_text_color(value)
89 | return true
90 |
91 | func _ready():
92 | set_texture(texture)
93 | set_text(text)
94 | set_text_color(text_color)
95 | _set_size(size)
96 | set_texture_modulate(modulate_color)
97 |
98 | func set_texture(_texture : Texture) -> void:
99 | texture = _texture
100 | if has_node("Container/Icon"):
101 | $Container/Icon.set_texture(texture)
102 |
103 |
104 | func set_expand(_expand : bool):
105 | expand = _expand
106 | if has_node("Container/Icon"):
107 | $Container/Icon.expand = expand
108 |
109 | func _set_size(_size : Vector2):
110 | size = _size
111 | if has_node("Container/Icon"):
112 | $Container/Icon.rect_min_size = size
113 |
114 | func set_texture_modulate(_color : Color) -> void:
115 | modulate_color = _color
116 | if has_node("Container/Icon"):
117 | $Container/Icon.modulate = modulate_color
118 |
119 | func set_text(_text : String) -> void:
120 | text = _text
121 | if has_node("Container/FieldEdit"):
122 | $Container/FieldEdit.set_text(text)
123 |
124 |
125 | func set_text_color(_color : Color) -> void:
126 | text_color = _color
127 | if has_node("Container/FieldEdit"):
128 | $Container/FieldEdit.set("custom_colors/font_color", text_color)
129 |
130 | func get_text() -> String:
131 | return $Container/FieldEdit.get_text()
132 |
133 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/base_field_container/field_container.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=6 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/field_containers/base_field_container/field_container.gd" type="Script" id=1]
4 |
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "FieldContainerResource"
9 | content_margin_left = 20.0
10 | content_margin_right = 25.0
11 | content_margin_top = 10.0
12 | content_margin_bottom = 10.0
13 | bg_color = Color( 1, 1, 1, 1 )
14 | corner_radius_top_left = 25
15 | corner_radius_top_right = 25
16 | corner_radius_bottom_right = 25
17 | corner_radius_bottom_left = 25
18 | shadow_color = Color( 0, 0, 0, 0.117647 )
19 | shadow_size = 4
20 | shadow_offset = Vector2( 0, 3 )
21 |
22 | [sub_resource type="StyleBoxFlat" id=2]
23 | draw_center = false
24 | border_width_bottom = 2
25 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
26 |
27 | [sub_resource type="StyleBoxFlat" id=3]
28 | draw_center = false
29 | border_width_bottom = 2
30 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
31 |
32 | [sub_resource type="StyleBoxFlat" id=4]
33 | draw_center = false
34 | border_width_bottom = 2
35 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
36 |
37 | [node name="FieldContainer" type="PanelContainer"]
38 | anchor_right = 0.391
39 | anchor_bottom = 0.087
40 | margin_right = -0.384003
41 | margin_bottom = -0.200005
42 | custom_styles/panel = SubResource( 1 )
43 | script = ExtResource( 1 )
44 | __meta__ = {
45 | "_edit_use_anchors_": false
46 | }
47 | texture = null
48 | modulate_color = Color( 1, 1, 1, 1 )
49 | expand = false
50 | size = Vector2( 32, 32 )
51 | text = ""
52 | text_color = Color( 1, 1, 1, 1 )
53 |
54 | [node name="Container" type="HBoxContainer" parent="."]
55 | margin_left = 20.0
56 | margin_top = 10.0
57 | margin_right = 375.0
58 | margin_bottom = 42.0
59 | custom_constants/separation = 10
60 |
61 | [node name="Icon" type="TextureRect" parent="Container"]
62 | self_modulate = Color( 0.329412, 0.329412, 0.329412, 1 )
63 | margin_right = 32.0
64 | margin_bottom = 32.0
65 | rect_min_size = Vector2( 32, 32 )
66 | stretch_mode = 6
67 |
68 | [node name="FieldEdit" type="LineEdit" parent="Container"]
69 | margin_left = 42.0
70 | margin_right = 355.0
71 | margin_bottom = 32.0
72 | size_flags_horizontal = 3
73 | size_flags_vertical = 3
74 | custom_styles/read_only = SubResource( 2 )
75 | custom_styles/focus = SubResource( 3 )
76 | custom_styles/normal = SubResource( 4 )
77 | custom_colors/font_color = Color( 1, 1, 1, 1 )
78 | placeholder_alpha = 0.4
79 | caret_blink = true
80 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/email_field/email_field.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=5 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/field_containers/base_field_container/field_container.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/field_containers/icons/mail.svg" type="Texture" id=2]
5 | [ext_resource path="res://firebase-ui/field_containers/email_field/email_logic.gd" type="Script" id=3]
6 |
7 | [sub_resource type="StyleBoxFlat" id=1]
8 | resource_local_to_scene = true
9 | resource_name = "FieldContainerResource"
10 | content_margin_left = 20.0
11 | content_margin_right = 25.0
12 | content_margin_top = 10.0
13 | content_margin_bottom = 10.0
14 | bg_color = Color( 1, 1, 1, 1 )
15 | corner_radius_top_left = 25
16 | corner_radius_top_right = 25
17 | corner_radius_bottom_right = 25
18 | corner_radius_bottom_left = 25
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 3 )
22 |
23 | [node name="EmailField" instance=ExtResource( 1 )]
24 | custom_styles/panel = SubResource( 1 )
25 | texture = ExtResource( 2 )
26 | modulate_color = Color( 0.219608, 0.219608, 0.219608, 1 )
27 | expand = true
28 | text_color = Color( 0.254902, 0.254902, 0.254902, 1 )
29 |
30 | [node name="Icon" parent="Container" index="0"]
31 | modulate = Color( 0.219608, 0.219608, 0.219608, 1 )
32 | self_modulate = Color( 1, 1, 1, 1 )
33 | texture = ExtResource( 2 )
34 | expand = true
35 |
36 | [node name="FieldEdit" parent="Container" index="1"]
37 | custom_colors/font_color = Color( 0.254902, 0.254902, 0.254902, 1 )
38 | placeholder_text = "email"
39 |
40 | [node name="EmailLogic" type="Node" parent="Container/FieldEdit" index="2"]
41 | script = ExtResource( 3 )
42 | [connection signal="focus_exited" from="Container/FieldEdit" to="Container/FieldEdit/EmailLogic" method="_on_FieldEdit_focus_exited"]
43 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/email_field/email_logic.gd:
--------------------------------------------------------------------------------
1 | extends Node
2 |
3 |
4 |
5 |
6 |
7 |
8 | func _on_FieldEdit_focus_exited():
9 | var email : String = get_parent().get_text()
10 | if not email in [""," "]:
11 | if not "@" in email:
12 | printerr("EmailField does not contain a proper email adress.")
13 |
14 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/LICENSE:
--------------------------------------------------------------------------------
1 | # Icons : Apache 2.0
2 | Copyright 2021 Google LLC
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/generating_tokens_black_36dp.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/generating_tokens_black_36dp.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/generating_tokens_black_36dp.svg-08d915df9258fdc21ec95dfb6d15cca4.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/field_containers/icons/generating_tokens_black_36dp.svg"
13 | dest_files=[ "res://.import/generating_tokens_black_36dp.svg-08d915df9258fdc21ec95dfb6d15cca4.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=true
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=1.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/mail.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/mail.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/mail.svg-31adf12002304cd6a1342015dbd350ea.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/field_containers/icons/mail.svg"
13 | dest_files=[ "res://.import/mail.svg-31adf12002304cd6a1342015dbd350ea.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=2.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/password.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/icons/password.svg.import:
--------------------------------------------------------------------------------
1 | [remap]
2 |
3 | importer="texture"
4 | type="StreamTexture"
5 | path="res://.import/password.svg-4f65b65607e987582125573e2f6575ba.stex"
6 | metadata={
7 | "vram_texture": false
8 | }
9 |
10 | [deps]
11 |
12 | source_file="res://firebase-ui/field_containers/icons/password.svg"
13 | dest_files=[ "res://.import/password.svg-4f65b65607e987582125573e2f6575ba.stex" ]
14 |
15 | [params]
16 |
17 | compress/mode=0
18 | compress/lossy_quality=0.7
19 | compress/hdr_mode=0
20 | compress/bptc_ldr=0
21 | compress/normal_map=0
22 | flags/repeat=0
23 | flags/filter=true
24 | flags/mipmaps=false
25 | flags/anisotropic=false
26 | flags/srgb=2
27 | process/fix_alpha_border=false
28 | process/premult_alpha=false
29 | process/HDR_as_SRGB=false
30 | process/invert_color=true
31 | stream=false
32 | size_limit=0
33 | detect_3d=true
34 | svg/scale=2.0
35 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/password_field/password_field.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=4 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/field_containers/email_field/email_field.tscn" type="PackedScene" id=1]
4 | [ext_resource path="res://firebase-ui/field_containers/icons/password.svg" type="Texture" id=2]
5 |
6 |
7 | [sub_resource type="StyleBoxFlat" id=1]
8 | resource_local_to_scene = true
9 | resource_name = "FieldContainerResource"
10 | content_margin_left = 20.0
11 | content_margin_right = 25.0
12 | content_margin_top = 10.0
13 | content_margin_bottom = 10.0
14 | bg_color = Color( 1, 1, 1, 1 )
15 | corner_radius_top_left = 25
16 | corner_radius_top_right = 25
17 | corner_radius_bottom_right = 25
18 | corner_radius_bottom_left = 25
19 | shadow_color = Color( 0, 0, 0, 0.117647 )
20 | shadow_size = 4
21 | shadow_offset = Vector2( 0, 3 )
22 |
23 | [node name="PasswordField" instance=ExtResource( 1 )]
24 | custom_styles/panel = SubResource( 1 )
25 | texture = ExtResource( 2 )
26 |
27 | [node name="Icon" parent="Container" index="0"]
28 | texture = ExtResource( 2 )
29 |
30 | [node name="FieldEdit" parent="Container" index="1"]
31 | secret = true
32 | placeholder_text = "password"
33 |
--------------------------------------------------------------------------------
/firebase-ui/field_containers/token_field/token_field.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=7 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/field_containers/base_field_container/field_container.gd" type="Script" id=1]
4 | [ext_resource path="res://firebase-ui/field_containers/icons/generating_tokens_black_36dp.svg" type="Texture" id=2]
5 |
6 | [sub_resource type="StyleBoxFlat" id=1]
7 | resource_local_to_scene = true
8 | resource_name = "FieldContainerResource"
9 | content_margin_left = 20.0
10 | content_margin_right = 25.0
11 | content_margin_top = 10.0
12 | content_margin_bottom = 10.0
13 | bg_color = Color( 1, 1, 1, 1 )
14 | corner_radius_top_left = 25
15 | corner_radius_top_right = 25
16 | corner_radius_bottom_right = 25
17 | corner_radius_bottom_left = 25
18 | shadow_color = Color( 0, 0, 0, 0.117647 )
19 | shadow_size = 4
20 | shadow_offset = Vector2( 0, 3 )
21 |
22 | [sub_resource type="StyleBoxFlat" id=2]
23 | draw_center = false
24 | border_width_bottom = 2
25 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
26 |
27 | [sub_resource type="StyleBoxFlat" id=3]
28 | draw_center = false
29 | border_width_bottom = 2
30 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
31 |
32 | [sub_resource type="StyleBoxFlat" id=4]
33 | draw_center = false
34 | border_width_bottom = 2
35 | border_color = Color( 0.329412, 0.329412, 0.329412, 1 )
36 |
37 | [node name="TokenField" type="PanelContainer"]
38 | anchor_right = 0.391
39 | anchor_bottom = 0.087
40 | margin_right = -0.384003
41 | margin_bottom = -0.200005
42 | custom_styles/panel = SubResource( 1 )
43 | script = ExtResource( 1 )
44 | __meta__ = {
45 | "_edit_use_anchors_": false
46 | }
47 | texture = ExtResource( 2 )
48 | modulate_color = Color( 0.219608, 0.219608, 0.219608, 1 )
49 | expand = true
50 | size = Vector2( 32, 32 )
51 | text = ""
52 | text_color = Color( 0.254902, 0.254902, 0.254902, 1 )
53 |
54 | [node name="Container" type="HBoxContainer" parent="."]
55 | margin_left = 20.0
56 | margin_top = 10.0
57 | margin_right = 375.0
58 | margin_bottom = 42.0
59 | custom_constants/separation = 10
60 |
61 | [node name="Icon" type="TextureRect" parent="Container"]
62 | modulate = Color( 0.219608, 0.219608, 0.219608, 1 )
63 | margin_right = 32.0
64 | margin_bottom = 32.0
65 | rect_min_size = Vector2( 32, 32 )
66 | texture = ExtResource( 2 )
67 | expand = true
68 | stretch_mode = 6
69 |
70 | [node name="FieldEdit" type="LineEdit" parent="Container"]
71 | margin_left = 42.0
72 | margin_right = 355.0
73 | margin_bottom = 32.0
74 | size_flags_horizontal = 3
75 | size_flags_vertical = 3
76 | custom_styles/read_only = SubResource( 2 )
77 | custom_styles/focus = SubResource( 3 )
78 | custom_styles/normal = SubResource( 4 )
79 | custom_colors/font_color = Color( 0.254902, 0.254902, 0.254902, 1 )
80 | secret = true
81 | placeholder_text = "token"
82 | placeholder_alpha = 0.4
83 | caret_blink = true
84 |
--------------------------------------------------------------------------------
/firebase-ui/res/fonts/Roboto-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GodotNuts/GodotFirebase-UI/803f29cb0f143fd5cd95df3366f6e9ec02a6e0e8/firebase-ui/res/fonts/Roboto-Medium.ttf
--------------------------------------------------------------------------------
/firebase-ui/tilemaps/firestore_tilemap/firestore_tilemap.gd:
--------------------------------------------------------------------------------
1 | class_name FirestoreTileMap
2 | extends TileMap
3 |
4 | # This node ensures that the tilemap is up-to-date with the latest
5 | # data stored in your Firestore instance, defined by the appropriate path
6 | # that is exported below
7 |
8 | export (String) onready var CollectionName
9 | export (String) onready var DocumentId
10 | export (String) onready var MapName
11 | export (bool) onready var CreateNew
12 | export (bool) onready var Update
13 |
14 | func _ready() -> void:
15 | if Firebase.Auth.auth == null or Firebase.Auth.auth.keys().empty():
16 | Firebase.Auth.connect("login_succeeded", self, "on_firebase_login_succeeded")
17 | Firebase.Auth.connect("signup_succeeded", self, "on_firebase_login_succeeded")
18 | else:
19 | on_firebase_login_succeeded(null)
20 |
21 | func on_firebase_login_succeeded(login_info) -> void:
22 | if CollectionName:
23 | var coll = Firebase.Firestore.collection(CollectionName)
24 | if not coll.is_connected("error", self, "on_error"):
25 | coll.connect("error", self, "_on_error")
26 | if not CreateNew and not Update:
27 | coll.connect("get_document", self, "_on_document_received", [], CONNECT_ONESHOT)
28 | coll.get(DocumentId)
29 | else:
30 | coll.connect("update_document", self, "_on_document_received", [], CONNECT_ONESHOT)
31 | _serialize_data(coll, DocumentId)
32 |
33 | func _serialize_data(coll, doc_name = ""):
34 | var cells_by_id = get_used_cells()
35 | var cell_map = { }
36 | for cell in cells_by_id:
37 | cell_map[var2str(cell)] = get_cellv(cell)
38 | if CreateNew:
39 | coll.add("", {"MapName" : MapName, "Cells": JSON.print(cell_map) })
40 | elif Update:
41 | coll.update(doc_name, {"MapName" : MapName, "Cells": cell_map })
42 |
43 | func _on_document_received(document) -> void:
44 | MapName = document.doc_fields["MapName"]
45 | clear()
46 | DocumentId = document.doc_name
47 | print(DocumentId)
48 | var cells = JSON.parse(document.doc_fields["Cells"]).result
49 | for cell in cells.keys():
50 | set_cellv(str2var(cell), cells[cell])
51 |
52 | update_bitmask_region()
53 | update_dirty_quadrants()
54 |
55 | func _on_error(code, status, message):
56 | print(str(code) + " " + str(status) + " " + message)
--------------------------------------------------------------------------------
/firebase-ui/tilemaps/firestore_tilemap/firestore_tilemap.tscn:
--------------------------------------------------------------------------------
1 | [gd_scene load_steps=2 format=2]
2 |
3 | [ext_resource path="res://firebase-ui/tilemaps/firestore_tilemap/firestore_tilemap.gd" type="Script" id=2]
4 |
5 | [node name="FirestoreTileMap" type="TileMap"]
6 | cell_size = Vector2( 32, 32 )
7 | format = 1
8 | script = ExtResource( 2 )
9 |
--------------------------------------------------------------------------------
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GodotNuts/GodotFirebase-UI/803f29cb0f143fd5cd95df3366f6e9ec02a6e0e8/icon.png
--------------------------------------------------------------------------------
/images/.gdignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GodotNuts/GodotFirebase-UI/803f29cb0f143fd5cd95df3366f6e9ec02a6e0e8/images/.gdignore
--------------------------------------------------------------------------------
/images/demo_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GodotNuts/GodotFirebase-UI/803f29cb0f143fd5cd95df3366f6e9ec02a6e0e8/images/demo_1.gif
--------------------------------------------------------------------------------