Skip to content

Commit

Permalink
Filter out alpha, beta, rc, versions. Small UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
noidexe committed Oct 23, 2021
1 parent 11b4a87 commit 70ee873
Show file tree
Hide file tree
Showing 14 changed files with 3,605 additions and 3,382 deletions.
1 change: 0 additions & 1 deletion icon.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
Binary file added icons/btn_donateCC_LG.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion icons/icons.png.import
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
Expand Down
Binary file added icons/paypal_donate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions icons/paypal_donate.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/paypal_donate.png-853d7fb7c200f33ea5eeb9fb44eab144.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icons/paypal_donate.png"
dest_files=[ "res://.import/paypal_donate.png-853d7fb7c200f33ea5eeb9fb44eab144.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
Binary file added icons/paypal_donate.png~
Binary file not shown.
Binary file added icons/paypal_donate_hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions icons/paypal_donate_hover.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/paypal_donate_hover.png-938df8b2d1a2b0a7bba41ccb3ada807d.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://icons/paypal_donate_hover.png"
dest_files=[ "res://.import/paypal_donate_hover.png-938df8b2d1a2b0a7bba41ccb3ada807d.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
9 changes: 9 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ config_version=4

config/name="Godot Version Manager"
run/main_scene="res://scenes/Main.tscn"
run/low_processor_mode=true
boot_splash/image="res://splash.png"
boot_splash/fullsize=false
boot_splash/bg_color=Color( 1, 1, 1, 1 )
config/icon="res://icon.png"

[display]

window/size/width=900
window/energy_saving/keep_screen_on=false

[physics]

common/enable_pause_aware_picking=true
Expand Down
5 changes: 5 additions & 0 deletions scenes/Donate.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends TextureButton

func _on_Donate_pressed():
OS.shell_open("https://www.paypal.com/donate?hosted_button_id=764A5SEQUZYR8")

6,804 changes: 3,435 additions & 3,369 deletions scenes/Main.tscn

Large diffs are not rendered by default.

65 changes: 54 additions & 11 deletions scenes/VersionSelect.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ extends OptionButton


var download_db : Dictionary
var filtered_db_view : Array
var download_links : Array

var alpha_included = false
var beta_included = false
var rc_included = false

var base_url = "https://downloads.tuxfamily.org/godotengine/"
var searches = 0

Expand All @@ -28,6 +33,7 @@ func _reload():
_update_list()

func _refresh():
download_links = []
download_db = {
"last_updated" : OS.get_unix_time(),
"versions" : []
Expand All @@ -36,6 +42,15 @@ func _refresh():
while searches > 0:
yield(get_tree().create_timer(1.0),"timeout")


download_links.sort()
for link in download_links:
var entry = {
"name" : link.get_file().trim_suffix("_win64.exe.zip"),
"path" : link
}
download_db.versions.append(entry)

var file = File.new()
file.open("user://download_db.json", File.WRITE)
file.store_line(to_json(download_db))
Expand All @@ -49,16 +64,13 @@ func _parsexml(buffer : PoolByteArray, partial_path):
while(true):
var err = xml.read()
if err != OK:
print("Error %s reading XML" % err)
if err != ERR_FILE_EOF:
print("Error %s reading XML" % err)
break
if xml.get_node_type() == XMLParser.NODE_ELEMENT and xml.get_node_name() == "a":
var href = xml.get_named_attribute_value_safe("href")
if href.ends_with("win64.exe.zip"):
var entry = {
"name" : href.trim_suffix("_win64.exe.zip"),
"path" : partial_path + href
}
download_db.versions.append(entry)
download_links.append(partial_path + href)
elif (
href.begins_with("alpha")
or href.begins_with("beta")
Expand Down Expand Up @@ -87,6 +99,7 @@ func _find_links(url:String):
var req = HTTPRequest.new()
add_child(req)
req.request(url, [], false)
refresh_button.text = "Scraping%s %s" % [ [".", "..", "..."][randi() % 3] ,url.rsplit("/",true,2)[1] ]
var response = yield(req,"request_completed")
if response[1] == 200:
_parsexml(response[3], url)
Expand All @@ -97,27 +110,39 @@ func _find_links(url:String):

func _update_list():
clear()
filtered_db_view = []
for entry in download_db.versions:
if (
"stable" in entry.name
or (rc_included and "rc" in entry.name)
or (beta_included and "beta" in entry.name)
or (alpha_included and "alpha" in entry.name)
):
filtered_db_view.append(entry)


for entry in filtered_db_view:
add_item(entry.name)


func _on_Refresh_pressed():
disabled = true
_refresh()
while searches > 0:
refresh_button.text = "Downloading (%s remaining)" % searches
refresh_button.text = "Scraping %s urls%s" % [ searches, [".", "..", "..."][randi() % 3] ]
yield(get_tree().create_timer(0.2),"timeout")
refresh_button.text = "Refresh"
disabled = false
_update_list()
pass # Replace with function body.



func _on_Download_pressed():
if selected != -1:
var _selection = filtered_db_view[selected]
download_button.disabled = true
var filename = "user://versions/" + download_db.versions[selected].name + "_win64.exe.zip"
var url = download_db.versions[selected].path
var filename = "user://versions/" + _selection.name + "_win64.exe.zip"
var url = _selection.path
var req = HTTPRequest.new()
add_child(req)
req.download_file = filename
Expand All @@ -134,7 +159,7 @@ func _on_Download_pressed():
print(output)
download_button.disabled = false
download_button.text = "Download"
_add_version(download_db.versions[selected].name,filename.rstrip(".zip"))
_add_version(_selection.name,filename.rstrip(".zip"))
pass # Replace with function body.

func _add_version(v_name : String, path: String):
Expand All @@ -152,3 +177,21 @@ func _add_version(v_name : String, path: String):
file.store_line(to_json(config))
file.close()
emit_signal("version_added")


func _on_Alpha_toggled(button_pressed):
alpha_included = button_pressed
_update_list()
pass # Replace with function body.


func _on_Beta_toggled(button_pressed):
beta_included = button_pressed
_update_list()
pass # Replace with function body.


func _on_RC_toggled(button_pressed):
rc_included = button_pressed
_update_list()
pass # Replace with function body.
Binary file added splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions splash.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/splash.png-929ed8a00b89ba36c51789452f874c77.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://splash.png"
dest_files=[ "res://.import/splash.png-929ed8a00b89ba36c51789452f874c77.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

0 comments on commit 70ee873

Please sign in to comment.