1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

fix some things in ExtensionExplorer (#1047)

* fix some things

* treat any string as a comment (unless it starts with a link)
This commit is contained in:
Variable 2024-07-27 19:52:37 +05:00 committed by GitHub
parent 94abe80295
commit 7c2d237792
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 15 deletions

View file

@ -29,6 +29,8 @@ func set_info(info: Dictionary, extension_path: String) -> void:
if "name" in info.keys() and "version" in info.keys():
ext_name.text = str(info["name"], "-v", info["version"])
# check for updates
if typeof(info["version"]) == TYPE_STRING:
info["version"] = str_to_var(info["version"])
change_button_if_updatable(info["name"], info["version"])
# Setting a path extension will be "temporarily" downloaded to before install
var temp_dir = extension_path.path_join("Download")

View file

@ -105,6 +105,7 @@ offset_bottom = -49.0
horizontal_alignment = 1
[node name="EnlardedThumbnail" type="Window" parent="."]
title = "Image"
position = Vector2i(0, 36)
size = Vector2i(440, 360)
visible = false
@ -118,6 +119,7 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
expand_mode = 1
stretch_mode = 5
[connection signal="timeout" from="MarginContainer/HBoxContainer/VBoxContainer/Done/DoneDelay" to="." method="_on_DoneDelay_timeout"]

View file

@ -165,22 +165,21 @@ func process_line(line: String) -> void:
# If the line isn't a comment, we will check data type
var raw_data
line = line.strip_edges()
if !line.begins_with("#") and !line.begins_with("//") and line != "":
# attempting to convert to a variable other than a string
raw_data = str_to_var(line)
if !raw_data: # attempt failed, using it as string
raw_data = line
# attempting to convert to a variable other than a string
raw_data = str_to_var(line)
if !raw_data: # attempt failed, using it as string
raw_data = line
# Determine action based on data type
match typeof(raw_data):
TYPE_ARRAY:
var extension_data: Dictionary = parse_extension_data(raw_data)
add_entry(extension_data)
TYPE_STRING:
# it's most probably a store link
var link: String = raw_data.strip_edges()
if !link in redirects:
redirects.append(link)
# Determine action based on data type
match typeof(raw_data):
TYPE_ARRAY:
var extension_data: Dictionary = parse_extension_data(raw_data)
add_entry(extension_data)
TYPE_STRING:
# it's most probably a store link
var link: String = raw_data.strip_edges()
if !link in redirects and link.begins_with("http") and "://" in link:
redirects.append(link)
func parse_extension_data(raw_data: Array) -> Dictionary: