First work on dialogic, resized guild, and started implementing portraits.
This commit is contained in:
83
addons/dialogic/Modules/Signal/event_signal.gd
Normal file
83
addons/dialogic/Modules/Signal/event_signal.gd
Normal file
@@ -0,0 +1,83 @@
|
||||
@tool
|
||||
class_name DialogicSignalEvent
|
||||
extends DialogicEvent
|
||||
|
||||
## Event that emits the Dialogic.signal_event signal with an argument.
|
||||
## You can connect to this signal like this: `Dialogic.signal_event.connect(myfunc)`
|
||||
|
||||
|
||||
### Settings
|
||||
|
||||
enum ArgumentTypes {STRING, DICTIONARY}
|
||||
var argument_type := ArgumentTypes.STRING
|
||||
|
||||
## The argument that will be provided with the signal.
|
||||
var argument: Variant = ""
|
||||
|
||||
################################################################################
|
||||
## EXECUTE
|
||||
################################################################################
|
||||
|
||||
func _execute() -> void:
|
||||
if argument_type == ArgumentTypes.DICTIONARY:
|
||||
var result: Variant = JSON.parse_string(argument)
|
||||
if result != null:
|
||||
var dict := result as Dictionary
|
||||
dict.make_read_only()
|
||||
dialogic.emit_signal('signal_event', dict)
|
||||
else:
|
||||
push_error("[Dialogic] Encountered invalid dictionary in signal event.")
|
||||
else:
|
||||
dialogic.emit_signal('signal_event', argument)
|
||||
finish()
|
||||
|
||||
|
||||
################################################################################
|
||||
## INITIALIZE
|
||||
################################################################################
|
||||
|
||||
func _init() -> void:
|
||||
event_name = "Signal"
|
||||
set_default_color('Color6')
|
||||
event_category = "Logic"
|
||||
event_sorting_index = 8
|
||||
help_page_path = "https://docs.dialogic.pro/dialogic-signals.html#1-signal-event"
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
## SAVING/LOADING
|
||||
################################################################################
|
||||
|
||||
func get_shortcode() -> String:
|
||||
return "signal"
|
||||
|
||||
|
||||
func get_shortcode_parameters() -> Dictionary:
|
||||
return {
|
||||
#param_name : property_info
|
||||
"arg_type" : {"property": "argument_type", "default": ArgumentTypes.STRING,
|
||||
"suggestions": func(): return {"String":{'value':ArgumentTypes.STRING, 'text_alt':['string']}, "Dictionary":{'value':ArgumentTypes.DICTIONARY, 'text_alt':['dict', 'dictionary']}}},
|
||||
"arg" : {"property": "argument", "default": ""}
|
||||
}
|
||||
|
||||
################################################################################
|
||||
## EDITOR REPRESENTATION
|
||||
################################################################################
|
||||
|
||||
func build_event_editor() -> void:
|
||||
add_header_label("Emit dialogic signal with argument")
|
||||
add_header_label("(Dictionary in body)", 'argument_type == ArgumentTypes.DICTIONARY')
|
||||
add_header_edit('argument', ValueType.SINGLELINE_TEXT, {}, 'argument_type == ArgumentTypes.STRING')
|
||||
add_body_edit('argument_type',ValueType.FIXED_OPTIONS, {'left_text':'Argument Type:', 'options': [
|
||||
{
|
||||
'label': 'String',
|
||||
'value': ArgumentTypes.STRING,
|
||||
},
|
||||
{
|
||||
'label': 'Dictionary',
|
||||
'value': ArgumentTypes.DICTIONARY,
|
||||
}
|
||||
]})
|
||||
add_body_line_break('argument_type == ArgumentTypes.DICTIONARY')
|
||||
add_body_edit('argument', ValueType.DICTIONARY, {'left_text': 'Dictionary'},'argument_type == ArgumentTypes.DICTIONARY')
|
||||
1
addons/dialogic/Modules/Signal/event_signal.gd.uid
Normal file
1
addons/dialogic/Modules/Signal/event_signal.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c3vverxq4rt55
|
||||
BIN
addons/dialogic/Modules/Signal/icon.png
Normal file
BIN
addons/dialogic/Modules/Signal/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 B |
40
addons/dialogic/Modules/Signal/icon.png.import
Normal file
40
addons/dialogic/Modules/Signal/icon.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bxorbhnr4o2rj"
|
||||
path="res://.godot/imported/icon.png-5e2e422904d471016252dff8d4bdfa96.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://addons/dialogic/Modules/Signal/icon.png"
|
||||
dest_files=["res://.godot/imported/icon.png-5e2e422904d471016252dff8d4bdfa96.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
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
|
||||
7
addons/dialogic/Modules/Signal/index.gd
Normal file
7
addons/dialogic/Modules/Signal/index.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
@tool
|
||||
extends DialogicIndexer
|
||||
|
||||
|
||||
func _get_events() -> Array:
|
||||
return [this_folder.path_join('event_signal.gd')]
|
||||
|
||||
1
addons/dialogic/Modules/Signal/index.gd.uid
Normal file
1
addons/dialogic/Modules/Signal/index.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cyyjcfgkblbvq
|
||||
Reference in New Issue
Block a user