aboutsummaryrefslogtreecommitdiff
path: root/scripts/load_turrets.gd
diff options
context:
space:
mode:
authorjacopograndi <jacopo.grandi@outlook.it>2022-01-26 17:30:05 +0100
committerjacopograndi <jacopo.grandi@outlook.it>2022-01-26 17:30:05 +0100
commit2d51499751b0ea8a2ae0110bb1b3e90856f415ee (patch)
treeef6b42979e29100d826640924d1110ce5e4b2cec /scripts/load_turrets.gd
parent09357d4cd370949371cca206d4c4d9a65b442f60 (diff)
modules
Diffstat (limited to 'scripts/load_turrets.gd')
-rw-r--r--scripts/load_turrets.gd12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/load_turrets.gd b/scripts/load_turrets.gd
index e79a68c..10c6e44 100644
--- a/scripts/load_turrets.gd
+++ b/scripts/load_turrets.gd
@@ -4,6 +4,7 @@ var saveload : Node
var info : Dictionary
var models : Dictionary
+var modules : Dictionary
var thumbnails : Dictionary
var loaded : bool = false
@@ -13,6 +14,7 @@ func _ready():
get_saveload()
load_models()
load_info()
+ load_modules()
load_thumbnails()
emit_signal("done_loading")
loaded = true
@@ -58,3 +60,13 @@ func load_thumbnails():
var files = saveload.parse_dir("res://assets/textures/thumbnails/turrets", ".png")
for turr in files:
thumbnails[turr] = load("res://assets/textures/thumbnails/turrets/" + turr)
+
+func load_modules():
+ modules.clear()
+ var files = saveload.parse_dir("res://assets/json", ".json")
+ for f in files:
+ if f != "modules.json": continue
+ var parsed = saveload.load_parse_json("res://assets/json/" + f)
+ if parsed != null:
+ for tin in parsed:
+ modules[tin.name] = tin