Initial Android commit
This commit is contained in:
commit
1e2b80c13d
8521 changed files with 231475 additions and 0 deletions
|
@ -0,0 +1,50 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/FilePicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/EventPart_AudioFilePicker.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonHover.tres" type="StyleBox" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonNormal.tres" type="StyleBox" id=4]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id=3]
|
||||
|
||||
[sub_resource type="Image" id=4]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=2]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 4 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="AudioFilePicker" type="HBoxContainer"]
|
||||
margin_right = 181.0
|
||||
margin_bottom = 22.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FilePicker" parent="." instance=ExtResource( 1 )]
|
||||
margin_top = 0.0
|
||||
margin_right = 162.0
|
||||
margin_bottom = 22.0
|
||||
Mode = "Audio"
|
||||
|
||||
[node name="ButtonPreviewPlay" type="Button" parent="."]
|
||||
margin_left = 166.0
|
||||
margin_right = 188.0
|
||||
margin_bottom = 22.0
|
||||
size_flags_vertical = 4
|
||||
custom_styles/hover = ExtResource( 3 )
|
||||
custom_styles/pressed = ExtResource( 3 )
|
||||
custom_styles/focus = SubResource( 3 )
|
||||
custom_styles/normal = ExtResource( 4 )
|
||||
icon = SubResource( 2 )
|
||||
|
||||
[node name="AudioPreview" type="AudioStreamPlayer" parent="."]
|
151
addons/dialogic/Editor/Events/Parts/Audio/AudioPicker.tscn
Normal file
151
addons/dialogic/Editor/Events/Parts/Audio/AudioPicker.tscn
Normal file
|
@ -0,0 +1,151 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/EventPart_AudioPicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SectionPanel.tres" type="StyleBox" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/AudioFilePicker.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=4]
|
||||
|
||||
[node name="AudioPicker" type="PanelContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = -718.0
|
||||
margin_bottom = -580.0
|
||||
theme = ExtResource( 4 )
|
||||
custom_styles/panel = ExtResource( 2 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
event_name = "AudioEvent"
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
margin_left = 6.0
|
||||
margin_top = 5.0
|
||||
margin_right = 300.0
|
||||
margin_bottom = 66.0
|
||||
|
||||
[node name="AudioFilePicker" parent="VBox" instance=ExtResource( 3 )]
|
||||
visible = false
|
||||
margin_right = 294.0
|
||||
|
||||
[node name="adv_settings" type="HBoxContainer" parent="VBox"]
|
||||
margin_right = 294.0
|
||||
margin_bottom = 61.0
|
||||
custom_constants/separation = 8
|
||||
|
||||
[node name="AudioVolume" type="PanelContainer" parent="VBox/adv_settings"]
|
||||
margin_right = 88.0
|
||||
margin_bottom = 61.0
|
||||
custom_styles/panel = ExtResource( 2 )
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="VBox/adv_settings/AudioVolume"]
|
||||
margin_left = 6.0
|
||||
margin_top = 5.0
|
||||
margin_right = 82.0
|
||||
margin_bottom = 57.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/adv_settings/AudioVolume/VBox"]
|
||||
margin_right = 76.0
|
||||
margin_bottom = 14.0
|
||||
text = "Volume:"
|
||||
|
||||
[node name="Volume" type="SpinBox" parent="VBox/adv_settings/AudioVolume/VBox"]
|
||||
margin_top = 18.0
|
||||
margin_right = 76.0
|
||||
margin_bottom = 52.0
|
||||
min_value = -80.0
|
||||
max_value = 24.0
|
||||
step = 0.01
|
||||
suffix = "dB"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="AudioBus" type="PanelContainer" parent="VBox/adv_settings"]
|
||||
margin_left = 96.0
|
||||
margin_right = 181.0
|
||||
margin_bottom = 61.0
|
||||
custom_styles/panel = ExtResource( 2 )
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="VBox/adv_settings/AudioBus"]
|
||||
margin_left = 6.0
|
||||
margin_top = 5.0
|
||||
margin_right = 79.0
|
||||
margin_bottom = 57.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/adv_settings/AudioBus/VBox"]
|
||||
margin_right = 73.0
|
||||
margin_bottom = 14.0
|
||||
text = "AudioBus:"
|
||||
|
||||
[node name="BusSelector" type="OptionButton" parent="VBox/adv_settings/AudioBus/VBox"]
|
||||
margin_top = 18.0
|
||||
margin_right = 73.0
|
||||
margin_bottom = 38.0
|
||||
size_flags_vertical = 5
|
||||
text = "Master"
|
||||
items = [ "Master", null, false, 0, null ]
|
||||
selected = 0
|
||||
|
||||
[node name="AudioRegion" type="PanelContainer" parent="VBox/adv_settings"]
|
||||
visible = false
|
||||
margin_left = 187.0
|
||||
margin_right = 419.0
|
||||
margin_bottom = 51.0
|
||||
custom_styles/panel = ExtResource( 2 )
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="VBox/adv_settings/AudioRegion"]
|
||||
margin_left = 6.0
|
||||
margin_top = 5.0
|
||||
margin_right = 226.0
|
||||
margin_bottom = 47.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/adv_settings/AudioRegion/VBox"]
|
||||
margin_right = 220.0
|
||||
margin_bottom = 14.0
|
||||
text = "Audio-region:"
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="VBox/adv_settings/AudioRegion/VBox"]
|
||||
margin_top = 18.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 42.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="StartAtLabel" type="Label" parent="VBox/adv_settings/AudioRegion/VBox/HBox"]
|
||||
margin_top = 5.0
|
||||
margin_right = 33.0
|
||||
margin_bottom = 19.0
|
||||
text = "Start:"
|
||||
|
||||
[node name="StartAt" type="SpinBox" parent="VBox/adv_settings/AudioRegion/VBox/HBox"]
|
||||
margin_left = 37.0
|
||||
margin_right = 111.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Leave both at 0 to use the whole file."
|
||||
max_value = 9999.0
|
||||
step = 0.1
|
||||
suffix = "sec"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="StopAtLabel" type="Label" parent="VBox/adv_settings/AudioRegion/VBox/HBox"]
|
||||
margin_left = 115.0
|
||||
margin_top = 5.0
|
||||
margin_right = 142.0
|
||||
margin_bottom = 19.0
|
||||
text = "End:"
|
||||
|
||||
[node name="StopAt" type="SpinBox" parent="VBox/adv_settings/AudioRegion/VBox/HBox"]
|
||||
margin_left = 146.0
|
||||
margin_right = 220.0
|
||||
margin_bottom = 24.0
|
||||
hint_tooltip = "Leave both at 0 to use the whole file."
|
||||
max_value = 9999.0
|
||||
step = 0.1
|
||||
suffix = "sec"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/EventPart_AudioPickerComplex.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/AudioPicker.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=3]
|
||||
|
||||
[node name="AudioPickerComplex" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
theme = ExtResource( 3 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
margin_right = 193.0
|
||||
margin_bottom = 108.0
|
||||
|
||||
[node name="Fade" type="HBoxContainer" parent="VBox"]
|
||||
margin_right = 193.0
|
||||
margin_bottom = 34.0
|
||||
|
||||
[node name="FadeLengthLabel" type="Label" parent="VBox/Fade"]
|
||||
margin_top = 10.0
|
||||
margin_right = 87.0
|
||||
margin_bottom = 24.0
|
||||
text = " Fade-length:"
|
||||
|
||||
[node name="FadeLength" type="SpinBox" parent="VBox/Fade"]
|
||||
margin_left = 91.0
|
||||
margin_right = 167.0
|
||||
margin_bottom = 34.0
|
||||
step = 0.01
|
||||
suffix = "s"
|
||||
|
||||
[node name="AudioPicker" parent="VBox" instance=ExtResource( 2 )]
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
margin_top = 38.0
|
||||
margin_right = 193.0
|
||||
margin_bottom = 108.0
|
||||
event_name = "Background Music"
|
|
@ -0,0 +1,59 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var file_picker = $FilePicker
|
||||
onready var preview_button = $ButtonPreviewPlay
|
||||
onready var audio_preview = $AudioPreview
|
||||
|
||||
|
||||
func _ready():
|
||||
file_picker.connect("data_changed", self, "_on_FilePicker_data_changed")
|
||||
preview_button.connect("pressed", self, "_on_PreviewButton_pressed")
|
||||
audio_preview.connect("finished", self, "_on_AudioPreview_finished")
|
||||
preview_button.icon = get_icon("Play", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
file_picker.load_data(event_data)
|
||||
preview_button.visible = not event_data["file"].empty()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func _on_FilePicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
preview_button.visible = not event_data["file"].empty()
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PreviewButton_pressed():
|
||||
if audio_preview.is_playing():
|
||||
audio_preview.stop()
|
||||
else :
|
||||
audio_preview.stream = load(event_data["file"])
|
||||
audio_preview.bus = event_data["audio_bus"]
|
||||
audio_preview.volume_db = event_data.get("volume", 0)
|
||||
if event_data.has("start_time"):
|
||||
audio_preview.play(event_data["start_time"])
|
||||
else :
|
||||
audio_preview.play()
|
||||
preview_button.icon = get_icon("Stop", "EditorIcons")
|
||||
|
||||
func _on_AudioPreview_finished():
|
||||
preview_button.icon = get_icon("Play", "EditorIcons")
|
||||
|
||||
|
||||
func _process(_delta):
|
||||
|
||||
if (audio_preview.playing and event_data.has("stop_time") and audio_preview.get_playback_position() >= event_data["stop_time"]):
|
||||
audio_preview.stop()
|
|
@ -0,0 +1,96 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
signal audio_loaded
|
||||
|
||||
export (String) var event_name = "Audio Event"
|
||||
|
||||
|
||||
onready var file_picker: = $VBox / AudioFilePicker
|
||||
|
||||
onready var volume_input: = $VBox / adv_settings / AudioVolume / VBox / Volume
|
||||
onready var region_group: = $VBox / adv_settings / AudioRegion
|
||||
onready var start_at_input: = $VBox / adv_settings / AudioRegion / VBox / HBox / StartAt
|
||||
onready var stop_at_input: = $VBox / adv_settings / AudioRegion / VBox / HBox / StopAt
|
||||
onready var bus_selector: = $VBox / adv_settings / AudioBus / VBox / BusSelector
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
|
||||
file_picker.connect("data_changed", self, "_on_FilePicker_data_changed")
|
||||
bus_selector.connect("item_selected", self, "_on_BusSelector_item_selected")
|
||||
volume_input.connect("value_changed", self, "_on_Volume_value_changed")
|
||||
start_at_input.connect("value_changed", self, "_on_StartAt_value_changed")
|
||||
stop_at_input.connect("value_changed", self, "_on_StopAt_value_changed")
|
||||
|
||||
|
||||
AudioServer.connect("bus_layout_changed", self, "update_bus_selector")
|
||||
update_bus_selector()
|
||||
|
||||
|
||||
file_picker.hide()
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
file_picker.load_data(data)
|
||||
|
||||
|
||||
if data.has("audio_bus"):
|
||||
for idx in range(bus_selector.get_item_count()):
|
||||
if bus_selector.get_item_text(idx) == data["audio_bus"]:
|
||||
bus_selector.select(idx)
|
||||
|
||||
if data.has("volume"):
|
||||
volume_input.value = data["volume"]
|
||||
if data.has("start_time"):
|
||||
start_at_input.value = data["start_time"]
|
||||
if data.has("stop_time"):
|
||||
stop_at_input.value = data["stop_time"]
|
||||
|
||||
if not data.has("event_id"):
|
||||
file_picker.show()
|
||||
region_group.show()
|
||||
|
||||
|
||||
if event_data.has("audio"):event_data["audio"] = "play"
|
||||
if event_data.has("background-music"):event_data["background-music"] = "play"
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func update_bus_selector():
|
||||
if bus_selector != null:
|
||||
var previous_selected_bus_name = bus_selector.get_item_text(max(0, bus_selector.selected))
|
||||
|
||||
bus_selector.clear()
|
||||
for i in range(AudioServer.bus_count):
|
||||
var bus_name = AudioServer.get_bus_name(i)
|
||||
bus_selector.add_item(bus_name)
|
||||
|
||||
if previous_selected_bus_name == bus_name:
|
||||
bus_selector.select(i)
|
||||
|
||||
func _on_FilePicker_data_changed(data):
|
||||
event_data["file"] = data["file"]
|
||||
data_changed()
|
||||
|
||||
func _on_BusSelector_item_selected(index):
|
||||
event_data["audio_bus"] = bus_selector.get_item_text(index)
|
||||
data_changed()
|
||||
|
||||
func _on_Volume_value_changed(value):
|
||||
event_data["volume"] = value
|
||||
data_changed()
|
||||
|
||||
func _on_StopAt_value_changed(value):
|
||||
event_data["stop_time"] = value
|
||||
data_changed()
|
||||
|
||||
func _on_StartAt_value_changed(value):
|
||||
event_data["start_time"] = value
|
||||
data_changed()
|
|
@ -0,0 +1,42 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var audio_picker = $VBox / AudioPicker
|
||||
onready var fade_length_input = $VBox / Fade / FadeLength
|
||||
|
||||
|
||||
func _ready():
|
||||
audio_picker.connect("data_changed", self, "_on_AudioPicker_data_changed")
|
||||
fade_length_input.connect("value_changed", self, "_on_FadeLength_value_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
audio_picker.editor_reference = editor_reference
|
||||
audio_picker.load_data(event_data)
|
||||
|
||||
fade_length_input.value = event_data["fade_length"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return audio_picker.get_preview()
|
||||
|
||||
func _on_AudioPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_FadeLength_value_changed(value):
|
||||
event_data["fade_length"] = value
|
||||
audio_picker.load_data(event_data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
export (PackedScene) var audio_picker
|
||||
|
||||
|
||||
|
||||
var audio_lines = 1
|
||||
|
||||
|
||||
func load_data(data):
|
||||
.load_data(data)
|
||||
|
||||
update_data()
|
||||
|
||||
func repopulate()->void :
|
||||
for child in $List.get_children():
|
||||
child.queue_free()
|
||||
|
||||
var settings = DialogicResources.get_settings_config()
|
||||
|
||||
for i in range(audio_lines):
|
||||
var label = Label.new()
|
||||
label.text = "Line " + str(i + 1) + ":"
|
||||
label.size_flags_vertical = 0
|
||||
$List.add_child(label)
|
||||
|
||||
var a_picker = audio_picker.instance()
|
||||
a_picker.editor_reference = editor_reference
|
||||
a_picker.event_name = "voice line"
|
||||
a_picker.connect("data_changed", self, "_on_audio_picker_audio_loaded", [i])
|
||||
$List.add_child(a_picker)
|
||||
|
||||
|
||||
if event_data.has("voice_data"):
|
||||
var voice_data = event_data["voice_data"]
|
||||
if voice_data.has(str(i)):
|
||||
var _d = voice_data[str(i)]
|
||||
if _d.has("file"):
|
||||
a_picker.load_data(_d)
|
||||
continue
|
||||
|
||||
a_picker.load_data({"file":"", "audio_bus":settings.get_value("dialog", "text_event_audio_default_bus", "Master")})
|
||||
|
||||
|
||||
func _on_text_changed(text:String)->void :
|
||||
|
||||
|
||||
var settings_file = DialogicResources.get_settings_config()
|
||||
|
||||
if not (settings_file.get_value("dialog", "new_lines", true)):
|
||||
$Label.text = "Audio Picker:"
|
||||
return
|
||||
|
||||
var prev_lines = audio_lines
|
||||
$Label.text = "Audio Pickers:"
|
||||
audio_lines = max(1, len(text.split("\n")))
|
||||
|
||||
if prev_lines != audio_lines:
|
||||
repopulate()
|
||||
|
||||
|
||||
|
||||
func _get_audio_picker(index:int):
|
||||
var data = $List.get_child(index * 2 + 1)
|
||||
return data
|
||||
|
||||
func _on_audio_picker_audio_loaded(data, index:int)->void :
|
||||
|
||||
if not event_data.has("voice_data"):
|
||||
event_data["voice_data"] = {}
|
||||
|
||||
event_data["voice_data"][str(index)] = data
|
||||
|
||||
|
||||
load_data(event_data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func update_data():
|
||||
if not event_data.has("voice_data"):
|
||||
return
|
||||
var keys = event_data["voice_data"].keys()
|
||||
|
||||
|
||||
|
||||
|
||||
for i in range($List.get_child_count() / 2):
|
||||
if keys.has(str(i)):
|
||||
var data = event_data["voice_data"][str(i)]
|
||||
|
||||
_get_audio_picker(i).load_data(data)
|
24
addons/dialogic/Editor/Events/Parts/Audio/VoiceEditor.tscn
Normal file
24
addons/dialogic/Editor/Events/Parts/Audio/VoiceEditor.tscn
Normal file
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/EventPart_VoiceEditor.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/AudioPicker.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="VoiceEditor" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
audio_picker = ExtResource( 2 )
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
margin_right = 86.0
|
||||
margin_bottom = 14.0
|
||||
text = "Voice Picker :"
|
||||
|
||||
[node name="List" type="GridContainer" parent="."]
|
||||
margin_top = 18.0
|
||||
margin_right = 86.0
|
||||
margin_bottom = 18.0
|
||||
columns = 2
|
|
@ -0,0 +1,72 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/CallNode/EventPart_CallNodePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=4]
|
||||
|
||||
[node name="CallNodePicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
theme = ExtResource( 4 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 2 )]
|
||||
margin_top = 0.0
|
||||
margin_right = 782.0
|
||||
margin_bottom = 14.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "This event calls the function [Function Name] on the [Target Node] (use full path!). It also passes a number of arguments."
|
||||
|
||||
[node name="Properties" type="HBoxContainer" parent="."]
|
||||
margin_top = 18.0
|
||||
margin_right = 782.0
|
||||
margin_bottom = 45.0
|
||||
custom_constants/separation = 8
|
||||
|
||||
[node name="TargetNodeLabel" type="Label" parent="Properties"]
|
||||
margin_top = 6.0
|
||||
margin_right = 81.0
|
||||
margin_bottom = 20.0
|
||||
text = "Target Node:"
|
||||
|
||||
[node name="TargetNodeEdit" parent="Properties" instance=ExtResource( 3 )]
|
||||
margin_left = 89.0
|
||||
margin_right = 329.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 240, 27 )
|
||||
|
||||
[node name="CallMethodLabel" type="Label" parent="Properties"]
|
||||
margin_left = 337.0
|
||||
margin_top = 6.0
|
||||
margin_right = 432.0
|
||||
margin_bottom = 20.0
|
||||
text = "Method Name:"
|
||||
|
||||
[node name="CallMethodEdit" parent="Properties" instance=ExtResource( 3 )]
|
||||
margin_left = 440.0
|
||||
margin_right = 620.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 180, 27 )
|
||||
|
||||
[node name="ArgumentsLabel" type="Label" parent="Properties"]
|
||||
margin_left = 628.0
|
||||
margin_top = 6.0
|
||||
margin_right = 698.0
|
||||
margin_bottom = 20.0
|
||||
text = "Arguments"
|
||||
|
||||
[node name="ArgumentsSpinBox" type="SpinBox" parent="Properties"]
|
||||
margin_left = 706.0
|
||||
margin_right = 782.0
|
||||
margin_bottom = 27.0
|
||||
max_value = 99.0
|
||||
|
||||
[node name="Arguments" type="VBoxContainer" parent="."]
|
||||
margin_top = 49.0
|
||||
margin_right = 782.0
|
||||
margin_bottom = 49.0
|
||||
custom_constants/separation = 5
|
|
@ -0,0 +1,107 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var target_path_input = $Properties / TargetNodeEdit
|
||||
onready var method_name_input = $Properties / CallMethodEdit
|
||||
onready var argument_length = $Properties / ArgumentsSpinBox
|
||||
onready var arguments_container = $Arguments
|
||||
|
||||
|
||||
func _ready():
|
||||
target_path_input.connect("text_changed", self, "_on_TargetPathInput_text_changed")
|
||||
method_name_input.connect("text_changed", self, "_on_MethodName_text_changed")
|
||||
argument_length.connect("value_changed", self, "_on_AgrumentLength_value_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
target_path_input.text = event_data["call_node"]["target_node_path"]
|
||||
method_name_input.text = event_data["call_node"]["method_name"]
|
||||
|
||||
for i in range(event_data["call_node"]["arguments"].size()):
|
||||
if (event_data["call_node"]["arguments"][i] == null):
|
||||
event_data["call_node"]["arguments"][i] = ""
|
||||
|
||||
argument_length.value = len(event_data["call_node"]["arguments"])
|
||||
|
||||
_create_argument_controls()
|
||||
|
||||
|
||||
func get_preview():
|
||||
if event_data["call_node"]["target_node_path"] and event_data["call_node"]["method_name"]:
|
||||
return "Calls `" + event_data["call_node"]["method_name"] + "` on node `" + event_data["call_node"]["target_node_path"] + "` with an array with " + str(len(event_data["call_node"]["arguments"])) + " items."
|
||||
else :
|
||||
return ""
|
||||
|
||||
func _on_TargetPathInput_text_changed(text):
|
||||
event_data["call_node"]["target_node_path"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_MethodName_text_changed(text):
|
||||
event_data["call_node"]["method_name"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_AgrumentLength_value_changed(value):
|
||||
event_data["call_node"]["arguments"].resize(max(0, value))
|
||||
|
||||
for i in range(event_data["call_node"]["arguments"].size()):
|
||||
if (event_data["call_node"]["arguments"][i] == null):
|
||||
event_data["call_node"]["arguments"][i] = ""
|
||||
|
||||
_create_argument_controls()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_argument_value_changed(value, arg_index):
|
||||
if (arg_index < 0 or arg_index >= event_data["call_node"]["arguments"].size()):
|
||||
return
|
||||
|
||||
event_data["call_node"]["arguments"][arg_index] = str(value)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
|
||||
func _create_argument_controls():
|
||||
if ( not event_data["call_node"]["arguments"] is Array):
|
||||
return
|
||||
|
||||
|
||||
for c in arguments_container.get_children():
|
||||
arguments_container.remove_child(c)
|
||||
c.queue_free()
|
||||
|
||||
|
||||
var index = 0
|
||||
for a in event_data["call_node"]["arguments"]:
|
||||
var container = HBoxContainer.new()
|
||||
container.name = "Argument%s" % index
|
||||
|
||||
var label = Label.new()
|
||||
label.name = "IndexLabel"
|
||||
label.text = "Argument %s:" % index
|
||||
label.rect_min_size.x = 100
|
||||
container.add_child(label)
|
||||
|
||||
var edit = LineEdit.new()
|
||||
edit.name = "IndexValue"
|
||||
edit.text = str(a)
|
||||
edit.connect("text_changed", self, "_on_argument_value_changed", [index])
|
||||
edit.rect_min_size.x = 250
|
||||
container.add_child(edit)
|
||||
|
||||
arguments_container.add_child(container)
|
||||
|
||||
index += 1
|
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterAction.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterAndPortraitPicker.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/PositionPicker.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="CharacterAction" type="HBoxContainer"]
|
||||
margin_right = 454.0
|
||||
margin_bottom = 30.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ActionTypePicker" parent="." instance=ExtResource( 1 )]
|
||||
margin_top = 4.0
|
||||
margin_bottom = 26.0
|
||||
|
||||
[node name="CharacterAndPortraitPicker" parent="." instance=ExtResource( 3 )]
|
||||
margin_left = 98.0
|
||||
margin_right = 193.0
|
||||
margin_bottom = 30.0
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="PositionPicker" parent="." instance=ExtResource( 4 )]
|
||||
margin_left = 197.0
|
||||
margin_right = 471.0
|
||||
size_flags_vertical = 4
|
|
@ -0,0 +1,143 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterActionSettings.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=4]
|
||||
|
||||
[sub_resource type="Image" id=3]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=2]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 3 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="CharacterActionSettings" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
theme = ExtResource( 4 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Animation" type="HBoxContainer" parent="."]
|
||||
margin_right = 589.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label" parent="Animation" instance=ExtResource( 2 )]
|
||||
margin_top = 5.0
|
||||
margin_right = 70.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Animation:"
|
||||
|
||||
[node name="AnimationPicker" parent="Animation" instance=ExtResource( 3 )]
|
||||
margin_left = 74.0
|
||||
margin_right = 172.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Label2" parent="Animation" instance=ExtResource( 2 )]
|
||||
margin_left = 176.0
|
||||
margin_top = 5.0
|
||||
margin_right = 223.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Length:"
|
||||
|
||||
[node name="AnimationLength" type="SpinBox" parent="Animation"]
|
||||
margin_left = 227.0
|
||||
margin_right = 303.0
|
||||
margin_bottom = 24.0
|
||||
step = 0.001
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label3" parent="Animation" instance=ExtResource( 2 )]
|
||||
margin_left = 307.0
|
||||
margin_top = 5.0
|
||||
margin_right = 355.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Repeat:"
|
||||
|
||||
[node name="Repeat" type="SpinBox" parent="Animation"]
|
||||
margin_left = 359.0
|
||||
margin_right = 435.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 1.0
|
||||
value = 1.0
|
||||
rounded = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label4" parent="Animation" instance=ExtResource( 2 )]
|
||||
margin_left = 439.0
|
||||
margin_top = 5.0
|
||||
margin_right = 561.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Wait for animation:"
|
||||
|
||||
[node name="WaitForAnimation" type="CheckBox" parent="Animation"]
|
||||
margin_left = 565.0
|
||||
margin_right = 589.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="Positioning" type="HBoxContainer" parent="."]
|
||||
margin_top = 28.0
|
||||
margin_right = 589.0
|
||||
margin_bottom = 52.0
|
||||
|
||||
[node name="Label" parent="Positioning" instance=ExtResource( 2 )]
|
||||
margin_top = 5.0
|
||||
margin_right = 52.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Z-index:"
|
||||
|
||||
[node name="EnableZIndex" type="ToolButton" parent="Positioning"]
|
||||
margin_left = 56.0
|
||||
margin_right = 84.0
|
||||
margin_bottom = 24.0
|
||||
toggle_mode = true
|
||||
icon = SubResource( 2 )
|
||||
|
||||
[node name="Z_Index" type="SpinBox" parent="Positioning"]
|
||||
margin_left = 88.0
|
||||
margin_right = 164.0
|
||||
margin_bottom = 24.0
|
||||
min_value = -100.0
|
||||
rounded = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" parent="Positioning" instance=ExtResource( 2 )]
|
||||
margin_left = 168.0
|
||||
margin_top = 5.0
|
||||
margin_right = 227.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Mirrored:"
|
||||
|
||||
[node name="EnableMirrored" type="ToolButton" parent="Positioning"]
|
||||
margin_left = 231.0
|
||||
margin_right = 243.0
|
||||
margin_bottom = 24.0
|
||||
toggle_mode = true
|
||||
|
||||
[node name="Mirrored" type="CheckBox" parent="Positioning"]
|
||||
margin_left = 247.0
|
||||
margin_right = 271.0
|
||||
margin_bottom = 24.0
|
|
@ -0,0 +1,75 @@
|
|||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_CharacterJoining.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/PositionPicker.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterAndPortraitPicker.tscn" type="PackedScene" id=3]
|
||||
|
||||
[sub_resource type="Image" id=3]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=2]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 3 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="CharacterJoining" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 389.0
|
||||
margin_bottom = 30.0
|
||||
|
||||
[node name="CharacterAndPortraitPicker" parent="HBox" instance=ExtResource( 3 )]
|
||||
margin_right = 95.0
|
||||
margin_bottom = 30.0
|
||||
|
||||
[node name="PositionPicker" parent="HBox" instance=ExtResource( 2 )]
|
||||
margin_left = 99.0
|
||||
margin_right = 357.0
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="MirrorButton" type="ToolButton" parent="HBox"]
|
||||
margin_left = 361.0
|
||||
margin_right = 389.0
|
||||
margin_bottom = 30.0
|
||||
hint_tooltip = "Mirrors the character"
|
||||
toggle_mode = true
|
||||
icon = SubResource( 2 )
|
||||
|
||||
[node name="NoCharacterContainer" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
margin_top = 4.0
|
||||
margin_right = 399.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="NoCharacterLabel1" type="Label" parent="NoCharacterContainer"]
|
||||
margin_top = 3.0
|
||||
margin_right = 261.0
|
||||
margin_bottom = 17.0
|
||||
text = "You haven't created a character yet. Click"
|
||||
|
||||
[node name="NoCharacterButton" type="Button" parent="NoCharacterContainer"]
|
||||
margin_left = 265.0
|
||||
margin_right = 306.0
|
||||
margin_bottom = 20.0
|
||||
text = "here"
|
||||
|
||||
[node name="NoCharacterLabel2" type="Label" parent="NoCharacterContainer"]
|
||||
margin_left = 310.0
|
||||
margin_top = 3.0
|
||||
margin_right = 399.0
|
||||
margin_bottom = 17.0
|
||||
text = "to create one."
|
|
@ -0,0 +1,84 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
var join_icon = load("res://addons/dialogic/Images/Event Icons/character-join.svg")
|
||||
var leave_icon = load("res://addons/dialogic/Images/Event Icons/character-leave.svg")
|
||||
var update_icon = load("res://addons/dialogic/Images/Event Icons/character.svg")
|
||||
|
||||
|
||||
onready var action_picker = $ActionTypePicker
|
||||
onready var character_portrait_picker = $CharacterAndPortraitPicker
|
||||
onready var position_picker = $PositionPicker
|
||||
|
||||
|
||||
func _ready():
|
||||
action_picker.connect("about_to_show", self, "_on_ActionTypePicker_about_to_show")
|
||||
action_picker.get_popup().connect("index_pressed", self, "_on_ActionTypePicker_index_pressed")
|
||||
character_portrait_picker.connect("data_changed", self, "_on_CharacterAndPortraitPicker_data_changed")
|
||||
position_picker.connect("data_changed", self, "_on_PositionPicker_data_changed")
|
||||
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
match int(data.get("type", 0)):
|
||||
0:
|
||||
action_picker.text = "Join"
|
||||
action_picker.custom_icon = join_icon
|
||||
1:
|
||||
action_picker.text = "Leave"
|
||||
action_picker.custom_icon = leave_icon
|
||||
2:
|
||||
action_picker.text = "Update"
|
||||
action_picker.custom_icon = update_icon
|
||||
|
||||
position_picker.visible = data.get("type", 0) != 1 and data.get("character", "") != ""
|
||||
position_picker.load_data(data)
|
||||
character_portrait_picker.load_data(data)
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_ActionTypePicker_about_to_show():
|
||||
action_picker.get_popup().clear()
|
||||
|
||||
action_picker.get_popup().add_icon_item(join_icon, "Join")
|
||||
action_picker.get_popup().add_icon_item(leave_icon, "Leave")
|
||||
action_picker.get_popup().add_icon_item(update_icon, "Update")
|
||||
|
||||
|
||||
func _on_ActionTypePicker_index_pressed(index):
|
||||
if index != event_data["type"]:
|
||||
if index == 0:
|
||||
event_data["portrait"] = "Default"
|
||||
event_data["animation"] = "[Default]"
|
||||
elif index == 1:
|
||||
event_data["animation"] = "[Default]"
|
||||
elif index == 2:
|
||||
event_data["portrait"] = "(Don't change)"
|
||||
event_data["type"] = index
|
||||
|
||||
load_data(event_data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_CharacterAndPortraitPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
load_data(event_data)
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PositionPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
data_changed()
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
var enable_icon = null
|
||||
var disable_icon = null
|
||||
|
||||
|
||||
|
||||
onready var animation_picker = $Animation / AnimationPicker
|
||||
onready var animation_length = $Animation / AnimationLength
|
||||
onready var z_index_enable = $Positioning / EnableZIndex
|
||||
onready var z_index = $Positioning / Z_Index
|
||||
onready var mirrored_checkbox = $Positioning / Mirrored
|
||||
onready var mirrored_checkbox_enable = $Positioning / EnableMirrored
|
||||
onready var animation_repeat = $Animation / Repeat
|
||||
onready var animation_wait_checkbox = $Animation / WaitForAnimation
|
||||
|
||||
|
||||
func _ready():
|
||||
animation_picker.connect("about_to_show", self, "_on_AnimationPicker_about_to_show")
|
||||
animation_picker.get_popup().connect("index_pressed", self, "_on_AnimationPicker_index_pressed")
|
||||
animation_length.connect("value_changed", self, "_on_AnimationLength_value_changed")
|
||||
z_index.connect("value_changed", self, "_on_ZIndex_value_changed")
|
||||
z_index_enable.connect("toggled", self, "_on_ZIndexEnable_toggled")
|
||||
mirrored_checkbox.connect("toggled", self, "_on_Mirrored_toggled")
|
||||
mirrored_checkbox_enable.connect("toggled", self, "_on_MirroredEnabled_toggled")
|
||||
animation_repeat.connect("value_changed", self, "_on_Repeat_value_changed")
|
||||
animation_wait_checkbox.connect("toggled", self, "on_WaitForAnimation_toggled")
|
||||
enable_icon = get_icon("Edit", "EditorIcons")
|
||||
disable_icon = get_icon("Reload", "EditorIcons")
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
$Positioning.visible = event_data.get("type", 0) != 1
|
||||
if data["type"] == 0:
|
||||
animation_picker.text = DialogicUtil.beautify_filename(event_data.get("animation", "[Default]"))
|
||||
elif data["type"] == 1:
|
||||
animation_picker.text = DialogicUtil.beautify_filename(event_data.get("animation", "[Default]"))
|
||||
else :
|
||||
animation_picker.text = DialogicUtil.beautify_filename(event_data.get("animation", "[No Animation]"))
|
||||
|
||||
animation_picker.custom_icon = get_icon("Animation", "EditorIcons") if event_data["animation"] != "[No Animation]" else get_icon("GuiRadioUnchecked", "EditorIcons")
|
||||
if event_data["animation"] == "[Default]":animation_picker.custom_icon = get_icon("Favorites", "EditorIcons")
|
||||
animation_length.value = event_data.get("animation_length", 1)
|
||||
animation_length.visible = event_data.get("animation", "") != "[Default]"
|
||||
$Animation / Label2.visible = event_data.get("animation", "") != "[Default]"
|
||||
animation_repeat.value = event_data.get("animation_repeat", 1)
|
||||
animation_repeat.visible = int(data.get("type", 0)) == 2
|
||||
$Animation / Label3.visible = int(data.get("type", 0)) == 2
|
||||
animation_wait_checkbox.pressed = event_data.get("animation_wait", false)
|
||||
|
||||
z_index.value = int(event_data.get("z_index", 0))
|
||||
mirrored_checkbox.pressed = event_data.get("mirror_portrait", false)
|
||||
|
||||
|
||||
z_index_enable.visible = int(data.get("type", 0)) == 2
|
||||
mirrored_checkbox_enable.visible = int(data.get("type", 0)) == 2
|
||||
|
||||
z_index_enable.pressed = data.get("change_z_index", false) or int(data.get("type", 0)) != 2
|
||||
mirrored_checkbox_enable.pressed = data.get("change_mirror_portrait", false) or int(data.get("type", 0)) != 2
|
||||
|
||||
z_index.visible = z_index_enable.pressed
|
||||
mirrored_checkbox.visible = mirrored_checkbox_enable.pressed
|
||||
|
||||
z_index_enable.icon = enable_icon if not z_index_enable.pressed else disable_icon
|
||||
mirrored_checkbox_enable.icon = enable_icon if not mirrored_checkbox_enable.pressed else disable_icon
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_AnimationPicker_about_to_show():
|
||||
animation_picker.get_popup().clear()
|
||||
var animations = DialogicAnimaResources.get_available_animations()
|
||||
var idx = 0
|
||||
if event_data["type"] == 2:
|
||||
animation_picker.get_popup().add_icon_item(get_icon("GuiRadioUnchecked", "EditorIcons"), "[No Animation]")
|
||||
animation_picker.get_popup().set_item_metadata(idx, {"file":"[No Animation]"})
|
||||
idx += 1
|
||||
else :
|
||||
animation_picker.get_popup().add_icon_item(get_icon("Favorites", "EditorIcons"), "[Default]")
|
||||
animation_picker.get_popup().set_item_metadata(idx, {"file":"[Default]"})
|
||||
idx += 1
|
||||
for animation_name in animations:
|
||||
if (event_data["type"] == 0 and "_in" in animation_name) or (event_data["type"] == 1 and "_out" in animation_name) or (event_data["type"] == 2 and not "_in" in animation_name and not "_out" in animation_name):
|
||||
animation_picker.get_popup().add_icon_item(get_icon("Animation", "EditorIcons"), DialogicUtil.beautify_filename(animation_name))
|
||||
animation_picker.get_popup().set_item_metadata(idx, {"file":animation_name.get_file()})
|
||||
idx += 1
|
||||
|
||||
|
||||
|
||||
func _on_AnimationPicker_index_pressed(index):
|
||||
event_data["animation"] = animation_picker.get_popup().get_item_metadata(index)["file"]
|
||||
|
||||
animation_picker.custom_icon = get_icon("Animation", "EditorIcons") if event_data["animation"] != "[No Animation]" else get_icon("GuiRadioUnchecked", "EditorIcons")
|
||||
if event_data["animation"] == "[Default]":animation_picker.custom_icon = get_icon("Favorites", "EditorIcons")
|
||||
animation_picker.text = animation_picker.get_popup().get_item_text(index)
|
||||
|
||||
animation_length.visible = event_data.get("animation", "") != "[Default]"
|
||||
$Animation / Label2.visible = event_data.get("animation", "") != "[Default]"
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_AnimationLength_value_changed(value):
|
||||
event_data["animation_length"] = value
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_Repeat_value_changed(value):
|
||||
event_data["animation_repeat"] = value
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func on_WaitForAnimation_toggled(toggled):
|
||||
event_data["animation_wait"] = toggled
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ZIndexEnable_toggled(toggled):
|
||||
if event_data["type"] != 2:return
|
||||
event_data["change_z_index"] = toggled
|
||||
|
||||
z_index.visible = z_index_enable.pressed
|
||||
z_index_enable.icon = enable_icon if not z_index_enable.pressed else disable_icon
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ZIndex_value_changed(value):
|
||||
event_data["z_index"] = value
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_MirroredEnabled_toggled(toggled):
|
||||
if event_data["type"] != 2:return
|
||||
event_data["change_mirror_portrait"] = toggled
|
||||
|
||||
mirrored_checkbox.visible = mirrored_checkbox_enable.pressed
|
||||
mirrored_checkbox_enable.icon = enable_icon if not mirrored_checkbox_enable.pressed else disable_icon
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_Mirrored_toggled(toggled):
|
||||
event_data["mirror_portrait"] = toggled
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,71 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var character_portrait_picker = $HBox / CharacterAndPortraitPicker
|
||||
onready var position_picker = $HBox / PositionPicker
|
||||
onready var mirror_button = $HBox / MirrorButton
|
||||
onready var no_character_button = $NoCharacterContainer / NoCharacterButton
|
||||
onready var no_character_container = $NoCharacterContainer
|
||||
|
||||
|
||||
func _ready():
|
||||
if DialogicUtil.get_character_list().size() > 0:
|
||||
character_portrait_picker.show()
|
||||
position_picker.show()
|
||||
mirror_button.show()
|
||||
no_character_container.hide()
|
||||
else :
|
||||
character_portrait_picker.hide()
|
||||
position_picker.hide()
|
||||
mirror_button.hide()
|
||||
no_character_container.show()
|
||||
var editor_reference = find_parent("EditorView")
|
||||
no_character_button.connect("pressed", editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree"), "new_character")
|
||||
|
||||
|
||||
mirror_button.connect("toggled", self, "_on_MirrorButton_toggled")
|
||||
character_portrait_picker.connect("data_changed", self, "_on_CharacterPortraitPicker_data_changed")
|
||||
position_picker.connect("data_changed", self, "_on_PositionPicker_data_changed")
|
||||
|
||||
|
||||
mirror_button.icon = get_icon("MirrorX", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
character_portrait_picker.load_data(data)
|
||||
position_picker.load_data(data)
|
||||
mirror_button.pressed = data["mirror"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_MirrorButton_toggled(toggle):
|
||||
event_data["mirror"] = toggle
|
||||
|
||||
character_portrait_picker.load_data(event_data)
|
||||
position_picker.load_data(event_data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PositionPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
character_portrait_picker.load_data(event_data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_CharacterPortraitPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,94 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
var default_icon_color = Color("#65989898")
|
||||
var enable_icon
|
||||
var disable_icon
|
||||
|
||||
|
||||
onready var positions_container = $HBox / PositionsContainer
|
||||
onready var enable_position = $HBox / EnablePosition
|
||||
|
||||
func _ready():
|
||||
for p in positions_container.get_children():
|
||||
p.connect("pressed", self, "position_button_pressed", [p.name])
|
||||
enable_position.connect("toggled", self, "on_EnablePosition_toggled")
|
||||
enable_icon = get_icon("Edit", "EditorIcons")
|
||||
disable_icon = get_icon("Reload", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
if data.get("type", 0) == 0:
|
||||
$HBox / Label.text = "at position"
|
||||
elif data.get("type", 0) == 2:
|
||||
if not data.get("change_position", false):
|
||||
$HBox / Label.text = "(same position)"
|
||||
else :
|
||||
$HBox / Label.text = "to position"
|
||||
|
||||
enable_position.pressed = data.get("change_position", false) or data.get("type", 0) != 2
|
||||
enable_position.visible = data.get("type", 0) == 2
|
||||
enable_position.icon = enable_icon if not enable_position.pressed else disable_icon
|
||||
positions_container.visible = enable_position.pressed
|
||||
|
||||
|
||||
check_active_position()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func get_character_color():
|
||||
for ch in DialogicUtil.get_character_list():
|
||||
if ch["file"] == event_data["character"]:
|
||||
return ch["color"]
|
||||
return default_icon_color
|
||||
|
||||
func position_button_pressed(name):
|
||||
clear_all_positions()
|
||||
var selected_index = name.split("-")[1]
|
||||
var button = positions_container.get_node("position-" + selected_index)
|
||||
button.set("self_modulate", get_character_color())
|
||||
button.pressed = true
|
||||
|
||||
event_data["position"][selected_index] = true
|
||||
|
||||
data_changed()
|
||||
|
||||
func clear_all_positions():
|
||||
if not event_data.get("position", false):
|
||||
event_data["position"] = {}
|
||||
for i in range(5):
|
||||
event_data["position"][str(i)] = false
|
||||
for p in positions_container.get_children():
|
||||
p.set("self_modulate", default_icon_color)
|
||||
p.pressed = false
|
||||
|
||||
|
||||
func check_active_position(active_color = Color("#ffffff")):
|
||||
if not event_data.get("position", false):return
|
||||
var index = 0
|
||||
for p in positions_container.get_children():
|
||||
if event_data["position"][str(index)]:
|
||||
p.pressed = true
|
||||
p.set("self_modulate", get_character_color())
|
||||
index += 1
|
||||
|
||||
func on_EnablePosition_toggled(toggled):
|
||||
if event_data["type"] != 2:return
|
||||
event_data["change_position"] = toggled
|
||||
|
||||
positions_container.visible = enable_position.pressed
|
||||
enable_position.icon = enable_icon if not enable_position.pressed else disable_icon
|
||||
|
||||
if not toggled:
|
||||
$HBox / Label.text = "(same position)"
|
||||
else :
|
||||
$HBox / Label.text = "to position"
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,72 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Character/EventPart_PositionPicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Images/Event Icons/character.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="PositionPicker" type="VBoxContainer"]
|
||||
margin_right = 186.0
|
||||
margin_bottom = 30.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 274.0
|
||||
margin_bottom = 30.0
|
||||
|
||||
[node name="Label" parent="HBox" instance=ExtResource( 3 )]
|
||||
margin_top = 8.0
|
||||
margin_right = 68.0
|
||||
margin_bottom = 22.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "at position"
|
||||
|
||||
[node name="PositionsContainer" type="HBoxContainer" parent="HBox"]
|
||||
margin_left = 72.0
|
||||
margin_right = 258.0
|
||||
margin_bottom = 30.0
|
||||
|
||||
[node name="position-0" type="ToolButton" parent="HBox/PositionsContainer"]
|
||||
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
|
||||
margin_right = 34.0
|
||||
margin_bottom = 30.0
|
||||
icon = ExtResource( 2 )
|
||||
|
||||
[node name="position-1" type="ToolButton" parent="HBox/PositionsContainer"]
|
||||
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
|
||||
margin_left = 38.0
|
||||
margin_right = 72.0
|
||||
margin_bottom = 30.0
|
||||
icon = ExtResource( 2 )
|
||||
|
||||
[node name="position-2" type="ToolButton" parent="HBox/PositionsContainer"]
|
||||
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
|
||||
margin_left = 76.0
|
||||
margin_right = 110.0
|
||||
margin_bottom = 30.0
|
||||
icon = ExtResource( 2 )
|
||||
|
||||
[node name="position-3" type="ToolButton" parent="HBox/PositionsContainer"]
|
||||
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
|
||||
margin_left = 114.0
|
||||
margin_right = 148.0
|
||||
margin_bottom = 30.0
|
||||
icon = ExtResource( 2 )
|
||||
|
||||
[node name="position-4" type="ToolButton" parent="HBox/PositionsContainer"]
|
||||
self_modulate = Color( 0.596078, 0.596078, 0.596078, 0.396078 )
|
||||
margin_left = 152.0
|
||||
margin_right = 186.0
|
||||
margin_bottom = 30.0
|
||||
icon = ExtResource( 2 )
|
||||
|
||||
[node name="EnablePosition" type="ToolButton" parent="HBox"]
|
||||
margin_left = 262.0
|
||||
margin_right = 274.0
|
||||
margin_bottom = 30.0
|
||||
toggle_mode = true
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventPart_DummyEventDataShower.gd" type="Script" id=1]
|
||||
|
||||
[node name="DummyEventDataShower" type="HBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Text" type="Label" parent="."]
|
||||
margin_top = 13.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 27.0
|
||||
text = "Event ID: "
|
||||
|
||||
[node name="EventId" type="Label" parent="."]
|
||||
margin_left = 66.0
|
||||
margin_top = 13.0
|
||||
margin_right = 66.0
|
||||
margin_bottom = 27.0
|
|
@ -0,0 +1,51 @@
|
|||
tool
|
||||
extends HBoxContainer
|
||||
|
||||
onready var visible_toggle = $VisibleToggle
|
||||
onready var preview = $MarginContainer / Preview
|
||||
|
||||
var enabled:bool
|
||||
var expanded:bool
|
||||
|
||||
var max_preview_characters = 50
|
||||
|
||||
signal state_changed(expanded)
|
||||
|
||||
func _ready():
|
||||
$MarginContainer / Preview.set("custom_colors/font_color", get_color("disabled_font_color", "Editor"))
|
||||
set_enabled(false)
|
||||
visible_toggle.connect("toggled", self, "_on_VisibleToggle_toggled")
|
||||
|
||||
|
||||
func set_preview(text:String):
|
||||
if len(text) > 50:
|
||||
text = text.substr(0, 50)
|
||||
text += "..."
|
||||
preview.text = text
|
||||
|
||||
|
||||
func set_enabled(enabled:bool):
|
||||
self.enabled = enabled
|
||||
set_expanded(enabled)
|
||||
if enabled:
|
||||
show()
|
||||
else :
|
||||
hide()
|
||||
|
||||
|
||||
func set_expanded(expanded:bool):
|
||||
if not enabled:
|
||||
return
|
||||
self.expanded = expanded
|
||||
visible_toggle.pressed = expanded
|
||||
if expanded:
|
||||
preview.hide()
|
||||
else :
|
||||
preview.show()
|
||||
visible_toggle.release_focus()
|
||||
emit_signal("state_changed", expanded)
|
||||
|
||||
|
||||
func _on_VisibleToggle_toggled(button_pressed:bool):
|
||||
if enabled:
|
||||
set_expanded(button_pressed)
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/ExpandControl.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/VisibleToggle.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="ExpandControl" type="HBoxContainer"]
|
||||
visible = false
|
||||
margin_right = 62.0
|
||||
margin_bottom = 30.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VisibleToggle" parent="." instance=ExtResource( 4 )]
|
||||
margin_left = 8.0
|
||||
margin_right = 38.0
|
||||
pressed = false
|
||||
script = null
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
margin_left = 42.0
|
||||
margin_right = 64.0
|
||||
margin_bottom = 30.0
|
||||
mouse_filter = 1
|
||||
custom_constants/margin_left = 10
|
||||
|
||||
[node name="Preview" type="Label" parent="MarginContainer"]
|
||||
margin_left = 10.0
|
||||
margin_top = 8.0
|
||||
margin_right = 22.0
|
||||
margin_bottom = 22.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "..."
|
17
addons/dialogic/Editor/Events/Parts/EventBlock/PopupMenu.gd
Normal file
17
addons/dialogic/Editor/Events/Parts/EventBlock/PopupMenu.gd
Normal file
|
@ -0,0 +1,17 @@
|
|||
tool
|
||||
extends PopupMenu
|
||||
|
||||
func _ready():
|
||||
clear()
|
||||
add_icon_item(get_icon("Help", "EditorIcons"), "Documentation")
|
||||
add_separator()
|
||||
add_icon_item(get_icon("ArrowUp", "EditorIcons"), "Move up")
|
||||
add_icon_item(get_icon("ArrowDown", "EditorIcons"), "Move down")
|
||||
add_separator()
|
||||
add_icon_item(get_icon("Remove", "EditorIcons"), "Delete")
|
||||
|
||||
var menu_background = load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")
|
||||
menu_background.bg_color = get_color("base_color", "Editor")
|
||||
add_stylebox_override("panel", menu_background)
|
||||
add_stylebox_override("hover", StyleBoxEmpty.new())
|
||||
add_color_override("font_color_hover", get_color("accent_color", "Editor"))
|
|
@ -0,0 +1,49 @@
|
|||
tool
|
||||
extends CheckBox
|
||||
|
||||
var current_piece
|
||||
var is_disabled = false
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
|
||||
current_piece = get_parent().get_parent().get_parent().get_parent()
|
||||
connect("toggled", self, "_on_VisibleToggle_toggled")
|
||||
|
||||
|
||||
func disabled():
|
||||
self_modulate = Color(0, 0, 0, 0)
|
||||
is_disabled = true
|
||||
|
||||
|
||||
func set_visible(visible:bool):
|
||||
pressed = visible
|
||||
var current_rect_size = current_piece.get("rect_size")
|
||||
if visible:
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").hide()
|
||||
|
||||
var index = 0
|
||||
for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
|
||||
if index > 0:
|
||||
node.show()
|
||||
index += 1
|
||||
else :
|
||||
if current_piece.has_node("PanelContainer/VBoxContainer/Header/Preview"):
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").show()
|
||||
|
||||
var index = 0
|
||||
for node in current_piece.get_node("PanelContainer/VBoxContainer").get_children():
|
||||
if index > 0:
|
||||
node.hide()
|
||||
index += 1
|
||||
if "preview" in current_piece:
|
||||
current_piece.get_node("PanelContainer/VBoxContainer/Header/Preview").text = current_piece.preview
|
||||
current_piece.set("rect_size", Vector2(current_rect_size.x, 0))
|
||||
release_focus()
|
||||
|
||||
|
||||
func _on_VisibleToggle_toggled(button_pressed):
|
||||
if is_disabled:
|
||||
return
|
||||
set_visible(button_pressed)
|
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Images/Pieces/open-icon.svg" type="Texture" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Images/Pieces/closed-icon.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/EventBlock/VisibleToggle.gd" type="Script" id=3]
|
||||
|
||||
[node name="VisibleToggle" type="CheckBox"]
|
||||
margin_right = 30.0
|
||||
margin_bottom = 30.0
|
||||
custom_icons/checked = ExtResource( 1 )
|
||||
custom_icons/unchecked = ExtResource( 2 )
|
||||
pressed = true
|
||||
flat = true
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
46
addons/dialogic/Editor/Events/Parts/EventPart.gd
Normal file
46
addons/dialogic/Editor/Events/Parts/EventPart.gd
Normal file
|
@ -0,0 +1,46 @@
|
|||
tool
|
||||
extends Control
|
||||
|
||||
|
||||
var editor_reference
|
||||
|
||||
var event_data = {}
|
||||
|
||||
signal data_changed
|
||||
|
||||
|
||||
signal request_set_body_enabled(enabled)
|
||||
|
||||
|
||||
signal request_open_body
|
||||
signal request_close_body
|
||||
|
||||
|
||||
signal request_selection
|
||||
|
||||
|
||||
signal set_warning(text)
|
||||
signal remove_warning()
|
||||
|
||||
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
event_data = data
|
||||
|
||||
|
||||
|
||||
func get_preview_text():
|
||||
return ""
|
||||
|
||||
|
||||
func focus():
|
||||
pass
|
||||
|
||||
|
||||
func data_changed():
|
||||
emit_signal("data_changed", event_data)
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var text_field = $EventId
|
||||
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
text_field.text = event_data["event_id"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
|
@ -0,0 +1,36 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
onready var input_field = $Box / InputField
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
input_field.connect("text_changed", self, "_on_InputField_text_changed")
|
||||
pass
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
|
||||
input_field.text = event_data["my_text_key"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func _on_InputField_text_changed(text):
|
||||
event_data["my_text_key"] = text
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,47 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/FilePicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Images/EventPart_BackgroundPicker.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/SpinBoxPreventDnD.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=4]
|
||||
|
||||
[node name="BackgroundPicker" type="VBoxContainer"]
|
||||
margin_top = 1.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 23.0
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource( 4 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 353.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FilePicker" parent="HBox" instance=ExtResource( 1 )]
|
||||
margin_right = 149.0
|
||||
|
||||
[node name="FadeLabel" type="Label" parent="HBox"]
|
||||
margin_left = 153.0
|
||||
margin_top = 5.0
|
||||
margin_right = 273.0
|
||||
margin_bottom = 19.0
|
||||
text = " Fade-in duration:"
|
||||
|
||||
[node name="NumberBox" type="SpinBox" parent="HBox"]
|
||||
margin_left = 277.0
|
||||
margin_right = 353.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_vertical = 6
|
||||
step = 0.1
|
||||
value = 1.0
|
||||
allow_greater = true
|
||||
align = 1
|
||||
script = ExtResource( 3 )
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Images/EventPart_BackgroundPreview.gd" type="Script" id=1]
|
||||
|
||||
[node name="BackgroundPreview" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_horizontal = 0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Box" type="CenterContainer" parent="."]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 200.0
|
||||
mouse_filter = 1
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Box"]
|
||||
margin_right = 200.0
|
||||
margin_bottom = 200.0
|
||||
rect_min_size = Vector2( 200, 200 )
|
||||
size_flags_vertical = 5
|
||||
expand = true
|
||||
stretch_mode = 6
|
|
@ -0,0 +1,73 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var file_picker = $HBox / FilePicker
|
||||
|
||||
onready var fade_duration_label = $HBox / FadeLabel
|
||||
onready var fade_duration = $HBox / NumberBox
|
||||
|
||||
|
||||
func _ready():
|
||||
file_picker.connect("data_changed", self, "_on_FilePicker_data_changed")
|
||||
fade_duration.connect("value_changed", self, "_on_fade_duration_changed")
|
||||
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
file_picker.load_data(data)
|
||||
if event_data["background"]:
|
||||
fade_duration_label.visible = true
|
||||
fade_duration.visible = true
|
||||
emit_signal("request_close_body")
|
||||
else :
|
||||
fade_duration_label.visible = false
|
||||
fade_duration.visible = false
|
||||
emit_signal("request_close_body")
|
||||
|
||||
fade_duration.value = event_data.get("fade_duration", 1)
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_FilePicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
fade_duration.visible = not data["background"].empty()
|
||||
fade_duration_label.visible = not data["background"].empty()
|
||||
|
||||
if not data["background"].empty():
|
||||
emit_signal("request_open_body")
|
||||
else :
|
||||
emit_signal("request_close_body")
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_fade_duration_changed(value:float):
|
||||
event_data["fade_duration"] = value
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,39 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var texture_rect = $Box / TextureRect
|
||||
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
if event_data["background"]:
|
||||
if not event_data["background"].ends_with(".tscn"):
|
||||
emit_signal("request_set_body_enabled", true)
|
||||
texture_rect.texture = load(event_data["background"])
|
||||
else :
|
||||
emit_signal("request_set_body_enabled", false)
|
||||
if editor_reference and editor_reference.editor_interface:
|
||||
editor_reference.editor_interface.get_resource_previewer().queue_resource_preview(event_data["background"], self, "show_scene_preview", null)
|
||||
else :
|
||||
emit_signal("request_set_body_enabled", false)
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func show_scene_preview(path:String, preview:Texture, user_data):
|
||||
if preview:
|
||||
texture_rect.texture = preview
|
||||
emit_signal("request_set_body_enabled", true)
|
||||
|
||||
|
42
addons/dialogic/Editor/Events/Parts/Logic/ChoicePicker.tscn
Normal file
42
addons/dialogic/Editor/Events/Parts/Logic/ChoicePicker.tscn
Normal file
|
@ -0,0 +1,42 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/ConditionPicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_ChoicePicker.gd" type="Script" id=3]
|
||||
|
||||
[node name="ChoicePicker" type="HBoxContainer"]
|
||||
margin_right = 437.0
|
||||
margin_bottom = 24.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 158.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Spacer2" type="Control" parent="HBox"]
|
||||
margin_right = 10.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 10, 0 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ChoiceText" parent="HBox" instance=ExtResource( 2 )]
|
||||
margin_left = 14.0
|
||||
margin_right = 144.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Spacer" type="Control" parent="HBox"]
|
||||
margin_left = 148.0
|
||||
margin_right = 158.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 10, 0 )
|
||||
|
||||
[node name="ConditionPicker" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 162.0
|
||||
margin_right = 635.0
|
||||
margin_bottom = 27.0
|
|
@ -0,0 +1,95 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/DefinitionPicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/ConditionTypePicker.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_ConditionPicker.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=5]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
content_margin_left = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[node name="ConditionPicker" type="VBoxContainer"]
|
||||
margin_left = -1.0
|
||||
margin_right = 430.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 473.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="HasCondition" type="HBoxContainer" parent="HBox"]
|
||||
margin_right = 89.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="UseCondition" type="CheckBox" parent="HBox/HasCondition"]
|
||||
margin_right = 89.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_vertical = 7
|
||||
text = "Condition"
|
||||
|
||||
[node name="Values" type="HBoxContainer" parent="HBox"]
|
||||
margin_left = 93.0
|
||||
margin_right = 473.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Label2" parent="HBox/Values" instance=ExtResource( 5 )]
|
||||
margin_top = 6.0
|
||||
margin_right = 9.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "If"
|
||||
|
||||
[node name="DefinitionPicker" parent="HBox/Values" instance=ExtResource( 1 )]
|
||||
margin_left = 13.0
|
||||
margin_top = 1.0
|
||||
margin_right = 115.0
|
||||
margin_bottom = 25.0
|
||||
|
||||
[node name="Label" parent="HBox/Values" instance=ExtResource( 5 )]
|
||||
margin_left = 119.0
|
||||
margin_top = 6.0
|
||||
margin_right = 130.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "is"
|
||||
|
||||
[node name="ConditionTypePicker" parent="HBox/Values" instance=ExtResource( 2 )]
|
||||
margin_left = 134.0
|
||||
margin_right = 232.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Control" type="Control" parent="HBox/Values"]
|
||||
margin_left = 236.0
|
||||
margin_right = 246.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 10, 0 )
|
||||
|
||||
[node name="Value" parent="HBox/Values" instance=ExtResource( 3 )]
|
||||
margin_left = 250.0
|
||||
margin_right = 380.0
|
||||
margin_bottom = 27.0
|
||||
custom_styles/read_only = SubResource( 1 )
|
||||
custom_styles/focus = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
text = "text"
|
|
@ -0,0 +1,58 @@
|
|||
tool
|
||||
extends MenuButton
|
||||
|
||||
var options = [
|
||||
{
|
||||
"text":"[ Equal to ]",
|
||||
"condition":"=="
|
||||
},
|
||||
{
|
||||
"text":"[ Different from ]",
|
||||
"condition":"!="
|
||||
},
|
||||
{
|
||||
"text":"[ Greater than ]",
|
||||
"condition":">"
|
||||
},
|
||||
{
|
||||
"text":"[ Greater or equal to ]",
|
||||
"condition":">="
|
||||
},
|
||||
{
|
||||
"text":"[ Less than ]",
|
||||
"condition":"<"
|
||||
},
|
||||
{
|
||||
"text":"[ Less or equal to ]",
|
||||
"condition":"<="
|
||||
}
|
||||
]
|
||||
|
||||
func _ready():
|
||||
get_popup().connect("index_pressed", self, "_on_entry_selected")
|
||||
get_popup().clear()
|
||||
connect("about_to_show", self, "_on_MenuButton_about_to_show")
|
||||
|
||||
|
||||
func _on_MenuButton_about_to_show():
|
||||
get_popup().clear()
|
||||
var index = 0
|
||||
for o in options:
|
||||
get_popup().add_item(o["text"])
|
||||
get_popup().set_item_metadata(index, o)
|
||||
index += 1
|
||||
|
||||
|
||||
func _on_entry_selected(index):
|
||||
var _text = get_popup().get_item_text(index)
|
||||
var metadata = get_popup().get_item_metadata(index)
|
||||
text = _text
|
||||
|
||||
|
||||
func load_condition(condition):
|
||||
if condition != "":
|
||||
for o in options:
|
||||
if (o["condition"] == condition):
|
||||
text = o["text"]
|
||||
else :
|
||||
text = options[0]["text"]
|
|
@ -0,0 +1,16 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_ConditionTypePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="ConditionTypePicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
||||
margin_right = 98.0
|
||||
margin_bottom = 24.0
|
|
@ -0,0 +1,47 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var input_field = $HBox / ChoiceText
|
||||
onready var condition_picker = $ConditionPicker
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
input_field.connect("text_changed", self, "_on_ChoiceText_text_changed")
|
||||
condition_picker.connect("data_changed", self, "_on_ConditionPicker_data_changed")
|
||||
condition_picker.connect("remove_warning", self, "emit_signal", ["remove_warning"])
|
||||
condition_picker.connect("set_warning", self, "set_warning")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
input_field.text = event_data["choice"]
|
||||
|
||||
|
||||
condition_picker.load_data(event_data)
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func _on_ChoiceText_text_changed(text):
|
||||
event_data["choice"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ConditionPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
data_changed()
|
||||
|
||||
func set_warning(text):
|
||||
emit_signal("set_warning", text)
|
|
@ -0,0 +1,85 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
onready var enabled_view = $HBox / Values
|
||||
onready var definition_picker = $HBox / Values / DefinitionPicker
|
||||
onready var condition_type_picker = $HBox / Values / ConditionTypePicker
|
||||
onready var value_input = $HBox / Values / Value
|
||||
|
||||
onready var optional_view = $HBox / HasCondition
|
||||
onready var use_condition_check = $HBox / HasCondition / UseCondition
|
||||
|
||||
|
||||
func _ready():
|
||||
definition_picker.connect("data_changed", self, "_on_DefinitionPicker_data_changed")
|
||||
|
||||
condition_type_picker.connect("data_changed", self, "_on_ConditionTypePicker_data_changed")
|
||||
|
||||
value_input.connect("text_changed", self, "_on_Value_text_changed")
|
||||
|
||||
use_condition_check.connect("toggled", self, "_on_UseCondition_toggled")
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
definition_picker.load_data(data)
|
||||
condition_type_picker.load_data(data)
|
||||
value_input.text = data["value"]
|
||||
|
||||
if data["event_id"] == "dialogic_011":
|
||||
optional_view.show()
|
||||
if data["definition"] == "":
|
||||
use_condition_check.pressed = false
|
||||
enabled_view.hide()
|
||||
else :
|
||||
use_condition_check.pressed = true
|
||||
enabled_view.show()
|
||||
else :
|
||||
optional_view.hide()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func _on_UseCondition_toggled(checkbox_value):
|
||||
enabled_view.visible = checkbox_value
|
||||
if checkbox_value == false:
|
||||
event_data["definition"] = ""
|
||||
event_data["condition"] = ""
|
||||
event_data["value"] = ""
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_DefinitionPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ConditionTypePicker_data_changed(data):
|
||||
event_data = data
|
||||
check_data()
|
||||
data_changed()
|
||||
|
||||
|
||||
value_input.call_deferred("grab_focus")
|
||||
|
||||
func _on_Value_text_changed(text):
|
||||
event_data["value"] = text
|
||||
check_data()
|
||||
|
||||
data_changed()
|
||||
|
||||
func check_data():
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
emit_signal("remove_warning")
|
|
@ -0,0 +1,76 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
var options = [
|
||||
{
|
||||
"text":"Equal to",
|
||||
"condition":"=="
|
||||
},
|
||||
{
|
||||
"text":"Different from",
|
||||
"condition":"!="
|
||||
},
|
||||
{
|
||||
"text":"Greater than",
|
||||
"condition":">"
|
||||
},
|
||||
{
|
||||
"text":"Greater or equal to",
|
||||
"condition":">="
|
||||
},
|
||||
{
|
||||
"text":"Less than",
|
||||
"condition":"<"
|
||||
},
|
||||
{
|
||||
"text":"Less or equal to",
|
||||
"condition":"<="
|
||||
}
|
||||
]
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
|
||||
picker_menu.get_popup().connect("index_pressed", self, "_on_PickerMenu_selected")
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.custom_icon = get_icon("GDScript", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
select_condition_type(data["condition"])
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func select_condition_type(condition):
|
||||
if condition != "":
|
||||
for o in options:
|
||||
if (o["condition"] == condition):
|
||||
picker_menu.text = o["text"]
|
||||
else :
|
||||
picker_menu.text = options[0]["text"]
|
||||
|
||||
func _on_PickerMenu_selected(index):
|
||||
event_data["condition"] = picker_menu.get_popup().get_item_metadata(index).get("condition", "")
|
||||
|
||||
select_condition_type(event_data["condition"])
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
picker_menu.get_popup().clear()
|
||||
var index = 0
|
||||
for o in options:
|
||||
picker_menu.get_popup().add_item(o["text"])
|
||||
picker_menu.get_popup().set_item_metadata(index, o)
|
||||
index += 1
|
|
@ -0,0 +1,57 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.get_popup().connect("index_pressed", self, "_on_PickerMenu_selected")
|
||||
find_parent("TimelineEditor").connect("timeline_loaded", self, "update")
|
||||
picker_menu.custom_icon = load("res://addons/dialogic/Images/Event Icons/label.svg")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
update()
|
||||
|
||||
func update():
|
||||
if event_data["anchor_id"] == "":
|
||||
picker_menu.text = "Select label"
|
||||
else :
|
||||
var anchors = find_parent("TimelineEditor").get_current_events_anchors()
|
||||
if event_data["anchor_id"] in anchors.keys():
|
||||
picker_menu.text = anchors[event_data["anchor_id"]]
|
||||
else :
|
||||
picker_menu.text = "Label not found"
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
picker_menu.get_popup().clear()
|
||||
|
||||
var anchors = find_parent("TimelineEditor").get_current_events_anchors()
|
||||
var index = 0
|
||||
for id in anchors.keys():
|
||||
picker_menu.get_popup().add_item(anchors[id])
|
||||
picker_menu.get_popup().set_item_metadata(index, {"id":id})
|
||||
index += 1
|
||||
|
||||
func _on_PickerMenu_selected(index):
|
||||
var text = picker_menu.get_popup().get_item_text(index)
|
||||
var metadata = picker_menu.get_popup().get_item_metadata(index)
|
||||
|
||||
picker_menu.text = text
|
||||
|
||||
event_data["anchor_id"] = metadata["id"]
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,38 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var input_field = $NameInput
|
||||
onready var new_id = $NewIdButton
|
||||
|
||||
|
||||
func _ready():
|
||||
input_field.connect("text_changed", self, "_on_InputField_text_changed")
|
||||
new_id.icon = get_icon("RotateRight", "EditorIcons")
|
||||
new_id.connect("pressed", self, "new_id")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
if data["id"] == null:
|
||||
new_id()
|
||||
input_field.text = event_data["name"]
|
||||
|
||||
new_id.hint_tooltip = "Change to a new unique ID. \nOnly do this if you have a duplicate id in this timeline! \nWill break existing links. \n\nCurrent ID: " + data["id"]
|
||||
|
||||
func new_id():
|
||||
event_data["id"] = "anchor-" + str(OS.get_unix_time())
|
||||
|
||||
new_id.hint_tooltip = "Change to a new unique ID. \nOnly do this if you have a duplicate id in this timeline! \nWill break existing links. \n\nCurrent ID: " + event_data["id"]
|
||||
data_changed()
|
||||
|
||||
func _on_InputField_text_changed(text):
|
||||
event_data["name"] = text
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,71 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
var options = [
|
||||
{
|
||||
"text":"to be",
|
||||
"operation":"="
|
||||
},
|
||||
{
|
||||
"text":"to itself plus",
|
||||
"operation":"+"
|
||||
},
|
||||
{
|
||||
"text":"to itself minus",
|
||||
"operation":"-"
|
||||
},
|
||||
{
|
||||
"text":"to itself multiplied by",
|
||||
"operation":"*"
|
||||
},
|
||||
{
|
||||
"text":"to itself divided by",
|
||||
"operation":"/"
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.get_popup().connect("index_pressed", self, "_on_PickerMenu_selected")
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.custom_icon = get_icon("GDScript", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
select_operation()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func select_operation():
|
||||
for o in options:
|
||||
if (o["operation"] == event_data["operation"]):
|
||||
picker_menu.text = o["text"]
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index):
|
||||
event_data["operation"] = picker_menu.get_popup().get_item_metadata(index).get("operation")
|
||||
|
||||
select_operation()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
picker_menu.get_popup().clear()
|
||||
|
||||
var index = 0
|
||||
for o in options:
|
||||
picker_menu.get_popup().add_item(o["text"])
|
||||
picker_menu.get_popup().set_item_metadata(index, o)
|
||||
index += 1
|
53
addons/dialogic/Editor/Events/Parts/Logic/EventPart_Save.gd
Normal file
53
addons/dialogic/Editor/Events/Parts/Logic/EventPart_Save.gd
Normal file
|
@ -0,0 +1,53 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var slot_picker = $MenuButton
|
||||
onready var custom_slot = $CustomSlot
|
||||
|
||||
|
||||
func _ready():
|
||||
custom_slot.connect("text_changed", self, "_on_CustomSlot_text_changed")
|
||||
slot_picker.get_popup().connect("index_pressed", self, "on_SlotPicker_index_pressed")
|
||||
slot_picker.get_popup().clear()
|
||||
slot_picker.get_popup().add_icon_item(get_icon("Save", "EditorIcons"), "Default slot")
|
||||
slot_picker.get_popup().add_icon_item(get_icon("Tools", "EditorIcons"), "Custom slot")
|
||||
slot_picker.custom_icon = get_icon("Save", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
if event_data.get("use_default_slot", true):
|
||||
slot_picker.text = "Default slot"
|
||||
else :
|
||||
slot_picker.text = "Custom slot"
|
||||
custom_slot.text = event_data.get("custom_slot", "")
|
||||
|
||||
custom_slot.visible = not event_data.get("use_default_slot", true)
|
||||
|
||||
func on_SlotPicker_index_pressed(index):
|
||||
event_data["use_default_slot"] = index == 0
|
||||
|
||||
|
||||
if event_data.get("use_default_slot", true):
|
||||
slot_picker.text = "Default slot"
|
||||
else :
|
||||
slot_picker.text = "Custom slot"
|
||||
custom_slot.text = event_data.get("custom_slot", "")
|
||||
|
||||
custom_slot.visible = not event_data.get("use_default_slot", true)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_CustomSlot_text_changed(text):
|
||||
event_data["custom_slot"] = text
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_Save.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="EventPart_Save" type="HBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
custom_constants/separation = 9
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" parent="." instance=ExtResource( 4 )]
|
||||
margin_top = 13.0
|
||||
margin_right = 13.0
|
||||
margin_bottom = 27.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "to"
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 3 )]
|
||||
margin_left = 22.0
|
||||
margin_top = 9.0
|
||||
margin_right = 116.0
|
||||
margin_bottom = 31.0
|
||||
|
||||
[node name="CustomSlot" parent="." instance=ExtResource( 1 )]
|
||||
margin_left = 125.0
|
||||
margin_top = 6.0
|
||||
margin_right = 255.0
|
||||
margin_bottom = 33.0
|
||||
hint_tooltip = "Also allows for value definitions like this: [my_value_name]"
|
|
@ -0,0 +1,99 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var input_feature = $HBox / InputValue
|
||||
onready var input_field = $HBox / InputValue / InputField
|
||||
onready var definition_picker = $HBox / DefinitionPicker
|
||||
onready var operation_picker = $HBox / OperationPicker
|
||||
|
||||
onready var random_enabled_button = $HBox / RandomEnabled
|
||||
onready var random_features = $HBox / RandomValue
|
||||
onready var random_lower_limit = $HBox / RandomValue / LowerLimit
|
||||
onready var random_upper_limit = $HBox / RandomValue / UpperLimit
|
||||
|
||||
|
||||
func _ready():
|
||||
input_field.connect("text_changed", self, "_on_InputField_text_changed")
|
||||
definition_picker.connect("data_changed", self, "_on_DefintionPicker_data_changed")
|
||||
operation_picker.connect("data_changed", self, "_on_OperationPicker_data_changed")
|
||||
|
||||
random_enabled_button.icon = get_icon("MaterialPreviewCube", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
input_field.text = event_data["set_value"]
|
||||
definition_picker.load_data(data)
|
||||
operation_picker.load_data(data)
|
||||
|
||||
switch_random_features(data.get("set_random", false))
|
||||
|
||||
random_lower_limit.value = data.get("random_lower_limit", 0)
|
||||
random_upper_limit.value = data.get("random_upper_limit", 100)
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func check_data():
|
||||
if event_data["operation"] != "=":
|
||||
if not event_data["set_value"].is_valid_float():
|
||||
emit_signal("set_warning", DTS.translate("The selected operator requires a number!"))
|
||||
return
|
||||
|
||||
emit_signal("remove_warning")
|
||||
|
||||
func _on_InputField_text_changed(text):
|
||||
event_data["set_value"] = text
|
||||
|
||||
operation_picker.load_data(event_data)
|
||||
definition_picker.load_data(event_data)
|
||||
|
||||
check_data()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_DefintionPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
operation_picker.load_data(data)
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_OperationPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
definition_picker.load_data(data)
|
||||
|
||||
check_data()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func switch_random_features(enabled):
|
||||
random_features.visible = enabled
|
||||
input_feature.visible = not enabled
|
||||
random_enabled_button.pressed = enabled
|
||||
event_data["set_random"] = enabled
|
||||
|
||||
|
||||
func _on_LowerLimit_value_changed(value):
|
||||
event_data["random_lower_limit"] = value
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_UpperLimit_value_changed(value):
|
||||
event_data["random_upper_limit"] = value
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_RandomEnabled_toggled(button_pressed):
|
||||
switch_random_features(button_pressed)
|
23
addons/dialogic/Editor/Events/Parts/Logic/GoTo Selector.tscn
Normal file
23
addons/dialogic/Editor/Events/Parts/Logic/GoTo Selector.tscn
Normal file
|
@ -0,0 +1,23 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_GoToSelector.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="GoTo Selector" type="HBoxContainer"]
|
||||
margin_right = 129.0
|
||||
margin_bottom = 22.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 3 )]
|
||||
margin_right = 31.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "label"
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 35.0
|
||||
margin_right = 129.0
|
33
addons/dialogic/Editor/Events/Parts/Logic/LabelSetter.tscn
Normal file
33
addons/dialogic/Editor/Events/Parts/Logic/LabelSetter.tscn
Normal file
|
@ -0,0 +1,33 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_LabelSetter.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="AnchorSetter" type="HBoxContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = -723.0
|
||||
margin_bottom = -573.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="NameInput" parent="." instance=ExtResource( 1 )]
|
||||
margin_right = 130.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 3 )]
|
||||
margin_left = 134.0
|
||||
margin_top = 6.0
|
||||
margin_right = 182.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = " is here"
|
||||
|
||||
[node name="NewIdButton" type="ToolButton" parent="."]
|
||||
margin_left = 186.0
|
||||
margin_right = 198.0
|
||||
margin_bottom = 27.0
|
||||
hint_tooltip = "Change to a new unique ID. Only do this if you have a duplicate id in this timeline!"
|
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_OperationPicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="OperationPicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
123
addons/dialogic/Editor/Events/Parts/Logic/SetValuePicker.tscn
Normal file
123
addons/dialogic/Editor/Events/Parts/Logic/SetValuePicker.tscn
Normal file
|
@ -0,0 +1,123 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/OperationPicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/DefinitionPicker.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Logic/EventPart_SetValuePicker.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=5]
|
||||
|
||||
[sub_resource type="Image" id=4]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=3]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 4 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="SetValuePicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 4 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 726.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="DefinitionPicker" parent="HBox" instance=ExtResource( 3 )]
|
||||
margin_top = 2.0
|
||||
margin_right = 98.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="OperationPicker" parent="HBox" instance=ExtResource( 1 )]
|
||||
margin_left = 102.0
|
||||
margin_top = 2.0
|
||||
margin_right = 196.0
|
||||
margin_bottom = 24.0
|
||||
|
||||
[node name="InputValue" type="HBoxContainer" parent="HBox"]
|
||||
margin_left = 200.0
|
||||
margin_right = 344.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="Spacer" type="Control" parent="HBox/InputValue"]
|
||||
margin_right = 10.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 10, 0 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="InputField" parent="HBox/InputValue" instance=ExtResource( 2 )]
|
||||
margin_left = 14.0
|
||||
margin_right = 144.0
|
||||
margin_bottom = 27.0
|
||||
|
||||
[node name="RandomValue" type="HBoxContainer" parent="HBox"]
|
||||
margin_left = 348.0
|
||||
margin_right = 680.0
|
||||
margin_bottom = 27.0
|
||||
custom_constants/separation = 5
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" parent="HBox/RandomValue" instance=ExtResource( 5 )]
|
||||
margin_top = 6.0
|
||||
margin_right = 156.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = " a random number from"
|
||||
|
||||
[node name="LowerLimit" type="SpinBox" parent="HBox/RandomValue"]
|
||||
margin_left = 161.0
|
||||
margin_right = 235.0
|
||||
margin_bottom = 27.0
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
|
||||
[node name="Label2" parent="HBox/RandomValue" instance=ExtResource( 5 )]
|
||||
margin_left = 240.0
|
||||
margin_top = 6.0
|
||||
margin_right = 253.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "to"
|
||||
|
||||
[node name="UpperLimit" type="SpinBox" parent="HBox/RandomValue"]
|
||||
margin_left = 258.0
|
||||
margin_right = 332.0
|
||||
margin_bottom = 27.0
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
|
||||
[node name="Spacer" type="Control" parent="HBox"]
|
||||
margin_left = 684.0
|
||||
margin_right = 694.0
|
||||
margin_bottom = 27.0
|
||||
rect_min_size = Vector2( 10, 0 )
|
||||
|
||||
[node name="RandomEnabled" type="Button" parent="HBox"]
|
||||
self_modulate = Color( 1, 1, 1, 0.501961 )
|
||||
margin_left = 698.0
|
||||
margin_right = 726.0
|
||||
margin_bottom = 27.0
|
||||
hint_tooltip = "Set to a random integer"
|
||||
focus_mode = 0
|
||||
toggle_mode = true
|
||||
icon = SubResource( 3 )
|
||||
flat = true
|
||||
|
||||
[connection signal="value_changed" from="HBox/RandomValue/LowerLimit" to="." method="_on_LowerLimit_value_changed"]
|
||||
[connection signal="value_changed" from="HBox/RandomValue/UpperLimit" to="." method="_on_UpperLimit_value_changed"]
|
||||
[connection signal="toggled" from="HBox/RandomEnabled" to="." method="_on_RandomEnabled_toggled"]
|
|
@ -0,0 +1,29 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var number_box = $HBox / NumberBox
|
||||
|
||||
|
||||
func _ready():
|
||||
number_box.connect("value_changed", self, "_on_NumberBox_value_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
number_box.value = event_data["transition_duration"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_NumberBox_value_changed(value):
|
||||
event_data["transition_duration"] = value
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/SpinBoxPreventDnD.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Numbers/EventPart_TransitonLengthPicker.gd" type="Script" id=2]
|
||||
|
||||
[node name="TransitonLengthPicker" type="VBoxContainer"]
|
||||
margin_right = 195.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 195.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="NameLabel" type="Label" parent="HBox"]
|
||||
margin_top = 5.0
|
||||
margin_right = 117.0
|
||||
margin_bottom = 19.0
|
||||
text = "Fade-out duration:"
|
||||
|
||||
[node name="NumberBox" type="SpinBox" parent="HBox"]
|
||||
margin_left = 121.0
|
||||
margin_right = 195.0
|
||||
margin_bottom = 24.0
|
||||
size_flags_vertical = 6
|
||||
step = 0.1
|
||||
value = 1.0
|
||||
allow_greater = true
|
||||
align = 1
|
||||
script = ExtResource( 1 )
|
|
@ -0,0 +1,39 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/PortraitPicker.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/CharacterPicker.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/EventPart_CharacterAndPortraitPicker.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/DefinitionPicker.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="CharacterAndPortraitPicker" type="VBoxContainer"]
|
||||
margin_right = 305.0
|
||||
margin_bottom = 48.0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 305.0
|
||||
margin_bottom = 48.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 5
|
||||
|
||||
[node name="CharacterPicker" parent="HBox" instance=ExtResource( 2 )]
|
||||
margin_top = 9.0
|
||||
margin_right = 95.0
|
||||
margin_bottom = 39.0
|
||||
|
||||
[node name="PortraitPicker" parent="HBox" instance=ExtResource( 1 )]
|
||||
visible = false
|
||||
margin_left = 100.0
|
||||
margin_top = 13.0
|
||||
margin_right = 264.0
|
||||
margin_bottom = 35.0
|
||||
|
||||
[node name="DefinitionPicker" parent="HBox" instance=ExtResource( 4 )]
|
||||
visible = false
|
||||
margin_left = 100.0
|
||||
margin_top = 13.0
|
||||
margin_right = 198.0
|
||||
margin_bottom = 35.0
|
|
@ -0,0 +1,53 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Characters/EventPart_CharacterPicker.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Theme/PickerTheme.tres" type="Theme" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=4]
|
||||
|
||||
[node name="CharacterPicker" type="VBoxContainer"]
|
||||
margin_right = 161.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 0, 30 )
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource( 3 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 161.0
|
||||
margin_bottom = 30.0
|
||||
size_flags_vertical = 3
|
||||
custom_constants/separation = 5
|
||||
|
||||
[node name="MenuButton" parent="HBox" instance=ExtResource( 4 )]
|
||||
margin_top = 4.0
|
||||
margin_right = 95.0
|
||||
margin_bottom = 26.0
|
||||
text = "Character"
|
||||
|
||||
[node name="NoCharacterContainer" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
margin_top = 26.0
|
||||
margin_right = 399.0
|
||||
margin_bottom = 46.0
|
||||
|
||||
[node name="NoCharacterLabel1" type="Label" parent="NoCharacterContainer"]
|
||||
margin_top = 3.0
|
||||
margin_right = 261.0
|
||||
margin_bottom = 17.0
|
||||
text = "You haven't created a character yet. Click"
|
||||
|
||||
[node name="NoCharacterButton" type="Button" parent="NoCharacterContainer"]
|
||||
margin_left = 265.0
|
||||
margin_right = 306.0
|
||||
margin_bottom = 20.0
|
||||
text = "here"
|
||||
|
||||
[node name="NoCharacterLabel2" type="Label" parent="NoCharacterContainer"]
|
||||
margin_left = 310.0
|
||||
margin_top = 3.0
|
||||
margin_right = 399.0
|
||||
margin_bottom = 17.0
|
||||
text = "to create one."
|
|
@ -0,0 +1,78 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
onready var character_picker = $HBox / CharacterPicker
|
||||
onready var portrait_picker = $HBox / PortraitPicker
|
||||
onready var definition_picker = $HBox / DefinitionPicker
|
||||
|
||||
|
||||
func _ready():
|
||||
if DialogicUtil.get_character_list().size() == 0:
|
||||
hide()
|
||||
character_picker.connect("data_changed", self, "_on_CharacterPicker_data_changed")
|
||||
portrait_picker.connect("data_changed", self, "_on_PortraitPicker_data_changed")
|
||||
definition_picker.connect("data_changed", self, "_on_DefinitionPicker_data_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
portrait_picker.load_data(data)
|
||||
character_picker.load_data(data)
|
||||
|
||||
portrait_picker.visible = get_character_data() and len(get_character_data()["portraits"]) > 1
|
||||
|
||||
if data["event_id"] == "dialogic_002":
|
||||
if data.get("type", 0) != 1:
|
||||
var has_port_defn = data["portrait"] == "[Definition]"
|
||||
if portrait_picker.visible and has_port_defn and data.has("port_defn"):
|
||||
definition_picker.load_data({"definition":data["port_defn"]})
|
||||
definition_picker.visible = has_port_defn
|
||||
else :
|
||||
portrait_picker.hide()
|
||||
definition_picker.hide()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
func get_character_data():
|
||||
for ch in DialogicUtil.get_character_list():
|
||||
if ch["file"] == event_data["character"]:
|
||||
return ch
|
||||
|
||||
|
||||
func _on_CharacterPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
|
||||
portrait_picker.load_data(data)
|
||||
portrait_picker.visible = get_character_data() and len(get_character_data()["portraits"]) > 1
|
||||
if not portrait_picker.visible:
|
||||
definition_picker.hide()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_PortraitPicker_data_changed(data):
|
||||
event_data = data
|
||||
|
||||
|
||||
character_picker.load_data(data)
|
||||
definition_picker.visible = event_data["portrait"] == "[Definition]"
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_DefinitionPicker_data_changed(data):
|
||||
event_data["port_defn"] = data["definition"]
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,156 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
export (bool) var allow_no_character: = false
|
||||
|
||||
|
||||
onready var picker_menu = $HBox / MenuButton
|
||||
onready var no_character_button = $NoCharacterContainer / NoCharacterButton
|
||||
onready var no_character_container = $NoCharacterContainer
|
||||
|
||||
|
||||
var no_character_icon
|
||||
var all_characters_icon
|
||||
var single_character_icon
|
||||
|
||||
|
||||
func _ready():
|
||||
if DialogicUtil.get_character_list().size() > 0:
|
||||
picker_menu.show()
|
||||
no_character_container.hide()
|
||||
else :
|
||||
picker_menu.hide()
|
||||
no_character_container.show()
|
||||
var editor_reference = find_parent("EditorView")
|
||||
no_character_button.connect("pressed", editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree"), "new_character")
|
||||
|
||||
|
||||
|
||||
|
||||
var event_node = get_node("../../../../../../../..")
|
||||
if event_node.get_node_or_null("AllowNoCharacter"):
|
||||
allow_no_character = true
|
||||
no_character_container.hide()
|
||||
|
||||
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
|
||||
|
||||
no_character_icon = get_icon("GuiRadioUnchecked", "EditorIcons")
|
||||
all_characters_icon = get_icon("GuiEllipsis", "EditorIcons")
|
||||
single_character_icon = load("res://addons/dialogic/Images/Resources/character.svg")
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
allow_no_character = data["event_id"] != "dialogic_002"
|
||||
|
||||
update_to_character()
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
func update_to_character():
|
||||
if event_data["character"] != "":
|
||||
if event_data["character"] == "[All]":
|
||||
picker_menu.text = "All characters"
|
||||
picker_menu.reset_modulation()
|
||||
picker_menu.custom_icon = all_characters_icon
|
||||
else :
|
||||
for ch in DialogicUtil.get_character_list():
|
||||
if ch["file"] == event_data["character"]:
|
||||
picker_menu.text = ch["name"]
|
||||
picker_menu.custom_icon_modulation = ch["color"]
|
||||
picker_menu.custom_icon = single_character_icon
|
||||
else :
|
||||
if allow_no_character:
|
||||
picker_menu.text = "No Character"
|
||||
picker_menu.custom_icon = no_character_icon
|
||||
else :
|
||||
picker_menu.text = "Select Character"
|
||||
picker_menu.custom_icon = single_character_icon
|
||||
picker_menu.reset_modulation()
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index, menu):
|
||||
var metadata = menu.get_item_metadata(index)
|
||||
if event_data["character"] != metadata.get("file", ""):
|
||||
if event_data.get("event_id") == "dialogic_002":
|
||||
if event_data.get("type") == 0:
|
||||
event_data["portrait"] = "Default"
|
||||
elif event_data.get("type") == 2:
|
||||
event_data["portrait"] = "(Don't change)"
|
||||
event_data["character"] = metadata.get("file", "")
|
||||
|
||||
update_to_character()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
build_PickerMenu()
|
||||
|
||||
|
||||
func build_PickerMenu():
|
||||
picker_menu.get_popup().clear()
|
||||
var folder_structure = DialogicUtil.get_characters_folder_structure()
|
||||
|
||||
|
||||
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
|
||||
|
||||
|
||||
|
||||
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
|
||||
var index = 0
|
||||
|
||||
|
||||
if menu == picker_menu.get_popup():
|
||||
if event_data.get("event_id", "dialogic_001") != "dialogic_002":
|
||||
menu.add_item("No character")
|
||||
menu.set_item_metadata(index, {"file":""})
|
||||
menu.set_item_icon(index, no_character_icon)
|
||||
index += 1
|
||||
|
||||
|
||||
if event_data.get("type", 0) == 1:
|
||||
menu.add_item("All characters")
|
||||
menu.set_item_metadata(index, {"file":"[All]"})
|
||||
menu.set_item_icon(index, all_characters_icon)
|
||||
index += 1
|
||||
|
||||
|
||||
for folder_name in folder_structure["folders"].keys():
|
||||
var submenu = PopupMenu.new()
|
||||
var submenu_name = build_PickerMenuFolder(submenu, folder_structure["folders"][folder_name], folder_name)
|
||||
submenu.name = submenu_name
|
||||
menu.add_submenu_item(folder_name, submenu_name)
|
||||
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
|
||||
menu.add_child(submenu)
|
||||
index += 1
|
||||
|
||||
|
||||
picker_menu.update_submenu_style(submenu)
|
||||
|
||||
var files_info = DialogicUtil.get_characters_dict()
|
||||
for file in folder_structure["files"]:
|
||||
menu.add_item(files_info[file]["name"])
|
||||
|
||||
|
||||
menu.set_item_icon(index, single_character_icon)
|
||||
menu.set_item_metadata(index, {"file":file})
|
||||
index += 1
|
||||
|
||||
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
|
||||
menu.connect("index_pressed", self, "_on_PickerMenu_selected", [menu])
|
||||
|
||||
return current_folder_name
|
|
@ -0,0 +1,170 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
export (bool) var allow_dont_change: = true
|
||||
export (bool) var allow_definition: = true
|
||||
|
||||
|
||||
onready var picker_menu = $HBox / MenuButton
|
||||
onready var preview = $Preview / PreviewContainer
|
||||
onready var preview_title = preview.get_node("VBox/Title")
|
||||
onready var preview_texture = preview.get_node("VBox/TextureRect")
|
||||
var current_hovered = null
|
||||
|
||||
var character_data = null
|
||||
|
||||
|
||||
var no_change_icon
|
||||
var definition_icon
|
||||
var portrait_icon
|
||||
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.get_popup().connect("index_pressed", self, "_on_PickerMenu_selected")
|
||||
picker_menu.get_popup().connect("gui_input", self, "popup_gui_input")
|
||||
picker_menu.get_popup().connect("mouse_exited", self, "mouse_exited_popup")
|
||||
picker_menu.get_popup().connect("popup_hide", self, "mouse_exited_popup")
|
||||
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
preview_title.set("custom_fonts/font", get_font("title", "EditorFonts"))
|
||||
preview.set("custom_styles/panel", get_stylebox("panel", "PopupMenu"))
|
||||
|
||||
|
||||
no_change_icon = get_icon("GuiRadioUnchecked", "EditorIcons")
|
||||
definition_icon = load("res://addons/dialogic/Images/Resources/definition.svg")
|
||||
portrait_icon = load("res://addons/dialogic/Images/Event Icons/Portrait.svg")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
allow_dont_change = event_data["event_id"] != "dialogic_002" or (event_data["event_id"] == "dialogic_002" and int(event_data.get("type", 0)) == 2)
|
||||
|
||||
if event_data["event_id"] == "dialogic_002" and event_data["type"] == 2:
|
||||
$HBox / Label.text = "to portrait"
|
||||
else :
|
||||
$HBox / Label.text = "with portrait"
|
||||
|
||||
|
||||
if event_data.get("portrait", "").empty():
|
||||
|
||||
if allow_dont_change:
|
||||
picker_menu.text = "(Don't change)"
|
||||
picker_menu.custom_icon = no_change_icon
|
||||
else :
|
||||
picker_menu.text = "Default"
|
||||
picker_menu.custom_icon = portrait_icon
|
||||
else :
|
||||
if event_data["portrait"] == "[Definition]":
|
||||
picker_menu.text = "[Value]"
|
||||
picker_menu.custom_icon = definition_icon
|
||||
else :
|
||||
picker_menu.text = event_data["portrait"]
|
||||
picker_menu.custom_icon = portrait_icon
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_PickerMenu_selected(index):
|
||||
if index == 0 and allow_dont_change:
|
||||
event_data["portrait"] = "(Don't change)"
|
||||
picker_menu.custom_icon = no_change_icon
|
||||
elif allow_definition and ((allow_dont_change and index == 1) or index == 0):
|
||||
event_data["portrait"] = "[Definition]"
|
||||
picker_menu.custom_icon = definition_icon
|
||||
else :
|
||||
event_data["portrait"] = picker_menu.get_popup().get_item_text(index)
|
||||
picker_menu.custom_icon = portrait_icon
|
||||
|
||||
if event_data["portrait"] == "[Definition]":
|
||||
picker_menu.text = "[Value]"
|
||||
else :
|
||||
picker_menu.text = event_data["portrait"]
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func get_character_data():
|
||||
for ch in DialogicUtil.get_character_list():
|
||||
if ch["file"] == event_data["character"]:
|
||||
return ch
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
character_data = get_character_data()
|
||||
picker_menu.get_popup().clear()
|
||||
var index = 0
|
||||
if allow_dont_change:
|
||||
picker_menu.get_popup().add_item("(Don't change)")
|
||||
picker_menu.get_popup().set_item_icon(index, no_change_icon)
|
||||
index += 1
|
||||
if allow_definition:
|
||||
picker_menu.get_popup().add_item("[Value]")
|
||||
picker_menu.get_popup().set_item_icon(index, definition_icon)
|
||||
index += 1
|
||||
if event_data["character"]:
|
||||
if character_data.has("portraits"):
|
||||
for p in character_data["portraits"]:
|
||||
picker_menu.get_popup().add_item(p["name"])
|
||||
picker_menu.get_popup().set_item_icon(index, portrait_icon)
|
||||
index += 1
|
||||
|
||||
func popup_gui_input(event):
|
||||
if event is InputEventMouseMotion:
|
||||
if current_hovered != picker_menu.get_popup().get_current_index():
|
||||
current_hovered = picker_menu.get_popup().get_current_index()
|
||||
|
||||
|
||||
|
||||
if current_hovered == - 1:
|
||||
preview.hide()
|
||||
return
|
||||
var idx_add = 0
|
||||
if allow_dont_change:
|
||||
idx_add -= 1
|
||||
if current_hovered == 0:
|
||||
preview.hide()
|
||||
return
|
||||
if allow_definition and current_hovered == 1:
|
||||
preview.hide()
|
||||
return
|
||||
if allow_definition:
|
||||
idx_add -= 1
|
||||
if not allow_dont_change and current_hovered == 0:
|
||||
preview.hide()
|
||||
return
|
||||
|
||||
|
||||
preview.rect_position.x = picker_menu.get_popup().rect_size.x + 130
|
||||
var current = character_data["portraits"][current_hovered + idx_add]
|
||||
preview_title.text = " " + current["name"]
|
||||
preview_title.icon = null
|
||||
if current["path"]:
|
||||
if current["path"].ends_with(".tscn"):
|
||||
preview_texture.expand = false
|
||||
var editor_reference = find_parent("EditorView")
|
||||
if editor_reference and editor_reference.editor_interface:
|
||||
editor_reference.editor_interface.get_resource_previewer().queue_resource_preview(current["path"], self, "show_scene_preview", null)
|
||||
preview_title.icon = get_icon("PackedScene", "EditorIcons")
|
||||
return
|
||||
else :
|
||||
preview_title.icon = get_icon("Sprite", "EditorIcons")
|
||||
preview_texture.expand = true
|
||||
preview_texture.texture = load(current["path"])
|
||||
else :
|
||||
preview_texture.texture = null
|
||||
preview.show()
|
||||
|
||||
|
||||
func mouse_exited_popup():
|
||||
preview.hide()
|
||||
current_hovered = null
|
||||
|
||||
|
||||
func show_scene_preview(path:String, preview:Texture, user_data):
|
||||
if preview:
|
||||
preview_texture.texture = preview
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,22 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_DefinitionPicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="DefinitionPicker" type="VBoxContainer"]
|
||||
margin_right = 83.0
|
||||
margin_bottom = 22.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
default_text = "Value"
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_right = 98.0
|
||||
margin_bottom = 22.0
|
||||
|
||||
[node name="MenuButton" parent="HBox" instance=ExtResource( 2 )]
|
||||
margin_right = 98.0
|
||||
text = "Definition"
|
|
@ -0,0 +1,79 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
export (String) var default_text = "Select Definition"
|
||||
|
||||
|
||||
onready var picker_menu = $HBox / MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
|
||||
|
||||
picker_menu.custom_icon_modulation = get_color("font_color", "Editor")
|
||||
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/definition.svg")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
select_definition_by_id(data["definition"])
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func select_definition_by_id(id):
|
||||
if id != "":
|
||||
for d in DialogicResources.get_default_definitions()["variables"]:
|
||||
if d["id"] == id:
|
||||
picker_menu.text = d["name"]
|
||||
else :
|
||||
picker_menu.text = default_text
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index, menu):
|
||||
var text = menu.get_item_text(index)
|
||||
var metadata = menu.get_item_metadata(index)
|
||||
picker_menu.text = text
|
||||
|
||||
event_data["definition"] = metadata["file"]
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
|
||||
picker_menu.get_popup().clear()
|
||||
|
||||
build_PickerMenuFolder(picker_menu.get_popup(), DialogicUtil.get_definitions_folder_structure(), "MenuButton")
|
||||
|
||||
|
||||
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
|
||||
var index = 0
|
||||
for folder_name in folder_structure["folders"].keys():
|
||||
var submenu = PopupMenu.new()
|
||||
var submenu_name = build_PickerMenuFolder(submenu, folder_structure["folders"][folder_name], folder_name)
|
||||
submenu.name = submenu_name
|
||||
menu.add_submenu_item(folder_name, submenu_name)
|
||||
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
|
||||
menu.add_child(submenu)
|
||||
picker_menu.update_submenu_style(submenu)
|
||||
index += 1
|
||||
|
||||
|
||||
var files_info = DialogicUtil.get_default_definitions_dict()
|
||||
for file in folder_structure["files"]:
|
||||
if files_info[file]["type"] == 0:
|
||||
menu.add_item(files_info[file]["name"])
|
||||
menu.set_item_icon(index, load("res://addons/dialogic/Images/Resources/definition.svg"))
|
||||
menu.set_item_metadata(index, {"file":file})
|
||||
index += 1
|
||||
|
||||
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
|
||||
menu.connect("index_pressed", self, "_on_PickerMenu_selected", [menu])
|
||||
|
||||
return current_folder_name
|
|
@ -0,0 +1,79 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
export (String) var default_text = "Select Glossary Item"
|
||||
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.custom_icon = get_icon("ListSelect", "EditorIcons")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
select_glossary_by_id(data["glossary_id"])
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func select_glossary_by_id(id):
|
||||
if id != "":
|
||||
for d in DialogicResources.get_default_definitions()["glossary"]:
|
||||
if d["id"] == id:
|
||||
picker_menu.text = d["name"]
|
||||
else :
|
||||
picker_menu.text = default_text
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index, menu):
|
||||
event_data["glossary_id"] = menu.get_item_metadata(index).get("file", "")
|
||||
|
||||
select_glossary_by_id(event_data["glossary_id"])
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
build_PickerMenu()
|
||||
|
||||
func build_PickerMenu():
|
||||
picker_menu.get_popup().clear()
|
||||
var folder_structure = DialogicUtil.get_definitions_folder_structure()
|
||||
|
||||
|
||||
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
|
||||
|
||||
|
||||
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
|
||||
var index = 0
|
||||
|
||||
for folder_name in folder_structure["folders"].keys():
|
||||
var submenu = PopupMenu.new()
|
||||
var submenu_name = build_PickerMenuFolder(submenu, folder_structure["folders"][folder_name], folder_name)
|
||||
submenu.name = submenu_name
|
||||
menu.add_submenu_item(folder_name, submenu_name)
|
||||
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
|
||||
menu.add_child(submenu)
|
||||
picker_menu.update_submenu_style(submenu)
|
||||
index += 1
|
||||
|
||||
var files_info = DialogicUtil.get_default_definitions_dict()
|
||||
for file in folder_structure["files"]:
|
||||
if files_info[file]["type"] == 1:
|
||||
menu.add_item(files_info[file]["name"])
|
||||
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").glossary_icon)
|
||||
menu.set_item_metadata(index, {"file":file})
|
||||
index += 1
|
||||
|
||||
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
|
||||
menu.connect("index_pressed", self, "_on_PickerMenu_selected", [menu])
|
||||
|
||||
return current_folder_name
|
|
@ -0,0 +1,133 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var title_input = $Title / Input
|
||||
onready var title_check = $Title / Check
|
||||
onready var text_input = $Text / Input
|
||||
onready var text_check = $Text / Check
|
||||
onready var extra_input = $Extra / Input
|
||||
onready var extra_check = $Extra / Check
|
||||
|
||||
|
||||
func _ready():
|
||||
title_input.connect("text_changed", self, "_on_TitleField_text_changed")
|
||||
text_input.connect("text_changed", self, "_on_TextField_text_changed")
|
||||
extra_input.connect("text_changed", self, "_on_ExtraField_text_changed")
|
||||
|
||||
title_check.connect("toggled", self, "_on_TitleCheck_toggled")
|
||||
text_check.connect("toggled", self, "_on_TextCheck_toggled")
|
||||
extra_check.connect("toggled", self, "_on_ExtraCheck_toggled")
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
emit_signal("request_set_body_enabled", event_data["glossary_id"] != "")
|
||||
|
||||
$Title.visible = event_data["glossary_id"] != ""
|
||||
$Text.visible = event_data["glossary_id"] != ""
|
||||
$Extra.visible = event_data["glossary_id"] != ""
|
||||
|
||||
if event_data["glossary_id"]:
|
||||
var glossary_default
|
||||
for d in DialogicResources.get_default_definitions()["glossary"]:
|
||||
if d["id"] == event_data["glossary_id"]:
|
||||
glossary_default = d
|
||||
if glossary_default == null:
|
||||
print("[D] The glossary item with id ", event_data["glossary_id"], " cannot be found anymore. The event will be reset.")
|
||||
event_data["glossary_id"] = ""
|
||||
load_data(event_data)
|
||||
return
|
||||
title_input.placeholder_text = glossary_default["title"]
|
||||
text_input.placeholder_text = glossary_default["text"]
|
||||
extra_input.placeholder_text = glossary_default["extra"]
|
||||
|
||||
|
||||
if event_data["title"] == "[No Change]":
|
||||
title_check.pressed = true
|
||||
title_input.text = ""
|
||||
else :
|
||||
title_check.pressed = false
|
||||
title_input.text = event_data["title"]
|
||||
if event_data["text"] == "[No Change]":
|
||||
text_check.pressed = true
|
||||
text_input.text = ""
|
||||
else :
|
||||
text_check.pressed = false
|
||||
text_input.text = event_data["text"]
|
||||
if event_data["extra"] == "[No Change]":
|
||||
extra_check.pressed = true
|
||||
extra_input.text = ""
|
||||
else :
|
||||
extra_check.pressed = false
|
||||
extra_input.text = event_data["extra"]
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
if event_data["glossary_id"]:
|
||||
var text: = ""
|
||||
if event_data["title"] != "[No Change]":
|
||||
text += "Changes title to '" + event_data["title"] + "'. "
|
||||
if event_data["extra"] != "[No Change]":
|
||||
text += "Changes extra to '" + event_data["extra"] + "'. "
|
||||
if event_data["text"] != "[No Change]":
|
||||
text += "Changes text to '" + event_data["text"] + "'. "
|
||||
return text
|
||||
return ""
|
||||
|
||||
func _on_TitleField_text_changed(text):
|
||||
event_data["title"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_TextField_text_changed(text):
|
||||
event_data["text"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ExtraField_text_changed(text):
|
||||
event_data["extra"] = text
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_TitleCheck_toggled(toggle):
|
||||
if toggle:
|
||||
event_data["title"] = "[No Change]"
|
||||
title_input.editable = false
|
||||
else :
|
||||
event_data["title"] = title_input.text
|
||||
title_input.editable = true
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_TextCheck_toggled(toggle):
|
||||
if toggle:
|
||||
event_data["text"] = "[No Change]"
|
||||
text_input.editable = false
|
||||
else :
|
||||
event_data["text"] = text_input.text
|
||||
text_input.editable = true
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ExtraCheck_toggled(toggle):
|
||||
if toggle:
|
||||
event_data["extra"] = "[No Change]"
|
||||
extra_input.editable = false
|
||||
else :
|
||||
event_data["extra"] = extra_input.text
|
||||
extra_input.editable = true
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,27 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_GlossaryPicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="GlossaryPicker" type="HBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
default_text = "Glossary item"
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 3 )]
|
||||
margin_top = 13.0
|
||||
margin_right = 93.0
|
||||
margin_bottom = 27.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Set content of "
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 97.0
|
||||
margin_top = 8.0
|
||||
margin_right = 285.0
|
||||
margin_bottom = 32.0
|
||||
custom_colors/font_color = Color( 0.8, 0.807843, 0.827451, 1 )
|
||||
text = "Select Glossary Item"
|
|
@ -0,0 +1,87 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Definitions/EventPart_SetGlossary.gd" type="Script" id=3]
|
||||
|
||||
[node name="SetGlossary" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_horizontal = 0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Title" type="HBoxContainer" parent="."]
|
||||
margin_right = 331.0
|
||||
margin_bottom = 27.0
|
||||
custom_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="Title"]
|
||||
margin_top = 6.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 20.0
|
||||
rect_min_size = Vector2( 50, 0 )
|
||||
text = "Title:"
|
||||
|
||||
[node name="Input" parent="Title" instance=ExtResource( 1 )]
|
||||
margin_left = 70.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Check" type="CheckBox" parent="Title"]
|
||||
margin_left = 220.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 27.0
|
||||
text = "Don't change"
|
||||
|
||||
[node name="Text" type="HBoxContainer" parent="."]
|
||||
margin_top = 31.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 58.0
|
||||
custom_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="Text"]
|
||||
margin_top = 6.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 20.0
|
||||
rect_min_size = Vector2( 50, 0 )
|
||||
text = "Text:"
|
||||
|
||||
[node name="Input" parent="Text" instance=ExtResource( 1 )]
|
||||
margin_left = 70.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Check" type="CheckBox" parent="Text"]
|
||||
margin_left = 220.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 27.0
|
||||
text = "Don't change"
|
||||
|
||||
[node name="Extra" type="HBoxContainer" parent="."]
|
||||
margin_top = 62.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 89.0
|
||||
custom_constants/separation = 20
|
||||
|
||||
[node name="Label" type="Label" parent="Extra"]
|
||||
margin_top = 6.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 20.0
|
||||
rect_min_size = Vector2( 50, 0 )
|
||||
text = "Extra:"
|
||||
|
||||
[node name="Input" parent="Extra" instance=ExtResource( 1 )]
|
||||
margin_left = 70.0
|
||||
margin_right = 200.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Check" type="CheckBox" parent="Extra"]
|
||||
margin_left = 220.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 27.0
|
||||
text = "Don't change"
|
|
@ -0,0 +1,117 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
export (String, "Audio", "Background", "Scene", "Resource") var Mode = "Background"
|
||||
|
||||
|
||||
onready var file_button = $FileButton
|
||||
onready var clear_button = $ClearButton
|
||||
|
||||
|
||||
var default_color = Color("ccced3")
|
||||
|
||||
|
||||
func _ready():
|
||||
editor_reference = find_parent("EditorView")
|
||||
file_button.connect("pressed", self, "_on_FileButton_pressed")
|
||||
clear_button.connect("pressed", self, "_on_ClearButton_pressed")
|
||||
file_button.add_color_override("font_color", default_color)
|
||||
clear_button.icon = get_icon("Reload", "EditorIcons")
|
||||
$FileButton / icon2.texture = get_icon("GuiSliderGrabber", "EditorIcons")
|
||||
match Mode:
|
||||
"Audio":
|
||||
$Label.text = "Play"
|
||||
$FileButton / icon.texture = get_icon("AudioStreamPlayer", "EditorIcons")
|
||||
"Background":
|
||||
$Label.text = "to"
|
||||
$FileButton / icon.texture = get_icon("Image", "EditorIcons")
|
||||
"Scene":
|
||||
$Label.text = "to"
|
||||
$FileButton / icon.texture = get_icon("PackedScene", "EditorIcons")
|
||||
"Resource":
|
||||
$Label.text = "to"
|
||||
$FileButton / icon.texture = get_icon("PackedScene", "EditorIcons")
|
||||
|
||||
|
||||
|
||||
func load_data(event_data:Dictionary):
|
||||
|
||||
|
||||
.load_data(event_data)
|
||||
|
||||
|
||||
var path
|
||||
file_button.text = ""
|
||||
match Mode:
|
||||
"Audio":
|
||||
path = event_data["file"]
|
||||
if path.empty():
|
||||
file_button.text = "nothing (will stop previous)"
|
||||
"Background":
|
||||
path = event_data["background"]
|
||||
if path.empty():
|
||||
file_button.text = "nothing (will hide previous)"
|
||||
"Scene":
|
||||
path = event_data["change_scene"]
|
||||
if path.empty():
|
||||
file_button.text = "a yet to be selected scene"
|
||||
"Resource":
|
||||
path = event_data["resource_file"]
|
||||
if path.empty():
|
||||
file_button.text = "a yet to be selected resource"
|
||||
if file_button.text.empty():
|
||||
file_button.text = path.get_file()
|
||||
file_button.hint_tooltip = path
|
||||
|
||||
clear_button.visible = not path.empty()
|
||||
|
||||
func _on_FileButton_pressed():
|
||||
match Mode:
|
||||
"Audio":
|
||||
editor_reference.godot_dialog("*.wav, *.ogg, *.mp3")
|
||||
"Background":
|
||||
editor_reference.godot_dialog("*.png, *.jpg, *.jpeg, *.tga, *.svg, *.svgz, *.bmp, *.webp, *.tscn")
|
||||
"Scene":
|
||||
editor_reference.godot_dialog("*.tscn")
|
||||
"Resource":
|
||||
editor_reference.godot_dialog("*.tres, *.res")
|
||||
|
||||
editor_reference.godot_dialog_connect(self, "_on_file_selected")
|
||||
|
||||
func _on_file_selected(path, target):
|
||||
match Mode:
|
||||
"Audio":
|
||||
event_data["file"] = path
|
||||
"Background":
|
||||
event_data["background"] = path
|
||||
"Scene":
|
||||
event_data["change_scene"] = path
|
||||
"Resource":
|
||||
event_data["resource_file"] = path
|
||||
|
||||
clear_button.visible = true
|
||||
file_button.text = path.get_file()
|
||||
file_button.hint_tooltip = path
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
func _on_ClearButton_pressed():
|
||||
match Mode:
|
||||
"Audio":
|
||||
event_data["file"] = ""
|
||||
file_button.text = "nothing (will stop previous)"
|
||||
"Background":
|
||||
event_data["background"] = ""
|
||||
file_button.text = "nothing (will hide previous)"
|
||||
"Scene":
|
||||
event_data["change_scene"] = ""
|
||||
file_button.text = "a yet to be selected scene"
|
||||
"Resource":
|
||||
event_data["resource_file"] = ""
|
||||
file_button.text = "a yet to be selected resource"
|
||||
clear_button.visible = false
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,87 @@
|
|||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonHover.tres" type="StyleBox" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SettingsFieldBackground.tres" type="StyleBox" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/EventPart_FilePicker.gd" type="Script" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SimpleButtonNormal.tres" type="StyleBox" id=7]
|
||||
|
||||
[sub_resource type="Image" id=3]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=2]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 3 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="FilePicker" type="HBoxContainer"]
|
||||
margin_top = 1.0
|
||||
margin_right = 331.0
|
||||
margin_bottom = 23.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 4 )]
|
||||
margin_top = 5.0
|
||||
margin_right = 13.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "to"
|
||||
|
||||
[node name="FileButton" type="Button" parent="."]
|
||||
margin_left = 17.0
|
||||
margin_right = 143.0
|
||||
margin_bottom = 24.0
|
||||
custom_styles/hover = ExtResource( 2 )
|
||||
custom_styles/pressed = ExtResource( 2 )
|
||||
custom_styles/focus = ExtResource( 2 )
|
||||
custom_styles/normal = ExtResource( 2 )
|
||||
text = "none so far"
|
||||
|
||||
[node name="icon" type="TextureRect" parent="FileButton"]
|
||||
margin_left = 4.0
|
||||
margin_top = 5.0
|
||||
margin_right = 23.0
|
||||
margin_bottom = 24.0
|
||||
texture = SubResource( 2 )
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="icon2" type="TextureRect" parent="FileButton"]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -20.9581
|
||||
margin_top = -6.63555
|
||||
margin_right = -5.95807
|
||||
margin_bottom = 8.36445
|
||||
texture = SubResource( 2 )
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ClearButton" type="Button" parent="."]
|
||||
margin_left = 147.0
|
||||
margin_right = 169.0
|
||||
margin_bottom = 24.0
|
||||
rect_min_size = Vector2( 22, 22 )
|
||||
custom_styles/hover = ExtResource( 1 )
|
||||
custom_styles/pressed = ExtResource( 1 )
|
||||
custom_styles/normal = ExtResource( 7 )
|
||||
icon = SubResource( 2 )
|
|
@ -0,0 +1,32 @@
|
|||
tool
|
||||
extends MenuButton
|
||||
|
||||
export (Texture) var custom_icon setget set_custom_icon
|
||||
var custom_icon_modulation setget set_custom_icon_modulation
|
||||
var menu_background
|
||||
|
||||
|
||||
var default_color = Color("ccced3")
|
||||
|
||||
func _ready():
|
||||
menu_background = load("res://addons/dialogic/Editor/Events/styles/ResourceMenuPanelBackground.tres")
|
||||
menu_background.bg_color = get_color("base_color", "Editor")
|
||||
add_color_override("font_color", default_color)
|
||||
update_submenu_style(get_popup())
|
||||
reset_modulation()
|
||||
$Icon2.texture = get_icon("Collapse", "EditorIcons")
|
||||
|
||||
func update_submenu_style(submenu):
|
||||
submenu.add_stylebox_override("panel", menu_background)
|
||||
submenu.add_stylebox_override("hover", StyleBoxEmpty.new())
|
||||
submenu.add_color_override("font_color_hover", get_color("accent_color", "Editor"))
|
||||
|
||||
func set_custom_icon(texture:Texture):
|
||||
$Icon.texture = texture
|
||||
|
||||
func set_custom_icon_modulation(color:Color):
|
||||
$Icon.modulate = color
|
||||
|
||||
func reset_modulation():
|
||||
$Icon.modulate = default_color
|
||||
$Icon2.modulate = default_color
|
|
@ -0,0 +1,66 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/SettingsFieldBackground.tres" type="StyleBox" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="Image" id=3]
|
||||
data = {
|
||||
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
|
||||
"format": "LumAlpha8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id=2]
|
||||
flags = 4
|
||||
flags = 4
|
||||
image = SubResource( 3 )
|
||||
size = Vector2( 16, 16 )
|
||||
|
||||
[node name="MenuButton" type="MenuButton"]
|
||||
margin_right = 98.0
|
||||
margin_bottom = 24.0
|
||||
focus_mode = 2
|
||||
size_flags_vertical = 4
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_styles/hover = ExtResource( 1 )
|
||||
custom_styles/pressed = ExtResource( 1 )
|
||||
custom_styles/normal = ExtResource( 1 )
|
||||
text = "Resource"
|
||||
flat = false
|
||||
align = 0
|
||||
script = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Icon" type="TextureRect" parent="."]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 8.0
|
||||
margin_top = 4.0
|
||||
margin_right = 23.0
|
||||
margin_bottom = -4.0
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Icon2" type="TextureRect" parent="."]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -20.7581
|
||||
margin_top = -8.78745
|
||||
margin_right = -5.75813
|
||||
margin_bottom = 7.21255
|
||||
texture = SubResource( 2 )
|
||||
expand = true
|
||||
stretch_mode = 6
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var file_picker = $FilePicker
|
||||
|
||||
|
||||
func _ready():
|
||||
file_picker.connect("data_changed", self, "_on_ScenePicker_data_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
file_picker.load_data(data)
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_ScenePicker_data_changed(data):
|
||||
event_data = data
|
||||
data_changed()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Scenes/EventPart_ScenePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Files/FilePicker.tscn" type="PackedScene" id=2]
|
||||
|
||||
[node name="ScenePicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FilePicker" parent="." instance=ExtResource( 2 )]
|
||||
margin_top = 0.0
|
||||
margin_right = 199.0
|
||||
margin_bottom = 22.0
|
||||
Mode = "Scene"
|
|
@ -0,0 +1,78 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
export (String) var default_text = "Select Theme"
|
||||
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/theme.svg")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
select_theme()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func select_theme():
|
||||
if event_data["set_theme"] != "":
|
||||
for theme in DialogicUtil.get_theme_list():
|
||||
if theme["file"] == event_data["set_theme"]:
|
||||
picker_menu.text = theme["name"]
|
||||
else :
|
||||
picker_menu.text = default_text
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index, menu):
|
||||
event_data["set_theme"] = menu.get_item_metadata(index).get("file", "")
|
||||
|
||||
select_theme()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
build_PickerMenu()
|
||||
|
||||
func build_PickerMenu():
|
||||
picker_menu.get_popup().clear()
|
||||
var folder_structure = DialogicUtil.get_theme_folder_structure()
|
||||
|
||||
|
||||
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
|
||||
|
||||
|
||||
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
|
||||
var index = 0
|
||||
for folder_name in folder_structure["folders"].keys():
|
||||
var submenu = PopupMenu.new()
|
||||
var submenu_name = build_PickerMenuFolder(submenu, folder_structure["folders"][folder_name], folder_name)
|
||||
submenu.name = submenu_name
|
||||
menu.add_submenu_item(folder_name, submenu_name)
|
||||
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
|
||||
menu.add_child(submenu)
|
||||
picker_menu.update_submenu_style(submenu)
|
||||
index += 1
|
||||
|
||||
var files_info = DialogicUtil.get_theme_dict()
|
||||
for file in folder_structure["files"]:
|
||||
menu.add_item(files_info[file]["name"])
|
||||
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").theme_icon)
|
||||
menu.set_item_metadata(index, {"file":file})
|
||||
index += 1
|
||||
|
||||
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
|
||||
menu.connect("index_pressed", self, "_on_PickerMenu_selected", [menu])
|
||||
|
||||
return current_folder_name
|
|
@ -0,0 +1,29 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Themes/EventPart_ThemePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="ThemePicker" type="HBoxContainer"]
|
||||
margin_right = 157.0
|
||||
margin_bottom = 27.0
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
show_text = true
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 3 )]
|
||||
margin_top = 6.0
|
||||
margin_right = 59.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "to theme"
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 63.0
|
||||
margin_top = 1.0
|
||||
margin_right = 177.0
|
||||
margin_bottom = 25.0
|
||||
custom_colors/font_color = Color( 0.8, 0.807843, 0.827451, 1 )
|
|
@ -0,0 +1,79 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var picker_menu = $MenuButton
|
||||
|
||||
|
||||
func _ready():
|
||||
picker_menu.connect("about_to_show", self, "_on_PickerMenu_about_to_show")
|
||||
picker_menu.custom_icon = load("res://addons/dialogic/Images/Resources/timeline.svg")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
if event_data["change_timeline"] != "":
|
||||
for c in DialogicUtil.get_timeline_list():
|
||||
if c["file"] == event_data["change_timeline"]:
|
||||
picker_menu.text = c["name"]
|
||||
else :
|
||||
picker_menu.text = "Select Timeline"
|
||||
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
|
||||
|
||||
func _on_PickerMenu_selected(index, menu):
|
||||
var text = menu.get_item_text(index)
|
||||
var metadata = menu.get_item_metadata(index)
|
||||
picker_menu.text = text
|
||||
event_data["change_timeline"] = metadata["file"]
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _on_PickerMenu_about_to_show():
|
||||
build_PickerMenu()
|
||||
|
||||
|
||||
func build_PickerMenu():
|
||||
picker_menu.get_popup().clear()
|
||||
var folder_structure = DialogicUtil.get_timelines_folder_structure()
|
||||
|
||||
|
||||
build_PickerMenuFolder(picker_menu.get_popup(), folder_structure, "MenuButton")
|
||||
|
||||
|
||||
|
||||
func build_PickerMenuFolder(menu:PopupMenu, folder_structure:Dictionary, current_folder_name:String):
|
||||
var index = 0
|
||||
for folder_name in folder_structure["folders"].keys():
|
||||
var submenu = PopupMenu.new()
|
||||
var submenu_name = build_PickerMenuFolder(submenu, folder_structure["folders"][folder_name], folder_name)
|
||||
submenu.name = submenu_name
|
||||
menu.add_submenu_item(folder_name, submenu_name)
|
||||
menu.set_item_icon(index, get_icon("Folder", "EditorIcons"))
|
||||
menu.add_child(submenu)
|
||||
picker_menu.update_submenu_style(submenu)
|
||||
index += 1
|
||||
|
||||
var files_info = DialogicUtil.get_timeline_dict()
|
||||
for file in folder_structure["files"]:
|
||||
menu.add_item(files_info[file]["name"])
|
||||
menu.set_item_icon(index, editor_reference.get_node("MainPanel/MasterTreeContainer/MasterTree").timeline_icon)
|
||||
menu.set_item_metadata(index, {"file":file})
|
||||
index += 1
|
||||
|
||||
if not menu.is_connected("index_pressed", self, "_on_PickerMenu_selected"):
|
||||
menu.connect("index_pressed", self, "_on_PickerMenu_selected", [menu])
|
||||
|
||||
return current_folder_name
|
|
@ -0,0 +1,20 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/Timelines/EventPart_TimelinePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/ResourcePickers/ResourcePickerMenu.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="TimelinePicker" type="HBoxContainer"]
|
||||
margin_right = 119.0
|
||||
margin_bottom = 20.0
|
||||
size_flags_vertical = 6
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Label" parent="." instance=ExtResource( 3 )]
|
||||
margin_right = 87.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "Start timeline"
|
||||
|
||||
[node name="MenuButton" parent="." instance=ExtResource( 2 )]
|
||||
margin_left = 91.0
|
||||
margin_right = 185.0
|
8
addons/dialogic/Editor/Events/Parts/SpinBoxPreventDnD.gd
Normal file
8
addons/dialogic/Editor/Events/Parts/SpinBoxPreventDnD.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
tool
|
||||
extends SpinBox
|
||||
|
||||
func can_drop_data(position, data):
|
||||
|
||||
|
||||
|
||||
return false
|
16
addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.gd
Normal file
16
addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.gd
Normal file
|
@ -0,0 +1,16 @@
|
|||
extends LineEdit
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
|
39
addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn
Normal file
39
addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn
Normal file
|
@ -0,0 +1,39 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
content_margin_left = 11.0
|
||||
content_margin_right = 9.0
|
||||
content_margin_top = 5.0
|
||||
content_margin_bottom = 5.0
|
||||
bg_color = Color( 0.12549, 0.141176, 0.192157, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.0980392, 0.113725, 0.152941, 1 )
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[node name="CustomLineEdit" type="LineEdit"]
|
||||
margin_right = 48.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 130, 27 )
|
||||
size_flags_vertical = 6
|
||||
custom_colors/selection_color = Color( 0.345098, 0.345098, 0.345098, 1 )
|
||||
custom_colors/cursor_color = Color( 1, 1, 1, 1 )
|
||||
custom_colors/clear_button_color_pressed = Color( 0.960784, 0.960784, 0.960784, 1 )
|
||||
custom_colors/font_color_selected = Color( 1, 1, 1, 1 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
custom_colors/clear_button_color = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color_uneditable = Color( 0, 0, 0, 1 )
|
||||
custom_styles/read_only = SubResource( 1 )
|
||||
custom_styles/focus = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
expand_to_text_length = true
|
||||
caret_blink = true
|
||||
caret_blink_speed = 0.5
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var input_field = $HBox / InputField
|
||||
|
||||
|
||||
func _ready():
|
||||
input_field.connect("text_changed", self, "_on_InputField_text_changed")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
input_field.text = event_data["emit_signal"]
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
||||
|
||||
func _on_InputField_text_changed(text):
|
||||
event_data["emit_signal"] = text
|
||||
|
||||
|
||||
data_changed()
|
|
@ -0,0 +1,55 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
onready var text_editor = $VBoxContainer / TextEditor
|
||||
onready var voice_editor = $VBoxContainer / VoiceEditor
|
||||
|
||||
|
||||
func _ready()->void :
|
||||
text_editor.connect("data_changed", self, "_on_text_editor_data_changed")
|
||||
voice_editor.connect("data_changed", self, "_on_voice_editor_data_changed")
|
||||
voice_editor.visible = use_voices()
|
||||
voice_editor.editor_reference = editor_reference
|
||||
voice_editor.repopulate()
|
||||
|
||||
|
||||
func load_data(data):
|
||||
.load_data(data)
|
||||
|
||||
text_editor.load_data(data)
|
||||
voice_editor.visible = use_voices()
|
||||
voice_editor.load_data(data)
|
||||
update_voices_lines()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return text_editor.get_preview()
|
||||
|
||||
|
||||
func use_voices():
|
||||
var config = DialogicResources.get_settings_config()
|
||||
return config.get_value("dialog", "text_event_audio_enable", false)
|
||||
|
||||
|
||||
func _on_text_editor_data_changed(data)->void :
|
||||
event_data = data
|
||||
|
||||
|
||||
update_voices_lines()
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func update_voices_lines():
|
||||
var text = text_editor.get_child(0).text
|
||||
voice_editor._on_text_changed(text)
|
||||
|
||||
|
||||
func _on_voice_editor_data_changed(data)->void :
|
||||
event_data["voice_data"] = data["voice_data"]
|
||||
voice_editor.visible = use_voices()
|
||||
|
||||
data_changed()
|
||||
|
||||
func focus():
|
||||
text_editor.focus()
|
130
addons/dialogic/Editor/Events/Parts/Text/EventPart_TextEditor.gd
Normal file
130
addons/dialogic/Editor/Events/Parts/Text/EventPart_TextEditor.gd
Normal file
|
@ -0,0 +1,130 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var text_editor = $TextEdit
|
||||
|
||||
var timeline_area = null
|
||||
var text_gap = 50
|
||||
|
||||
|
||||
func _ready():
|
||||
text_gap = (text_gap * DialogicUtil.get_editor_scale(self))
|
||||
|
||||
|
||||
text_editor.connect("text_changed", self, "_on_TextEditor_text_changed")
|
||||
text_editor.connect("focus_entered", self, "_on_TextEditor_focus_entered")
|
||||
|
||||
|
||||
text_editor.syntax_highlighting = true
|
||||
text_editor.add_color_region("[", "]", get_color("axis_z_color", "Editor"))
|
||||
text_editor.set("custom_colors/number_color", get_color("font_color", "Editor"))
|
||||
text_editor.set("custom_colors/function_color", get_color("font_color", "Editor"))
|
||||
text_editor.set("custom_colors/member_variable_color", get_color("font_color", "Editor"))
|
||||
text_editor.set("custom_colors/symbol_color", get_color("font_color", "Editor"))
|
||||
|
||||
timeline_area = find_parent("TimelineArea")
|
||||
timeline_area.connect("resized", self, "_set_new_min_size")
|
||||
_set_new_min_size()
|
||||
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
|
||||
if data["event_id"] == "dialogic_001":
|
||||
text_editor.text = event_data["text"]
|
||||
|
||||
elif data["event_id"] == "dialogic_010":
|
||||
text_editor.text = event_data["question"]
|
||||
|
||||
else :
|
||||
text_editor.text = event_data["text"]
|
||||
|
||||
|
||||
_set_new_min_size()
|
||||
|
||||
|
||||
func get_preview():
|
||||
var max_preview_characters = 35
|
||||
var text = ""
|
||||
if event_data["event_id"] == "dialogic_001":
|
||||
text = event_data["text"]
|
||||
|
||||
elif event_data["event_id"] == "dialogic_010":
|
||||
text = event_data["question"]
|
||||
|
||||
else :
|
||||
text = event_data["text"]
|
||||
text = text.replace("\n", "[br]")
|
||||
var preview = text.substr(0, min(max_preview_characters, len(text)))
|
||||
if (len(text) > max_preview_characters):
|
||||
preview += "..."
|
||||
|
||||
return preview
|
||||
|
||||
func _on_TextEditor_text_changed():
|
||||
|
||||
if event_data["event_id"] == "dialogic_001":
|
||||
event_data["text"] = text_editor.text
|
||||
|
||||
elif event_data["event_id"] == "dialogic_010":
|
||||
event_data["question"] = text_editor.text
|
||||
|
||||
else :
|
||||
event_data["text"] = text_editor.text
|
||||
_set_new_min_size()
|
||||
|
||||
|
||||
data_changed()
|
||||
|
||||
|
||||
func _set_new_min_size():
|
||||
|
||||
text_editor.rect_min_size = Vector2(0, 0)
|
||||
|
||||
var extra_vertical = 1.1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var count_wrapped_lines = 0
|
||||
var longest_string = ""
|
||||
for l in text_editor.text.split("\n"):
|
||||
if l.length() > longest_string.length():
|
||||
longest_string = l
|
||||
if get_font("normal_font").get_string_size(l).x > get_max_x_size():
|
||||
count_wrapped_lines += get_font("normal_font").get_string_size(l).x / (get_max_x_size())
|
||||
|
||||
|
||||
if text_editor.get_line_count() > 1:
|
||||
extra_vertical = 1.22
|
||||
text_editor.rect_min_size.y = get_font("normal_font").get_height() * ((text_editor.get_line_count() + 1 + count_wrapped_lines) * extra_vertical)
|
||||
|
||||
|
||||
text_editor.rect_min_size.x = get_font("normal_font").get_string_size(longest_string).x + text_gap
|
||||
if text_editor.rect_min_size.x > get_max_x_size():
|
||||
text_editor.rect_min_size.x = get_max_x_size()
|
||||
|
||||
func get_max_x_size():
|
||||
return timeline_area.rect_size.x - (text_editor.rect_global_position.x - timeline_area.rect_global_position.x) - text_gap
|
||||
|
||||
func _on_TextEditor_focus_entered()->void :
|
||||
if (Input.is_mouse_button_pressed(BUTTON_LEFT)):
|
||||
emit_signal("request_selection")
|
||||
|
||||
|
||||
func _on_TextEdit_focus_exited():
|
||||
|
||||
|
||||
$TextEdit.deselect()
|
||||
|
||||
func focus():
|
||||
$TextEdit.grab_focus()
|
5
addons/dialogic/Editor/Events/Parts/Text/GreyLabel.gd
Normal file
5
addons/dialogic/Editor/Events/Parts/Text/GreyLabel.gd
Normal file
|
@ -0,0 +1,5 @@
|
|||
tool
|
||||
extends Label
|
||||
|
||||
func _ready():
|
||||
add_color_override("font_color", get_color("contrast_color_2", "Editor"))
|
13
addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn
Normal file
13
addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn
Normal file
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.gd" type="Script" id=1]
|
||||
|
||||
[node name="Label" type="Label"]
|
||||
margin_top = 4.0
|
||||
margin_right = 78.0
|
||||
margin_bottom = 18.0
|
||||
text = "with portrait"
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/CustomLineEdit.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_SignalArgumentPicker.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="SignalArgumentPicker" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 6
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBox" type="HBoxContainer" parent="."]
|
||||
margin_top = 6.0
|
||||
margin_right = 361.0
|
||||
margin_bottom = 33.0
|
||||
size_flags_vertical = 6
|
||||
|
||||
[node name="Label" parent="HBox" instance=ExtResource( 3 )]
|
||||
margin_top = 6.0
|
||||
margin_right = 227.0
|
||||
margin_bottom = 20.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "'dialogic_signal' with the argument "
|
||||
|
||||
[node name="InputField" parent="HBox" instance=ExtResource( 1 )]
|
||||
margin_left = 231.0
|
||||
margin_right = 361.0
|
||||
margin_bottom = 27.0
|
|
@ -0,0 +1,26 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_TextAndVoicePicker.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Audio/VoiceEditor.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/TextEditor.tscn" type="PackedScene" id=3]
|
||||
|
||||
[node name="TextAndVoiceEditor" type="VBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 15.0
|
||||
|
||||
[node name="TextEditor" parent="VBoxContainer" instance=ExtResource( 3 )]
|
||||
margin_bottom = 15.0
|
||||
|
||||
[node name="VoiceEditor" parent="VBoxContainer" instance=ExtResource( 2 )]
|
||||
visible = false
|
||||
margin_top = 4.0
|
||||
margin_right = 358.0
|
||||
margin_bottom = 44.0
|
44
addons/dialogic/Editor/Events/Parts/Text/TextEditor.tscn
Normal file
44
addons/dialogic/Editor/Events/Parts/Text/TextEditor.tscn
Normal file
|
@ -0,0 +1,44 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/EventPart_TextEditor.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/TextBackground.tres" type="StyleBox" id=2]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=3]
|
||||
content_margin_left = 16.0
|
||||
content_margin_top = 14.0
|
||||
bg_color = Color( 0.27451, 0.27451, 0.27451, 1 )
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color( 0.192157, 0.666667, 1, 1 )
|
||||
corner_radius_top_left = 8
|
||||
corner_radius_top_right = 8
|
||||
corner_radius_bottom_right = 8
|
||||
corner_radius_bottom_left = 8
|
||||
|
||||
[node name="TextEditor" type="HBoxContainer"]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="."]
|
||||
margin_right = 17.0
|
||||
margin_bottom = 40.0
|
||||
size_flags_vertical = 3
|
||||
custom_colors/member_variable_color = Color( 0, 0, 0, 1 )
|
||||
custom_colors/function_color = Color( 0, 0, 0, 1 )
|
||||
custom_colors/symbol_color = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color = Color( 1, 1, 1, 1 )
|
||||
custom_colors/number_color = Color( 0, 0, 0, 1 )
|
||||
custom_styles/focus = SubResource( 3 )
|
||||
custom_styles/normal = ExtResource( 2 )
|
||||
syntax_highlighting = true
|
||||
show_line_numbers = true
|
||||
smooth_scrolling = true
|
||||
wrap_enabled = true
|
||||
|
||||
[connection signal="focus_exited" from="TextEdit" to="." method="_on_TextEdit_focus_exited"]
|
|
@ -0,0 +1,49 @@
|
|||
tool
|
||||
extends "res://addons/dialogic/Editor/Events/Parts/EventPart.gd"
|
||||
|
||||
|
||||
|
||||
|
||||
onready var seconds_selector = $HBoxContainer / SecondsBox
|
||||
onready var skippable_selector = $HBoxContainer / SkippableCheckbox
|
||||
onready var hideBox_selector = $HBoxContainer / HideDialogBoxCheckbox
|
||||
|
||||
|
||||
func _ready():
|
||||
seconds_selector.connect("value_changed", self, "_on_SecondsSelector_value_changed")
|
||||
skippable_selector.connect("toggled", self, "_on_SkippableSelector_toggled")
|
||||
hideBox_selector.connect("toggled", self, "_on_HideDialogBox_toggled")
|
||||
|
||||
|
||||
func load_data(data:Dictionary):
|
||||
|
||||
.load_data(data)
|
||||
|
||||
|
||||
seconds_selector.value = event_data["wait_seconds"]
|
||||
skippable_selector.pressed = event_data.get("waiting_skippable", false)
|
||||
hideBox_selector.pressed = event_data.get("hide_dialogbox", true)
|
||||
if event_data["wait_seconds"] == 1:
|
||||
$HBoxContainer / Label2.text = "second"
|
||||
else :
|
||||
$HBoxContainer / Label2.text = "seconds"
|
||||
|
||||
func _on_SecondsSelector_value_changed(value):
|
||||
event_data["wait_seconds"] = value
|
||||
if value == 1:
|
||||
$HBoxContainer / Label2.text = "second"
|
||||
else :
|
||||
$HBoxContainer / Label2.text = "seconds"
|
||||
data_changed()
|
||||
|
||||
func _on_SkippableSelector_toggled(checkbox_value):
|
||||
event_data["waiting_skippable"] = checkbox_value
|
||||
data_changed()
|
||||
|
||||
func _on_HideDialogBox_toggled(checkbox_value):
|
||||
event_data["hide_dialogbox"] = checkbox_value
|
||||
data_changed()
|
||||
|
||||
|
||||
func get_preview():
|
||||
return ""
|
|
@ -0,0 +1,59 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/WaitSeconds/EventPart_WaitSeconds.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/Text/GreyLabel.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/styles/InputFieldsStyle.tres" type="Theme" id=3]
|
||||
[ext_resource path="res://addons/dialogic/Editor/Events/Parts/SpinBoxPreventDnD.gd" type="Script" id=4]
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer"]
|
||||
size_flags_vertical = 4
|
||||
theme = ExtResource( 3 )
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
margin_right = 377.0
|
||||
margin_bottom = 24.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label" parent="HBoxContainer" instance=ExtResource( 2 )]
|
||||
margin_top = 5.0
|
||||
margin_right = 17.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "for"
|
||||
|
||||
[node name="SecondsBox" type="SpinBox" parent="HBoxContainer"]
|
||||
margin_left = 21.0
|
||||
margin_right = 97.0
|
||||
margin_bottom = 24.0
|
||||
min_value = 0.1
|
||||
step = 0.1
|
||||
value = 1.0
|
||||
allow_greater = true
|
||||
align = 1
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="Label2" parent="HBoxContainer" instance=ExtResource( 2 )]
|
||||
margin_left = 101.0
|
||||
margin_top = 5.0
|
||||
margin_right = 154.0
|
||||
margin_bottom = 19.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "seconds"
|
||||
|
||||
[node name="SkippableCheckbox" type="CheckBox" parent="HBoxContainer"]
|
||||
margin_left = 158.0
|
||||
margin_right = 247.0
|
||||
margin_bottom = 24.0
|
||||
text = "Skippable"
|
||||
|
||||
[node name="HideDialogBoxCheckbox" type="CheckBox" parent="HBoxContainer"]
|
||||
margin_left = 251.0
|
||||
margin_right = 377.0
|
||||
margin_bottom = 24.0
|
||||
text = "Hide DialogBox"
|
Loading…
Add table
Add a link
Reference in a new issue