Skip to content

Commit 3002037

Browse files
authored
Merge pull request #77 from fenix-hub/dev
Dev
2 parents b8fd4d0 + 2363211 commit 3002037

File tree

14 files changed

+1569
-1458
lines changed

14 files changed

+1569
-1458
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ screenshots/
2121

2222

2323

24+
25+
26+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ This plugin is now supported in [Godot Extended Library Discord](https://discord
99
A complete GitHub integration for your Godot Editor! Manage your project without even opening your browser.
1010

1111
Author: *"Nicolo (fenix) Santilio"*
12-
Version: *1.3.0*
12+
Version: *1.3.2*
1313
Wiki: *[supported](https://github.com/fenix-hub/godot-engine.github-integration/wiki)*
14-
Godot Version: *3.2.3beta1*
14+
Godot Version: *3.2.3stable*
1515

1616
<img align="center" src="addons/github-integration/screenshots/banner.png">
1717

addons/github-integration/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="GitHub integration"
44
description="Plugin to integrate GitHub requests directly via Godot Engine Editor"
55
author="Nicolo (fenix) Santilio"
6-
version="1.3.0"
6+
version="1.3.2"
77
script="scripts/github-integration.gd"

addons/github-integration/resources/themes/GitHubTheme.tres

Lines changed: 1368 additions & 1368 deletions
Large diffs are not rendered by default.

addons/github-integration/scenes/GitHub.tscn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ margin_bottom = 48.0
6363
rect_clip_content = true
6464

6565
[node name="loading" parent="." instance=ExtResource( 3 )]
66+
visible = false
6667
margin_top = 48.0
6768
color = Color( 0, 0, 0, 0.627451 )

addons/github-integration/scenes/Notifications.tscn

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,24 @@ custom_styles/separator = SubResource( 1 )
7070
custom_constants/separation = 10
7171

7272
[node name="Invitations" type="VBoxContainer" parent="NotificationsContainer/NotificationsTabs/Tabs"]
73-
visible = false
7473
margin_top = 14.0
7574
margin_right = 820.0
76-
margin_bottom = 430.0
75+
margin_bottom = 522.0
7776
size_flags_horizontal = 3
7877
size_flags_vertical = 3
7978

8079
[node name="Label" type="Label" parent="NotificationsContainer/NotificationsTabs/Tabs/Invitations"]
8180
margin_right = 820.0
8281
margin_bottom = 22.0
83-
text = "There are %s invitations received"
82+
text = "There are 0 invitations received"
8483

8584
[node name="Settings" type="VBoxContainer" parent="NotificationsContainer/NotificationsTabs/Tabs"]
85+
visible = false
8686
margin_top = 14.0
8787
margin_right = 820.0
88-
margin_bottom = 246.0
88+
margin_bottom = 266.0
8989
size_flags_horizontal = 3
90+
size_flags_vertical = 3
9091
custom_constants/separation = 20
9192

9293
[node name="Notifications" type="VBoxContainer" parent="NotificationsContainer/NotificationsTabs/Tabs/Settings"]
@@ -146,6 +147,7 @@ text = "minutes"
146147
margin_top = 108.0
147148
margin_right = 820.0
148149
margin_bottom = 232.0
150+
size_flags_vertical = 3
149151
custom_constants/separation = 0
150152

151153
[node name="Label" type="Label" parent="NotificationsContainer/NotificationsTabs/Tabs/Settings/Plugin"]
@@ -183,12 +185,36 @@ margin_bottom = 124.0
183185
rect_min_size = Vector2( 300, 0 )
184186
text = "Darkmode"
185187

188+
[node name="ResetPluginBtn" type="Button" parent="NotificationsContainer/NotificationsTabs/Tabs/Settings/Plugin"]
189+
margin_top = 370.0
190+
margin_right = 127.0
191+
margin_bottom = 400.0
192+
size_flags_horizontal = 0
193+
size_flags_vertical = 10
194+
custom_colors/font_color = Color( 1, 0, 0, 1 )
195+
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
196+
text = "Reset this plugin"
197+
186198
[node name="HSeparator2" type="HSeparator" parent="NotificationsContainer/NotificationsTabs/Tabs"]
187-
margin_top = 250.0
199+
margin_top = 526.0
188200
margin_right = 820.0
189-
margin_bottom = 260.0
201+
margin_bottom = 536.0
190202
custom_styles/separator = SubResource( 1 )
191203
custom_constants/separation = 10
192204

193205
[node name="Timer" type="Timer" parent="."]
194-
wait_time = 60.0
206+
wait_time = 300.0
207+
208+
[node name="ResetPluginDialog" type="ConfirmationDialog" parent="."]
209+
visible = true
210+
anchor_left = 0.5
211+
anchor_top = 0.5
212+
anchor_right = 0.5
213+
anchor_bottom = 0.5
214+
margin_left = -327.5
215+
margin_top = -46.5
216+
margin_right = 327.5
217+
margin_bottom = 46.5
218+
window_title = "Reset this plugin"
219+
dialog_text = "Resetting this plugin will delete everything that was stored from the first time.
220+
Continue only if you don't want to use this plugin anymore, or if it was suggested by the developer."

addons/github-integration/scenes/loading.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void vertex() {
2727

2828
[sub_resource type="ShaderMaterial" id=2]
2929
shader = SubResource( 1 )
30-
shader_param/speed = 5
30+
shader_param/speed = 0
3131

3232
[node name="loading" type="ColorRect"]
3333
anchor_right = 1.0

addons/github-integration/scripts/GitHub.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ func logout():
167167
Repo.hide()
168168
Commit.hide()
169169
Gist.hide()
170+
Notifications._clear()
171+
Notifications.hide()
170172
SignIn.Mail.text = ""
171173
SignIn.Token.text = ""
174+
UserData.logout_user()
172175

173176
# Set to darkmode each single Control
174177
func set_darkmode(darkmode : bool) -> void:

addons/github-integration/scripts/Header.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func _on_add_notifications(amount : int):
5050
func set_notifications():
5151
notifications_lbl.set_text(str(notifications))
5252
notifications_btn.set_tooltip("You have "+str(notifications)+" unread notifications")
53-
notifications_lbl.show()
53+
notifications_lbl.show() if notifications > 0 else hide_notifications()
5454

5555
func hide_notifications():
5656
notifications_lbl.hide()

addons/github-integration/scripts/Notifications.gd

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ func _connect_signals() -> void:
3636
debug_messages_chk.connect("toggled", self, "_on_debug_toggled")
3737
auto_login_chk.connect("toggled", self, "_on_autologin_toggled")
3838
darkmode_chck.connect("toggled", self, "_on_darkmode_toggled")
39+
$NotificationsContainer/NotificationsTabs/Tabs/Settings/Plugin/ResetPluginBtn.connect("pressed", self, "_on_reset_plugin_pressed")
40+
$ResetPluginDialog.connect("confirmed", self, "_on_reset_confirmed")
3941

4042
func load_settings():
4143
var auto_update_notifications : bool = PluginSettings.auto_update_notifications
@@ -54,12 +56,21 @@ func _on_notification_request_failed(requesting : int, error_body : Dictionary):
5456
RestHandler.REQUESTS.INVITATIONS_LIST:
5557
get_parent().print_debug_message("ERROR: "+error_body.message, 1)
5658

59+
func hide_notification_tab(tab : TreeItem) -> TreeItem:
60+
if tab.get_text(0) != "Settings": tab.hide()
61+
return tab.get_next()
62+
5763
func load_notification_tabs() -> void:
5864
var root : TreeItem = notification_tree.create_item()
5965
for tab in notifications_tabs:
6066
var invitations_item : TreeItem = notification_tree.create_item(root)
6167
invitations_item.set_text(0, tab)
6268

69+
func hide_notification_tabs():
70+
var next_item : TreeItem = hide_notification_tab(notification_tree.get_root().get_children())
71+
while next_item!=null:
72+
next_item = hide_notification_tab(next_item)
73+
6374
func set_darkmode(darkmode : bool) -> void:
6475
if darkmode:
6576
$BG.color = "#24292e"
@@ -81,6 +92,8 @@ func _on_timeout():
8192
request_notifications()
8293

8394
func request_notifications() -> void:
95+
if not PluginSettings.auto_update_notifications:
96+
return
8497
get_parent().print_debug_message("loading notifications, please wait...")
8598
emit_signal("add_notifications",-get_parent().Header.notifications)
8699
RestHandler.request_invitations_list()
@@ -155,4 +168,16 @@ func _on_invitation_declined():
155168
invitations-=1
156169
set_invitations_amount(invitations)
157170

171+
func _on_reset_plugin_pressed():
172+
$ResetPluginDialog.popup()
173+
174+
func _clear():
175+
emit_signal("add_notifications",-get_parent().Header.notifications)
176+
clear_invitations_list()
158177

178+
func _on_reset_confirmed():
179+
_clear()
180+
hide()
181+
get_parent().logout()
182+
get_parent().SignIn.delete_user()
183+
PluginSettings.reset_plugin()

0 commit comments

Comments
 (0)