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.
Babushka/addons/dialogic_additions/Quest/event_utils.gd

44 lines
981 B

@tool
class_name QuestEventUtils
enum QuestStatus{
HIDDEN = 0,
AVAILABLE = 1,
DONE = 2,
CANCLED = 3
}
enum QuestStatusOrActive{
HIDDEN = 0,
AVAILABLE = 1,
DONE = 2,
CANCLED = 3,
ACTIVE = 4,
NOT_ACTIVE = 5
}
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