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_quest_activate.gd

56 lines
1.4 KiB

@tool
extends DialogicEvent
class_name DialogicQuestActivateEvent
# Define properties of the event here
var quest_resource: String
func _execute() -> void:
var resource = ResourceLoader.load(quest_resource)
QuestManager.ChangeQuestStatus(resource,QuestEventUtils.QuestStatus.AVAILABLE)
QuestManager.SetActiveQuest(resource)
finish() # called to continue with the next event
#region INITIALIZE
################################################################################
# Set fixed settings of this event
func _init() -> void:
event_name = "Activate Quest"
event_category = "Quest"
#endregion
#region SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "quest_activate"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"quest_resource" : {"property": "quest_resource", "default": ""},
}
# You can alternatively overwrite these 3 functions: to_text(), from_text(), is_valid_event()
#endregion
#region EDITOR REPRESENTATION
################################################################################
func build_event_editor() -> void:
add_header_label("Activate Quest")
add_header_edit(
"quest_resource",
ValueType.DYNAMIC_OPTIONS,
{
"mode":2,
"suggestions_func":QuestEventUtils.quest_resource_suggestrions
})
#endregion