You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
860 B
34 lines
860 B
class_name QuestEventUtils
|
|
|
|
enum QuestStatus{
|
|
HIDDEN = 0,
|
|
ACTIVE = 1,
|
|
DONE = 2,
|
|
CANCLED = 3
|
|
}
|
|
|
|
|
|
static func quest_resource_suggestrions(search_text:String) -> Dictionary:
|
|
var ret_val = {}
|
|
var quest_paths = get_all_file_paths("res://resources/quests")
|
|
|
|
for path in quest_paths:
|
|
var res = ResourceLoader.load(path)
|
|
ret_val[res.id]= {"value":path, "tooltip":res.title + "\n\n" + res.description}
|
|
|
|
return ret_val
|
|
|
|
static func get_all_file_paths(path: String) -> Array[String]:
|
|
var file_paths: Array[String] = []
|
|
var dir = DirAccess.open(path)
|
|
dir.list_dir_begin()
|
|
var file_name = dir.get_next()
|
|
while file_name != "":
|
|
var file_path = path + "/" + file_name
|
|
if dir.current_is_dir():
|
|
file_paths += get_all_file_paths(file_path)
|
|
else:
|
|
file_paths.append(file_path)
|
|
file_name = dir.get_next()
|
|
return file_paths
|