Add addons

This commit is contained in:
Joey Yakimowich-Payne 2023-01-03 16:53:53 -07:00
commit 3367bad24f
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
527 changed files with 36197 additions and 0 deletions

View file

@ -0,0 +1,61 @@
@tool
class_name DialogicSaveEvent
extends DialogicEvent
## Event that allows saving to a specific slot.
### Settings
## The name of the slot to save to. Learn more in the saving subsystem.
## If empty, the event will attempt to save to the latest slot, and otherwise use the default.
var slot_name: String = ""
################################################################################
## INITIALIZE
################################################################################
func _execute() -> void:
if slot_name.is_empty():
if Dialogic.Save.get_latest_slot():
dialogic.Save.save(Dialogic.Save.get_latest_slot())
else:
dialogic.Save.save()
else:
dialogic.Save.save(slot_name)
finish()
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "Save"
set_default_color('Color2')
event_category = Category.Main
event_sorting_index = 2
################################################################################
## SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "save"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"slot" : {"property": "slot_name", "default": "Default"},
}
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor():
add_header_edit('slot_name', ValueType.SinglelineText, 'to slot')