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.
56 lines
1.4 KiB
56 lines
1.4 KiB
@tool
|
|
extends DialogicEvent
|
|
class_name DialogicQuestCompleteEvent
|
|
|
|
|
|
# Define properties of the event here
|
|
var quest_resource: String
|
|
|
|
func _execute() -> void:
|
|
var resource = ResourceLoader.load(quest_resource)
|
|
QuestManager.ChangeQuestStatus(resource,QuestEventUtils.QuestStatus.DONE)
|
|
QuestManager.SetFollowQuest(null)
|
|
finish() # called to continue with the next event
|
|
|
|
|
|
#region INITIALIZE
|
|
################################################################################
|
|
# Set fixed settings of this event
|
|
func _init() -> void:
|
|
event_name = "Complete Quest"
|
|
event_category = "Quest"
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#region SAVING/LOADING
|
|
################################################################################
|
|
func get_shortcode() -> String:
|
|
return "quest_complete"
|
|
|
|
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("Complete Quest")
|
|
add_header_edit(
|
|
"quest_resource",
|
|
ValueType.DYNAMIC_OPTIONS,
|
|
{
|
|
"mode":2,
|
|
"suggestions_func":QuestEventUtils.quest_resource_suggestrions
|
|
})
|
|
|
|
#endregion
|