Dialogic quest addition and plugin fix
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
@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.ACTIVE)
|
||||
QuestManager.SetFollowQuest(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
|
||||
Reference in New Issue
Block a user