Skip to content

Commit e5748ae

Browse files
authored
Updated VariableStore (#6)
* Update to version 1.0 * Updated to version 1.0
1 parent e2005cc commit e5748ae

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

Code/VariableStore/export_presets.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ custom_features=""
77
export_filter="all_resources"
88
include_filter="*.json"
99
exclude_filter=""
10-
export_path="../../../../Desktop/VariableStore.exe"
10+
export_path=""
1111
script_export_mode=1
1212
script_encryption_key=""
1313

Code/VariableStore/src/Extensions/VariableStore/Store/Store.gd

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ var extension_container :VBoxContainer
66
var extension_path: String = ""
77

88
#### Usage:
9-
### Change the "store_link" and "download_file" variables to your choice
9+
### Change the "store_version", "store_link" and "download_file" variables to your choice
1010
### Don't touch anything else
1111
var download_file: String = "variable_info.txt" #File can be of any name you want
1212
var store_link: String = "https://raw.githubusercontent.com/Variable-ind/Pixelorama-Extensions/master/store_info.txt"
13+
var store_version: float = 0.1
1314

15+
var new_version_available := false
1416
### Principle/Setup:
1517
# 1) Make a file in the repository and store all the extensions inside it in
1618
# the form of
@@ -42,7 +44,11 @@ func _on_StoreButton_pressed() -> void:
4244

4345

4446
func _on_Store_about_to_show() -> void:
45-
#clear old entries
47+
# Display Version
48+
if !window_title.ends_with(str(" (", store_version, ")")):
49+
window_title += str(" (", store_version, ")")
50+
51+
#Clear old entries
4652
for entry in content.get_children():
4753
entry.queue_free()
4854

@@ -65,13 +71,27 @@ func _on_HTTPRequest_request_completed(result: int, _response_code: int, _header
6571
if result == HTTPRequest.RESULT_SUCCESS:
6672
var file = File.new()
6773
var _error = file.open(str(extension_path,download_file), File.READ)
74+
var version :float
6875

69-
var dummy_number = 0 # I don't need the first line of file
76+
var dummy_number = 1
7077
while not file.eof_reached():
7178
var info = str2var(file.get_line())
72-
if dummy_number > 0:
73-
if typeof(info) == TYPE_ARRAY:
74-
add_entry(info)
79+
if typeof(info) == TYPE_REAL:
80+
# check version
81+
version = info
82+
if version > store_version:
83+
new_version_available = true
84+
elif typeof(info) == TYPE_ARRAY:
85+
if dummy_number >= 3:
86+
if new_version_available:
87+
if dummy_number == 3:
88+
var label := Label.new()
89+
label.text = str("Version ", version, " is Available")
90+
content.add_child(label)
91+
add_entry(info) # Announce update
92+
else:
93+
if dummy_number > 3: # The first 3 lines of file are Store-related and are excluded
94+
add_entry(info)
7595
dummy_number += 1
7696
file.close()
7797
var dir := Directory.new()

Extensions/VariableStore.pck

64 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)