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,108 @@
@tool
class_name DialogicJumpEvent
extends DialogicEvent
## Event that allows starting another timeline. Also can jump to a label in that or the current timeline.
### Settings
## The timeline to jump to, if null then it's the current one. This setting should be a dialogic timeline resource.
var timeline :DialogicTimeline = null
## If not empty, the event will try to find a Label event with this set as name. Empty by default..
var label_name : String = ""
## If true when the timeline this event jumps to finishes, dialogic will continue this one from here.
var return_after: bool = false
### Helpers
## Path to the timeline. Mainly used by the editor.
var _timeline_file: String = ""
## Helper that indicates if [timeline] has been loaded from [_timeline_file].
var _timeline_loaded: bool = false
################################################################################
## EXECUTION
################################################################################
func _execute() -> void:
if timeline: # TODO: Question, why is this always done, even if return_after is false?
dialogic.push_to_jump_stack()
if timeline and timeline != dialogic.current_timeline:
dialogic.start_timeline(timeline, label_name)
elif _timeline_file != "":
if _timeline_file.contains("res://"):
dialogic.start_timeline(_timeline_file, label_name)
else:
dialogic.start_timeline(Dialogic.find_timeline(_timeline_file), label_name)
dialogic.jump_to_label(label_name)
# TODO: Question what this is supposed to do. Can't see it being used anywhere. Is it for use from outside?
func load_timeline() -> void:
if timeline == null:
if _timeline_file != "":
timeline = Dialogic.preload_timeline(_timeline_file)
_timeline_loaded = true
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "Jump"
set_default_color('Color2')
event_category = Category.Timeline
event_sorting_index = 0
expand_by_default = false
func _get_icon() -> Resource:
return load(self.get_script().get_path().get_base_dir().path_join('icon_jump.png'))
################################################################################
## SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "jump"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"timeline" : {"property": "_timeline_file", "default": null,
"suggestions": get_timeline_suggestions},
"label" : {"property": "label_name", "default": ""},
"return_after" : {"property": "return_after", "default": false,
"suggestions": func(): return {'True':{'value':'true'}, 'False':{'value':'false'}}}
}
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor():
add_header_edit('_timeline_file', ValueType.ComplexPicker, 'to', '', {
'file_extension': '.dtl',
'suggestions_func': get_timeline_suggestions,
'editor_icon': ["TripleBar", "EditorIcons"],
'empty_text': '(this timeline)'
})
add_header_edit("label_name", ValueType.SinglelineText, "at", '', {'placeholder':'the beginning'})
add_body_edit("return_after", ValueType.Bool, "Return to this spot after completed?")
func get_timeline_suggestions(filter:String= "") -> Dictionary:
var suggestions := {}
var resources := DialogicUtil.list_resources_of_type('.dtl')
suggestions['(this timeline)'] = {'value':'', 'editor_icon':['GuiRadioUnchecked', 'EditorIcons']}
for resource in Engine.get_meta('dialogic_timeline_directory').keys():
suggestions[resource] = {'value': resource, 'tooltip':Engine.get_meta('dialogic_timeline_directory')[resource], 'editor_icon': ["TripleBar", "EditorIcons"]}
return suggestions

View file

@ -0,0 +1,59 @@
@tool
class_name DialogicLabelEvent
extends DialogicEvent
## Event that is used as an anchor. You can use the DialogicJumpEvent to jump to this point.
### Settings
## Used to identify the label. Duplicate names in a timeline will mean it always chooses the first.
var name: String = ""
################################################################################
## EXECUTE
################################################################################
func _execute() -> void:
# This event is mainly implemented in the DialogicGameHandlers jump_to_label() method.
finish()
################################################################################
## INITIALIZE
################################################################################
func _init() -> void:
event_name = "Label"
set_default_color('Color2')
event_category = Category.Timeline
event_sorting_index = 1
continue_at_end = true
func _get_icon() -> Resource:
return load(self.get_script().get_path().get_base_dir().path_join('icon_label.png'))
################################################################################
## SAVING/LOADING
################################################################################
func get_shortcode() -> String:
return "label"
func get_shortcode_parameters() -> Dictionary:
return {
#param_name : property_info
"name" : {"property": "name", "default": ""},
}
################################################################################
## EDITOR REPRESENTATION
################################################################################
func build_event_editor():
add_header_edit('name', ValueType.SinglelineText, '')

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cxffd4uch5wt1"
path="res://.godot/imported/icon.png-11806ce6c1ed02d2080de0cde1d6b3b4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/Jump/icon.png"
dest_files=["res://.godot/imported/icon.png-11806ce6c1ed02d2080de0cde1d6b3b4.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ceqkajv8edisg"
path="res://.godot/imported/icon_jump.png-3850b8743d418f59391a8510967616ea.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/Jump/icon_jump.png"
dest_files=["res://.godot/imported/icon_jump.png-3850b8743d418f59391a8510967616ea.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c53yjrxmhmgh"
path="res://.godot/imported/icon_label.png-765bce74c52cd08413dddb059cdb4bc7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/dialogic/Events/Jump/icon_label.png"
dest_files=["res://.godot/imported/icon_label.png-765bce74c52cd08413dddb059cdb4bc7.ctex"]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/bptc_ldr=0
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -0,0 +1,6 @@
@tool
extends DialogicIndexer
func _get_events() -> Array:
return [this_folder.path_join('event_jump.gd'), this_folder.path_join('event_label.gd')]