Skip to content

Commit ca26bfb

Browse files
authored
Merge pull request #39 from fenix-hub/v0.8.4
minor updates
2 parents c041a1b + a90f463 commit ca26bfb

File tree

10 files changed

+311
-96
lines changed

10 files changed

+311
-96
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/github-logo.png-47e01e9fc59994c0db55903788d0795b.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/github-integration/github-logo.png"
13+
dest_files=[ "res://.import/github-logo.png-47e01e9fc59994c0db55903788d0795b.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
391 Bytes
Binary file not shown.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/github-logo.png-ecbc9f6d20796b46b889486439e860bc.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/github-integration/resources/github-logo.png"
13+
dest_files=[ "res://.import/github-logo.png-ecbc9f6d20796b46b889486439e860bc.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=false
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=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=false
34+
svg/scale=1.0
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/throbber.png-ae03ce9c717cd2fb342f9f5d37de98d0.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/github-integration/resources/loading/throbber.png"
13+
dest_files=[ "res://.import/throbber.png-ae03ce9c717cd2fb342f9f5d37de98d0.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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/proxy.png-eb05e86e1b09889d8d9cb4eff7df2f1b.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/github-integration/resources/proxy.png"
13+
dest_files=[ "res://.import/proxy.png-eb05e86e1b09889d8d9cb4eff7df2f1b.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

addons/github-integration/scenes/GitHub.tscn

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

addons/github-integration/scripts/Commit.gd

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ func request_completed(result, response_code, headers, body ):
143143
get_parent().print_debug_message("got base tree")
144144
emit_signal("base_tree")
145145
REQUESTS.BLOB:
146-
list_file_sha.append(JSON.parse(body.get_string_from_utf8()).result.sha)
147-
get_parent().print_debug_message("blobbed file")
148-
# OS.delay_msec(1000)
149-
emit_signal("file_blobbed")
146+
print(response_code)
147+
if response_code == 201:
148+
list_file_sha.append(JSON.parse(body.get_string_from_utf8()).result.sha)
149+
get_parent().print_debug_message("blobbed file")
150+
# OS.delay_msec(1000)
151+
emit_signal("file_blobbed")
150152
REQUESTS.NEW_TREE:
151153
if response_code == 201:
152154
sha_new_tree = JSON.parse(body.get_string_from_utf8()).result.sha
@@ -301,6 +303,7 @@ func request_blobs():
301303
if list_file_size[files.find(file)] < 104857600:
302304
var content = ""
303305
var sha = "" # is set to update a file
306+
var encoding = ""
304307

305308
## this cases are not really necessary, will be used in future versions
306309

@@ -309,32 +312,36 @@ func request_blobs():
309312
var img_src = File.new()
310313
img_src.open(file,File.READ)
311314
content = Marshalls.raw_to_base64(img_src.get_buffer(img_src.get_len()))
312-
315+
img_src.close()
316+
encoding = "base64"
313317
elif file.get_extension()=="ttf":
314318
## for fonts
315319
var font = File.new()
316320
font.open(file,File.READ)
317321
content = Marshalls.raw_to_base64(font.get_buffer(font.get_len()))
322+
encoding = "base64"
323+
font.close()
318324
else:
319325
## for readable files
320-
var f = File.new()
326+
var f : File = File.new()
321327
f.open(file,File.READ)
322-
content = Marshalls.raw_to_base64(f.get_buffer(f.get_len()))
328+
content = f.get_as_text()
329+
encoding = "utf-8"
330+
f.close()
331+
323332

324-
# for content in branches_contents:
325-
# if content.path == file[0].lstrip(DIRECTORY+START_FROM+"/"):
326-
# sha = content.sha
327333

328334
print(get_parent().plugin_name,"blobbing ~> "+file.get_file())
329335

330336
var bod = {
331337
"content":content,
332-
"encoding":"base64",
338+
"encoding":encoding,
333339
}
334340

335341
new_repo.request("https://api.github.com/repos/"+UserData.USER.login+"/"+repo_selected.name+"/git/blobs",UserData.header,false,HTTPClient.METHOD_POST,JSON.print(bod))
336342
yield(self,"file_blobbed")
337343
else:
344+
get_parent().print_debug_message("pointing large file, please wait...")
338345
var output = []
339346
OS.execute( 'git', [ "lfs", "pointer",'--file',ProjectSettings.globalize_path(file)], true, output )
340347
var oid : String = output[0].split(":",false)[2]

addons/github-integration/scripts/Repo.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ func _on_extension_choosing_confirmed():
504504
get_parent().loading(false)
505505
request.set_download_file("")
506506

507+
# var extracted = ProjectSettings.load_resource_pack(current_repo.name+"-"+current_branch.name+archive_extension)
508+
# print(extracted)
507509
ExtractionRequest.popup()
508510

509511
func setup_git_lfs():

addons/github-integration/scripts/UserPanel.gd

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ onready var Gists = $Panel/List/HBoxContainer3/gists
88
onready var RepoList = $Panel/List/Repos
99
onready var GistList = $Panel/List/Gist
1010
onready var NewRepo = $Panel/List/repos_buttons/repo
11-
11+
onready var ReloadBtn = $ReloadBtn
1212

1313

1414
onready var NewGist = $Panel/List/gist_buttons/gist
@@ -36,6 +36,8 @@ func _ready():
3636
NewGist.connect("pressed",self,"new_gist")
3737
RepoList.connect("item_activated",self,"repo_selected")
3838
GistList.connect("item_activated",self,"gist_selected")
39+
40+
ReloadBtn.connect("pressed",self,"_reload")
3941

4042
func load_panel() -> void:
4143
Avatar.texture = UserData.AVATAR
@@ -48,6 +50,7 @@ func load_panel() -> void:
4850
func load_icons():
4951
$Panel/List/HBoxContainer3/gists_icon.texture = IconLoaderGithub.load_icon_from_name("gists")
5052
$Panel/List/HBoxContainer2/repos_icon.texture = IconLoaderGithub.load_icon_from_name("repos")
53+
ReloadBtn.icon = IconLoaderGithub.load_icon_from_name("reload")
5154

5255
func request_completed(result, response_code, headers, body ):
5356
if result == 0:
@@ -181,3 +184,6 @@ func gist_selected():
181184
func new_gist():
182185
GistDialog.popup()
183186

187+
func _reload():
188+
get_parent().print_debug_message("Reloading, please wait...")
189+
request_repositories(REQUESTS.REPOS)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/placeholder.png-55fb8c8b5ea4590d4708ea0062eb2426.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/github-integration/user/placeholder.png"
13+
dest_files=[ "res://.import/placeholder.png-55fb8c8b5ea4590d4708ea0062eb2426.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

0 commit comments

Comments
 (0)