mirror of
https://github.com/Relintai/ess_data.git
synced 2024-11-11 20:45:00 +01:00
Now if an ess_data.json exists in the project's root, the addon will load it as the folders array.
This commit is contained in:
parent
7506c76b7d
commit
eac85fb441
@ -247,6 +247,26 @@ var _folders : Array = [
|
||||
]
|
||||
|
||||
func _ready():
|
||||
var dir : Directory = Directory.new()
|
||||
|
||||
|
||||
if dir.file_exists("res://ess_data.json"):
|
||||
var file : File = File.new()
|
||||
|
||||
if file.open("res://ess_data.json", File.READ) == OK:
|
||||
var s : String = file.get_as_text()
|
||||
|
||||
_folders = parse_json(s)
|
||||
|
||||
file.close()
|
||||
# else:
|
||||
# var file : File = File.new()
|
||||
#
|
||||
# if file.open("res://ess_data.json", File.WRITE) == OK:
|
||||
# file.store_string(to_json(_folders))
|
||||
#
|
||||
# file.close()
|
||||
|
||||
_main_container = get_node(main_container)
|
||||
|
||||
_resource_scene = resource_scene.instance()
|
||||
|
Loading…
Reference in New Issue
Block a user