diff options
author | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-17 13:50:22 +0100 |
---|---|---|
committer | jacopograndi <jacopo.grandi@outlook.it> | 2022-01-17 13:50:22 +0100 |
commit | f73ef06b502aa36dca73a173bbee089ae91729ab (patch) | |
tree | adf5409a717962c99a8f77aa816a2e5e6956fc2f /scripts/load_turrets.gd | |
parent | 53342a1bdae615aead21163ed0636b68be5ea55f (diff) |
thumbnails
Diffstat (limited to 'scripts/load_turrets.gd')
-rw-r--r-- | scripts/load_turrets.gd | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/load_turrets.gd b/scripts/load_turrets.gd index 194525c..93e7841 100644 --- a/scripts/load_turrets.gd +++ b/scripts/load_turrets.gd @@ -4,7 +4,7 @@ var saveload : Node var info : Dictionary var models : Dictionary -var thumbs : Dictionary +var thumbnails : Dictionary var loaded : bool = false signal done_loading @@ -13,6 +13,7 @@ func _ready(): get_saveload() load_models() load_info() + load_thumbnails() emit_signal("done_loading") loaded = true @@ -21,7 +22,6 @@ func get_saveload(): func get_upg_turrets(turret_name): var results = [] - return results # otherwise everything breaks for turr in info[turret_name].get("upgrades", []): results += [info[turr]] return results @@ -51,3 +51,10 @@ func load_models(): var files = saveload.parse_dir("res://assets/models/turrets", ".glb") for turr in files: models[turr] = load("res://assets/models/turrets/" + turr) + +func load_thumbnails(): + thumbnails.clear() + var files = saveload.parse_dir("res://assets/textures/thumbnails/turrets", ".png") + for turr in files: + print(turr) + thumbnails[turr] = load("res://assets/textures/thumbnails/turrets/" + turr) |