mirror of
https://github.com/D4M13N-D3V/godot_grid_inventory.git
synced 2025-03-14 08:14:55 +00:00
only load .tres files
This commit is contained in:
parent
ee9b72155c
commit
1d7befe46c
@ -6,7 +6,8 @@ var ITEMS = {}
|
||||
func _ready():
|
||||
# Load items from the "items" directory and populate the ITEMS dictionary
|
||||
for i in DirAccess.get_files_at("res://grid_inventory_system/items"):
|
||||
var item = load("res://grid_inventory_system/items/" + i)
|
||||
if(i.ends_with(".tres")):
|
||||
var item = load("res://grid_inventory_system/items/" + i)
|
||||
ITEMS[item.item_id] = item
|
||||
|
||||
# Function to retrieve an item based on its item_id
|
||||
|
Loading…
x
Reference in New Issue
Block a user