2 class_name DialogicSaveEvent
5 ## Event that allows saving to a specific slot.
10 ## The name of the slot to save to. Learn more in the saving subsystem.
11 ## If empty, the event will attempt to save to the latest slot, and otherwise use the default.
15 ################################################################################
17 ################################################################################
19 func _execute() -> void:
20 if slot_name.is_empty():
21 if dialogic.Save.get_latest_slot():
22 dialogic.Save.save(dialogic.Save.get_latest_slot())
26 dialogic.Save.save(slot_name)
30 ################################################################################
32 ################################################################################
36 set_default_color('Color6')
37 event_category = "Other"
38 event_sorting_index = 0
41 func _get_icon() -> Resource:
42 return load(self.get_script().get_path().get_base_dir().path_join('icon.svg'))
45 ################################################################################
47 ################################################################################
49 func get_shortcode() -> String:
53 func get_shortcode_parameters() -> Dictionary:
55 #param_name : property_info
56 "slot" : {"property": "slot_name", "default": "Default"},
60 ################################################################################
61 ## EDITOR REPRESENTATION
62 ################################################################################
64 func build_event_editor() -> void:
65 add_header_edit('slot_name', ValueType.SINGLELINE_TEXT, {'left_text':'Save to slot'})