mirror of
https://port.numenaute.org/aleajactaest/khanat-client.git
synced 2024-12-22 09:28:44 +00:00
19 lines
569 B
GDScript3
19 lines
569 B
GDScript3
|
extends Node
|
||
|
class_name Inventory
|
||
|
|
||
|
var items = []
|
||
|
|
||
|
func from_dict( datas ):
|
||
|
|
||
|
for item in datas:
|
||
|
var extension = item.get_extension()
|
||
|
|
||
|
if extension == "equippable":
|
||
|
var new_item = Equippable.new()
|
||
|
var file = File.new()
|
||
|
if file.open( "res://ressources/files/items/equippables/" + item, File.READ) == OK:
|
||
|
var json = JSON.parse( file.get_as_text() )
|
||
|
if json.result:
|
||
|
new_item.from_dict( json.result )
|
||
|
self.items.push_back( new_item )
|