Skip to content

Commit cc67a04

Browse files
authored
Merge pull request #86 from fenix-hub/dev
update v1.4.1
2 parents e2e4406 + e919a91 commit cc67a04

File tree

10 files changed

+1228
-1221
lines changed

10 files changed

+1228
-1221
lines changed

README.md

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

1414
Author: *"Nicolo (fenix) Santilio"*
15-
Version: *1.4.0*
16-
Wiki: *[supported](https://github.com/fenix-hub/godot-engine.github-integration/wiki)*
15+
Version: *1.4.1*
1716
Godot Version: *3.2.3stable*
17+
Wiki: *[supported](https://github.com/fenix-hub/godot-engine.github-integration/wiki)*
1818

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

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.4.0"
6+
version="1.4.1"
77
script="scripts/github-integration.gd"

addons/github-integration/scenes/Commit.tscn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ margin_bottom = 238.0
332332
window_title = "Open File(s)"
333333
resizable = true
334334
mode = 1
335-
show_hidden_files = true
336335
__meta__ = {
337336
"_edit_use_anchors_": false
338337
}

addons/github-integration/scenes/Repo.tscn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@ __meta__ = {
969969
}
970970
[connection signal="item_selected" from="Repository/RepositoryInfo/RepositoryContent/BranchInfo/branch/branch2" to="." method="_on_branch2_item_selected"]
971971
[connection signal="item_activated" from="Repository/RepositoryInfo/RepositoryContent/contents" to="." method="_on_contents_item_activated"]
972+
[connection signal="item_selected" from="Repository/RepositoryInfo/RepositoryContent/contents" to="." method="_on_contents_item_selected"]
972973
[connection signal="multi_selected" from="Repository/RepositoryInfo/RepositoryContent/contents" to="." method="_on_contents_multi_selected"]
973974
[connection signal="pressed" from="Repository/repos_buttons/HBoxContainer/reload" to="." method="_on_reload_pressed"]
974975
[connection signal="pressed" from="extraction_request/VBoxContainer/buttons/python" to="." method="_on_python_pressed"]

addons/github-integration/scripts/Commit.gd

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

addons/github-integration/scripts/GitHub.gd

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -30,169 +30,169 @@ var user_avatar : ImageTexture = ImageTexture.new()
3030
var user_img = Image.new()
3131

3232
var connection_status : Array = [
33-
IconLoaderGithub.load_icon_from_name("searchconnection"),
34-
IconLoaderGithub.load_icon_from_name("noconnection"),
35-
IconLoaderGithub.load_icon_from_name("connection")
33+
IconLoaderGithub.load_icon_from_name("searchconnection"),
34+
IconLoaderGithub.load_icon_from_name("noconnection"),
35+
IconLoaderGithub.load_icon_from_name("connection")
3636
]
3737

3838
var plugin_version : String
3939
var plugin_name : String
4040

4141
# Load the configuration file for this plugin to fetch some info
4242
func load_config() -> void:
43-
var config = ConfigFile.new()
44-
var err = config.load("res://addons/github-integration/plugin.cfg")
45-
if err == OK:
46-
plugin_version = config.get_value("plugin","version")
47-
plugin_name = "[%s] >> " % config.get_value("plugin","name")
43+
var config = ConfigFile.new()
44+
var err = config.load("res://addons/github-integration/plugin.cfg")
45+
if err == OK:
46+
plugin_version = config.get_value("plugin","version")
47+
plugin_name = "[%s] >> " % config.get_value("plugin","name")
4848

4949
func connect_signals() -> void:
50-
Menu.connect("index_pressed", self, "menu_item_pressed")
51-
RestartConnection.connect("pressed",self,"check_connection")
52-
VersionCheck.connect("request_completed",self,"_on_version_check")
53-
SignIn.connect("signed",self,"signed")
54-
UserPanel.connect("completed_loading", SignIn, "_on_completed_loading")
55-
UserPanel.connect("loaded_gists", Gist, "_on_loaded_repositories")
56-
Header.connect("load_invitations", Notifications, "_on_load_invitations_list")
57-
Header.notifications_btn.connect("pressed", Notifications, "_open_notifications")
58-
Notifications.connect("add_notifications", Header, "_on_add_notifications")
50+
Menu.connect("index_pressed", self, "menu_item_pressed")
51+
RestartConnection.connect("pressed",self,"check_connection")
52+
VersionCheck.connect("request_completed",self,"_on_version_check")
53+
SignIn.connect("signed",self,"signed")
54+
UserPanel.connect("completed_loading", SignIn, "_on_completed_loading")
55+
UserPanel.connect("loaded_gists", Gist, "_on_loaded_repositories")
56+
Header.connect("load_invitations", Notifications, "_on_load_invitations_list")
57+
Header.notifications_btn.connect("pressed", Notifications, "_open_notifications")
58+
Notifications.connect("add_notifications", Header, "_on_add_notifications")
5959

6060
func hide_nodes() -> void:
61-
Repo.hide()
62-
SignIn.show()
63-
UserPanel.hide()
64-
Commit.hide()
65-
LoadNode.hide()
61+
Repo.hide()
62+
SignIn.show()
63+
UserPanel.hide()
64+
Commit.hide()
65+
LoadNode.hide()
6666

6767
func _ready():
68-
connect_signals()
69-
hide_nodes()
70-
# Load Config file
71-
load_config()
72-
Version.text = "v "+plugin_version
73-
74-
ConnectionIcon.set_texture(connection_status[0])
75-
ConnectionIcon.use_parent_material = false
76-
ConnectionIcon.material.set("shader_param/speed", 3)
77-
78-
# Check the connection with the API
79-
RestHandler.check_connection()
80-
# Yield until the "_check_connection" function returns a value
81-
var connection = yield(RestHandler, "_check_connection")
82-
match connection:
83-
true:
84-
ConnectionIcon.set_texture(connection_status[2])
85-
ConnectionIcon.set_tooltip("Connected to GitHub API")
86-
RestartConnection.hide()
87-
false:
88-
ConnectionIcon.set_texture(connection_status[1])
89-
ConnectionIcon.set_tooltip("Can't connect to GitHub API, check your internet connection or API status")
90-
RestartConnection.show()
91-
ConnectionIcon.use_parent_material = true
92-
ConnectionIcon.material.set("shader_param/speed", 0)
93-
94-
Menu.set_item_checked(0, PluginSettings.debug)
95-
Menu.set_item_checked(1, PluginSettings.auto_log)
96-
# Check the plugin verison
97-
VersionCheck.request("https://api.github.com/repos/fenix-hub/godot-engine.github-integration/tags",[],false,HTTPClient.METHOD_GET,"")
98-
99-
if PluginSettings.auto_log:
100-
SignIn.sign_in()
101-
102-
set_darkmode(PluginSettings.darkmode)
68+
connect_signals()
69+
hide_nodes()
70+
# Load Config file
71+
load_config()
72+
Version.text = "v "+plugin_version
73+
74+
ConnectionIcon.set_texture(connection_status[0])
75+
ConnectionIcon.use_parent_material = false
76+
ConnectionIcon.material.set("shader_param/speed", 3)
77+
78+
# Check the connection with the API
79+
RestHandler.check_connection()
80+
# Yield until the "_check_connection" function returns a value
81+
var connection = yield(RestHandler, "_check_connection")
82+
match connection:
83+
true:
84+
ConnectionIcon.set_texture(connection_status[2])
85+
ConnectionIcon.set_tooltip("Connected to GitHub API")
86+
RestartConnection.hide()
87+
false:
88+
ConnectionIcon.set_texture(connection_status[1])
89+
ConnectionIcon.set_tooltip("Can't connect to GitHub API, check your internet connection or API status")
90+
RestartConnection.show()
91+
ConnectionIcon.use_parent_material = true
92+
ConnectionIcon.material.set("shader_param/speed", 0)
93+
94+
Menu.set_item_checked(0, PluginSettings.debug)
95+
Menu.set_item_checked(1, PluginSettings.auto_log)
96+
# Check the plugin verison
97+
VersionCheck.request("https://api.github.com/repos/fenix-hub/godot-engine.github-integration/tags",[],false,HTTPClient.METHOD_GET,"")
98+
99+
if PluginSettings.auto_log:
100+
SignIn.sign_in()
101+
102+
set_darkmode(PluginSettings.darkmode)
103103

104104
# Show or hide the loading screen
105105
func loading(value : bool) -> void:
106-
LoadNode.visible = value
106+
LoadNode.visible = value
107107

108108
# Show the loading process, giving the current value and a maximum value
109109
func show_loading_progress(value : float, max_value : float) -> void:
110-
LoadNode.show_progress(value,max_value)
110+
LoadNode.show_progress(value,max_value)
111111

112112
func hide_loading_progress():
113-
LoadNode.hide_progress()
113+
LoadNode.hide_progress()
114114

115115
func show_number(value : float, type : String) -> void:
116-
LoadNode.show_number(value,type)
116+
LoadNode.show_number(value,type)
117117

118118
func hide_number() -> void:
119-
LoadNode.hide_number()
119+
LoadNode.hide_number()
120120

121121
# If User Signed
122122
func signed() -> void:
123-
UserPanel.load_panel()
124-
set_avatar(UserData.AVATAR)
125-
set_username(UserData.USER.login)
126-
yield(UserPanel, "completed_loading")
127-
Notifications.request_notifications()
123+
UserPanel.load_panel()
124+
set_avatar(UserData.AVATAR)
125+
set_username(UserData.USER.login)
126+
yield(UserPanel, "completed_loading")
127+
Notifications.request_notifications()
128128

129129
# Print a debug message if the debug setting is set to "true", with a debug type from 0 to 2
130130
func print_debug_message(message : String = "", type : int = 0) -> void:
131-
if PluginSettings.debug == true:
132-
match type:
133-
0:
134-
print(plugin_name,message)
135-
1:
136-
printerr(plugin_name,message)
137-
2:
138-
push_warning(plugin_name+message)
139-
if type != 1: set_loading_message(message)
131+
if PluginSettings.debug == true:
132+
match type:
133+
0:
134+
print(plugin_name,message)
135+
1:
136+
printerr(plugin_name,message)
137+
2:
138+
push_warning(plugin_name+message)
139+
if type != 1: set_loading_message(message)
140140

141141
func set_loading_message(message : String):
142-
LoadNode.message.set_text(message)
142+
LoadNode.message.set_text(message)
143143

144144
# Control logic for each item in the plugin menu
145145
func menu_item_pressed(id : int) -> void:
146-
match id:
146+
match id:
147147
# 0:
148148
# _on_debug_toggled(!Menu.is_item_checked(id))
149149
# 1:
150150
# _on_autologin_toggled(!Menu.is_item_checked(id))
151-
0:
152-
OS.shell_open("https://github.com/fenix-hub/godot-engine.github-integration/wiki")
153-
1:
154-
logout()
155-
2:
156-
set_darkmode(!Menu.is_item_checked(id))
151+
0:
152+
OS.shell_open("https://github.com/fenix-hub/godot-engine.github-integration/wiki")
153+
1:
154+
logout()
155+
2:
156+
set_darkmode(!Menu.is_item_checked(id))
157157

158158
# Logout function
159159
func logout():
160-
set_avatar(IconLoaderGithub.load_icon_from_name("circle"))
161-
set_username("user")
162-
SignIn.show()
163-
UserPanel._clear()
164-
UserPanel.hide()
165-
Repo.hide()
166-
Commit.hide()
167-
Gist.hide()
168-
Notifications._clear()
169-
Notifications.hide()
170-
SignIn.Mail.text = ""
171-
SignIn.Token.text = ""
172-
UserData.logout_user()
160+
set_avatar(IconLoaderGithub.load_icon_from_name("circle"))
161+
set_username("user")
162+
SignIn.show()
163+
UserPanel._clear()
164+
UserPanel.hide()
165+
Repo.hide()
166+
Commit.hide()
167+
Gist.hide()
168+
Notifications._clear()
169+
Notifications.hide()
170+
SignIn.Mail.text = ""
171+
SignIn.Token.text = ""
172+
UserData.logout_user()
173173

174174
# Set to darkmode each single Control
175175
func set_darkmode(darkmode : bool) -> void:
176-
PluginSettings.set_darkmode(darkmode)
177-
SignIn.set_darkmode(darkmode)
178-
UserPanel.set_darkmode(darkmode)
179-
Repo.set_darkmode(darkmode)
180-
Commit.set_darkmode(darkmode)
181-
Gist.set_darkmode(darkmode)
182-
Header.set_darkmode(darkmode)
183-
Notifications.set_darkmode(darkmode)
176+
PluginSettings.set_darkmode(darkmode)
177+
SignIn.set_darkmode(darkmode)
178+
UserPanel.set_darkmode(darkmode)
179+
Repo.set_darkmode(darkmode)
180+
Commit.set_darkmode(darkmode)
181+
Gist.set_darkmode(darkmode)
182+
Header.set_darkmode(darkmode)
183+
Notifications.set_darkmode(darkmode)
184184

185185
func set_avatar(avatar : ImageTexture) -> void:
186-
$Header/datas/avatar.texture = avatar
186+
$Header/datas/avatar.texture = avatar
187187

188188
func set_username(username : String) -> void:
189-
$Header/datas/user.text = username
189+
$Header/datas/user.text = username
190190

191191
# If the plugin version has been checked
192192
func _on_version_check(result, response_code, headers, body ) -> void:
193-
if result == 0:
194-
if response_code == 200:
195-
var tags : Array = JSON.parse(body.get_string_from_utf8()).result
196-
var first_tag : Dictionary = tags[0] as Dictionary
197-
if first_tag.name != ("v"+plugin_version):
198-
print_debug_message("a new plugin version has been found, current version is %s and new version is %s" % [("v"+plugin_version), first_tag.name],1)
193+
if result == 0:
194+
if response_code == 200:
195+
var tags : Array = JSON.parse(body.get_string_from_utf8()).result
196+
var first_tag : Dictionary = tags[0] as Dictionary
197+
if first_tag.name != ("v"+plugin_version):
198+
print_debug_message("a new plugin version has been found, current version is %s and new version is %s" % [("v"+plugin_version), first_tag.name],1)

0 commit comments

Comments
 (0)