only load .tres files

This commit is contained in:
Damien Ostler 2024-01-07 17:07:13 -05:00
parent ee9b72155c
commit 1d7befe46c

@ -6,6 +6,7 @@ var ITEMS = {}
func _ready(): func _ready():
# Load items from the "items" directory and populate the ITEMS dictionary # Load items from the "items" directory and populate the ITEMS dictionary
for i in DirAccess.get_files_at("res://grid_inventory_system/items"): for i in DirAccess.get_files_at("res://grid_inventory_system/items"):
if(i.ends_with(".tres")):
var item = load("res://grid_inventory_system/items/" + i) var item = load("res://grid_inventory_system/items/" + i)
ITEMS[item.item_id] = item ITEMS[item.item_id] = item