diff --git a/Main.gd b/Main.gd
index bae9f02..c86d5fb 100644
--- a/Main.gd
+++ b/Main.gd
@@ -4,10 +4,11 @@ extends Node
# Called when the node enters the scene tree for the first time.
func _ready():
- var new_dialog = Dialogic.start('_start')
- add_child(new_dialog)
- new_dialog.connect('dialogic_signal', self, "_on_Dialogic_signal_received")
- new_dialog.connect('event_end', self, "_on_Dialogic_event_end")
+ pass
+# var new_dialog = Dialogic.start('_start')
+# add_child(new_dialog)
+# new_dialog.connect('dialogic_signal', self, "_on_Dialogic_signal_received")
+# new_dialog.connect('event_end', self, "_on_Dialogic_event_end")
func _on_Dialogic_signal_received(value: String):
diff --git a/Main.tscn b/Main.tscn
index 3b62b0a..74a72dc 100644
--- a/Main.tscn
+++ b/Main.tscn
@@ -1,6 +1,13 @@
-[gd_scene load_steps=2 format=2]
+[gd_scene load_steps=4 format=2]
[ext_resource path="res://Main.gd" type="Script" id=1]
+[ext_resource path="res://addons/dialogic/Dialog.tscn" type="PackedScene" id=2]
+[ext_resource path="res://UI.tscn" type="PackedScene" id=3]
[node name="Main" type="Node"]
script = ExtResource( 1 )
+
+[node name="DialogNode" parent="." instance=ExtResource( 2 )]
+timeline = "timeline-1616659306.json"
+
+[node name="UI" parent="." instance=ExtResource( 3 )]
diff --git a/UI.tscn b/UI.tscn
new file mode 100644
index 0000000..ea02ea0
--- /dev/null
+++ b/UI.tscn
@@ -0,0 +1,17 @@
+[gd_scene format=2]
+
+[node name="UI" type="Control"]
+anchor_right = 1.0
+anchor_bottom = 1.0
+mouse_filter = 2
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Label" type="Label" parent="."]
+anchor_right = 1.0
+anchor_bottom = 1.0
+text = "UI"
+__meta__ = {
+"_edit_use_anchors_": false
+}
diff --git a/addons/dialogic/Dialog.tscn b/addons/dialogic/Dialog.tscn
index 0d77a78..7364e2a 100644
--- a/addons/dialogic/Dialog.tscn
+++ b/addons/dialogic/Dialog.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=10 format=2]
+[gd_scene load_steps=12 format=2]
[ext_resource path="res://addons/dialogic/Images/next-indicator.png" type="Texture" id=1]
[ext_resource path="res://addons/dialogic/Images/background/background-2.png" type="Texture" id=2]
@@ -6,9 +6,11 @@
[ext_resource path="res://addons/dialogic/Fonts/GlossaryFont.tres" type="DynamicFont" id=4]
[ext_resource path="res://addons/dialogic/Nodes/glossary_info.gd" type="Script" id=5]
[ext_resource path="res://addons/dialogic/Nodes/dialog_node.gd" type="Script" id=6]
+[ext_resource path="res://addons/dialogic/Nodes/BackgroundMusic.tscn" type="PackedScene" id=7]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 1, 1, 1, 0 )
+expand_margin_left = 10.0
[sub_resource type="Animation" id=2]
loop = true
@@ -26,6 +28,12 @@ tracks/0/keys = {
}
[sub_resource type="StyleBoxFlat" id=3]
+content_margin_left = 10.0
+content_margin_right = 10.0
+bg_color = Color( 1, 1, 1, 0 )
+expand_margin_left = 10.0
+
+[sub_resource type="StyleBoxFlat" id=4]
bg_color = Color( 0.196078, 0.196078, 0.196078, 0 )
[node name="DialogNode" type="Control"]
@@ -65,20 +73,19 @@ margin_top = -207.0
margin_right = 455.0
margin_bottom = -40.0
__meta__ = {
-"_edit_group_": true,
"_edit_use_anchors_": false
}
[node name="ColorRect" type="ColorRect" parent="TextBubble"]
-visible = false
anchor_right = 1.0
anchor_bottom = 1.0
-color = Color( 0, 0, 0, 1 )
+color = Color( 0, 0, 0, 0.639216 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="TextBubble"]
+visible = false
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 2 )
@@ -98,8 +105,8 @@ margin_bottom = -10.0
rect_clip_content = false
custom_styles/normal = SubResource( 1 )
custom_fonts/normal_font = ExtResource( 3 )
-custom_colors/default_color = Color( 0.756863, 0.172549, 0.172549, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 0.619608 )
+custom_colors/default_color = Color( 1, 1, 1, 1 )
+custom_colors/font_color_shadow = Color( 1, 1, 1, 0 )
custom_constants/shadow_offset_x = 2
custom_constants/shadow_offset_y = 2
bbcode_enabled = true
@@ -133,22 +140,43 @@ __meta__ = {
autoplay = "IDLE"
anims/IDLE = SubResource( 2 )
-[node name="NameLabel" type="RichTextLabel" parent="TextBubble"]
-margin_left = 2.0
-margin_top = -37.0
-margin_right = 369.0
-rect_clip_content = false
-custom_styles/normal = SubResource( 1 )
-custom_fonts/normal_font = ExtResource( 3 )
-custom_colors/default_color = Color( 0.756863, 0.172549, 0.172549, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 0.619608 )
+[node name="NameLabel" type="Label" parent="TextBubble"]
+margin_top = -40.0
+margin_right = 58.0
+size_flags_vertical = 1
+custom_styles/normal = SubResource( 3 )
+custom_fonts/font = ExtResource( 3 )
+custom_colors/font_color = Color( 1, 1, 1, 1 )
+custom_colors/font_color_shadow = Color( 1, 1, 1, 0 )
custom_constants/shadow_offset_x = 2
custom_constants/shadow_offset_y = 2
-custom_constants/shadow_as_outline = 10
-bbcode_enabled = true
-bbcode_text = "Name Here"
-text = "Name Here"
-scroll_active = false
+align = 1
+valign = 1
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="ColorRect" type="ColorRect" parent="TextBubble/NameLabel"]
+show_behind_parent = true
+anchor_right = 1.0
+anchor_bottom = 1.0
+size_flags_horizontal = 15
+size_flags_vertical = 15
+color = Color( 0, 0, 0, 0.721569 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="TextureRect" type="TextureRect" parent="TextBubble/NameLabel"]
+visible = false
+show_behind_parent = true
+anchor_right = 1.0
+anchor_bottom = 1.0
+size_flags_horizontal = 3
+size_flags_vertical = 3
+texture = ExtResource( 2 )
+expand = true
+stretch_mode = 1
__meta__ = {
"_edit_use_anchors_": false
}
@@ -213,13 +241,15 @@ __meta__ = {
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="FX"]
+[node name="BackgroundMusic" parent="FX" instance=ExtResource( 7 )]
+
[node name="DefinitionInfo" type="PanelContainer" parent="."]
visible = false
margin_right = 208.0
mouse_filter = 1
size_flags_horizontal = 3
size_flags_vertical = 3
-custom_styles/panel = SubResource( 3 )
+custom_styles/panel = SubResource( 4 )
script = ExtResource( 5 )
__meta__ = {
"_edit_group_": true,
diff --git a/addons/dialogic/Editor/MasterTree/MasterTree.gd b/addons/dialogic/Editor/MasterTree/MasterTree.gd
index be0b7a4..423f93a 100644
--- a/addons/dialogic/Editor/MasterTree/MasterTree.gd
+++ b/addons/dialogic/Editor/MasterTree/MasterTree.gd
@@ -12,6 +12,9 @@ onready var empty_editor = get_node('../Empty')
onready var tree = self
var timeline_icon = load("res://addons/dialogic/Images/timeline.svg")
var character_icon = load("res://addons/dialogic/Images/character.svg")
+var theme_icon = load("res://addons/dialogic/Images/Resources/theme.svg")
+var definition_icon = load("res://addons/dialogic/Images/Resources/definition.svg")
+var glossary_icon = load("res://addons/dialogic/Images/Resources/glossary.svg")
var timelines_tree
var characters_tree
var definitions_tree
@@ -115,7 +118,7 @@ func build_themes(selected_item: String=''):
func _add_theme(theme_item, select = false):
var item = tree.create_item(themes_tree)
- item.set_icon(0, get_icon("StyleBoxTexture", "EditorIcons"))
+ item.set_icon(0, theme_icon)
item.set_text(0, theme_item['name'])
theme_item['editor'] = 'Theme'
item.set_metadata(0, theme_item)
@@ -156,9 +159,9 @@ func build_definitions(selected_item: String=''):
func _add_definition(definition, select = false):
var item = tree.create_item(definitions_tree)
item.set_text(0, definition['name'])
- item.set_icon(0, get_icon("Variant", "EditorIcons"))
+ item.set_icon(0, definition_icon)
if definition['type'] == 1:
- item.set_icon(0, get_icon("ScriptCreateDialog", "EditorIcons"))
+ item.set_icon(0, glossary_icon)
definition['editor'] = 'Definition'
item.set_metadata(0, definition)
diff --git a/addons/dialogic/Editor/Pieces/AudioBlock.gd b/addons/dialogic/Editor/Pieces/AudioBlock.gd
index 7b16aed..a267160 100644
--- a/addons/dialogic/Editor/Pieces/AudioBlock.gd
+++ b/addons/dialogic/Editor/Pieces/AudioBlock.gd
@@ -1,5 +1,5 @@
tool
-extends Control
+extends HBoxContainer
var editor_reference
var editorPopup
@@ -9,11 +9,14 @@ var stop_icon = load("res://addons/dialogic/Images/stop.svg")
# This is the information of this event and it will get parsed and saved to the JSON file.
var event_data = {
- 'audio': 'play',
+ 'audio': 'stop',
'file': ''
}
+func _ready():
+ load_audio('')
+
func _on_ButtonAudio_pressed():
editor_reference.godot_dialog("*.wav, *.ogg, *.mp3")
editor_reference.godot_dialog_connect(self, "_on_file_selected")
@@ -23,16 +26,24 @@ func _on_file_selected(path, target):
target.load_audio(path)
-func load_audio(path):
- $PanelContainer/VBoxContainer/Header/Name.text = path
- $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = false
- event_data['file'] = path
+func load_audio(path: String):
+ if not path.empty():
+ $PanelContainer/VBoxContainer/Header/Name.text = path
+ $PanelContainer/VBoxContainer/Header/ButtonClear.disabled = false
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = false
+ event_data['file'] = path
+ event_data['audio'] = 'play'
+ else:
+ $PanelContainer/VBoxContainer/Header/Name.text = 'No sound (will stop previous audio event)'
+ $PanelContainer/VBoxContainer/Header/ButtonClear.disabled = true
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = true
+ event_data['file'] = ''
+ event_data['audio'] = 'stop'
func load_data(data):
event_data = data
- if data['file'] != '':
- load_audio(data['file'])
+ load_audio(data['file'])
func _on_ButtonPreviewPlay_pressed():
@@ -46,3 +57,7 @@ func _on_ButtonPreviewPlay_pressed():
func _on_AudioPreview_finished():
$PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.icon = play_icon
+
+
+func _on_ButtonClear_pressed():
+ load_audio('')
diff --git a/addons/dialogic/Editor/Pieces/AudioBlock.tscn b/addons/dialogic/Editor/Pieces/AudioBlock.tscn
index 779fc50..b4ca512 100644
--- a/addons/dialogic/Editor/Pieces/AudioBlock.tscn
+++ b/addons/dialogic/Editor/Pieces/AudioBlock.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=8 format=2]
+[gd_scene load_steps=9 format=2]
[ext_resource path="res://addons/dialogic/Editor/Pieces/AudioBlock.gd" type="Script" id=1]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/Spacer.tscn" type="PackedScene" id=2]
@@ -6,6 +6,7 @@
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/dialogic/Images/play.svg" type="Texture" id=5]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=6]
+[ext_resource path="res://addons/dialogic/Images/Remove.svg" type="Texture" id=7]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 16.0
@@ -83,9 +84,16 @@ margin_right = 115.0
margin_bottom = 28.0
text = "..."
-[node name="ButtonPreviewPlay" type="Button" parent="PanelContainer/VBoxContainer/Header"]
+[node name="ButtonClear" type="Button" parent="PanelContainer/VBoxContainer/Header"]
margin_left = 119.0
-margin_right = 153.0
+margin_right = 147.0
+margin_bottom = 28.0
+disabled = true
+icon = ExtResource( 7 )
+
+[node name="ButtonPreviewPlay" type="Button" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 151.0
+margin_right = 185.0
margin_bottom = 28.0
disabled = true
icon = ExtResource( 5 )
@@ -100,7 +108,7 @@ custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
text = " ..."
[node name="Spacer" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 2 )]
-margin_left = 157.0
+margin_left = 189.0
margin_right = 1735.0
margin_bottom = 28.0
@@ -114,5 +122,6 @@ items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down",
[node name="DragController" parent="." instance=ExtResource( 6 )]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonAudio" to="." method="_on_ButtonAudio_pressed"]
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonClear" to="." method="_on_ButtonClear_pressed"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonPreviewPlay" to="." method="_on_ButtonPreviewPlay_pressed"]
[connection signal="finished" from="PanelContainer/AudioPreview" to="." method="_on_AudioPreview_finished"]
diff --git a/addons/dialogic/Editor/Pieces/BackgroundMusic.gd b/addons/dialogic/Editor/Pieces/BackgroundMusic.gd
new file mode 100644
index 0000000..e4fcd52
--- /dev/null
+++ b/addons/dialogic/Editor/Pieces/BackgroundMusic.gd
@@ -0,0 +1,63 @@
+tool
+extends HBoxContainer
+
+var editor_reference
+var editorPopup
+
+var play_icon = load("res://addons/dialogic/Images/play.svg")
+var stop_icon = load("res://addons/dialogic/Images/stop.svg")
+
+# This is the information of this event and it will get parsed and saved to the JSON file.
+var event_data = {
+ 'background-music': 'stop',
+ 'file': ''
+}
+
+
+func _ready():
+ load_audio('')
+
+func _on_ButtonAudio_pressed():
+ editor_reference.godot_dialog("*.wav, *.ogg, *.mp3")
+ editor_reference.godot_dialog_connect(self, "_on_file_selected")
+
+
+func _on_file_selected(path, target):
+ target.load_audio(path)
+
+
+func load_audio(path: String):
+ if not path.empty():
+ $PanelContainer/VBoxContainer/Header/Name.text = path
+ $PanelContainer/VBoxContainer/Header/ButtonClear.disabled = false
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = false
+ event_data['file'] = path
+ event_data['background-music'] = 'play'
+ else:
+ $PanelContainer/VBoxContainer/Header/Name.text = 'No music (will stop with fade out)'
+ $PanelContainer/VBoxContainer/Header/ButtonClear.disabled = true
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.disabled = true
+ event_data['file'] = ''
+ event_data['background-music'] = 'stop'
+
+
+func load_data(data):
+ event_data = data
+ load_audio(data['file'])
+
+
+func _on_ButtonPreviewPlay_pressed():
+ if $PanelContainer/AudioPreview.is_playing():
+ $PanelContainer/AudioPreview.stop()
+ else:
+ $PanelContainer/AudioPreview.stream = load(event_data['file'])
+ $PanelContainer/AudioPreview.play()
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.icon = stop_icon
+
+
+func _on_AudioPreview_finished():
+ $PanelContainer/VBoxContainer/Header/ButtonPreviewPlay.icon = play_icon
+
+
+func _on_ButtonClear_pressed():
+ load_audio('')
diff --git a/addons/dialogic/Editor/Pieces/BackgroundMusic.tscn b/addons/dialogic/Editor/Pieces/BackgroundMusic.tscn
new file mode 100644
index 0000000..67ec67b
--- /dev/null
+++ b/addons/dialogic/Editor/Pieces/BackgroundMusic.tscn
@@ -0,0 +1,128 @@
+[gd_scene load_steps=9 format=2]
+
+[ext_resource path="res://addons/dialogic/Editor/Pieces/BackgroundMusic.gd" type="Script" id=1]
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/Spacer.tscn" type="PackedScene" id=2]
+[ext_resource path="res://addons/dialogic/Images/audio-event.svg" type="Texture" id=3]
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
+[ext_resource path="res://addons/dialogic/Images/play.svg" type="Texture" id=5]
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=6]
+[ext_resource path="res://addons/dialogic/Images/Remove.svg" type="Texture" id=7]
+
+[sub_resource type="StyleBoxFlat" id=1]
+content_margin_left = 16.0
+content_margin_right = 6.0
+content_margin_top = 6.0
+content_margin_bottom = 6.0
+bg_color = Color( 0.298039, 0.172549, 0.14902, 0.447059 )
+border_width_left = 2
+border_width_top = 2
+border_width_right = 2
+border_width_bottom = 2
+border_color = Color( 0.12549, 0.12549, 0.12549, 1 )
+corner_radius_top_left = 6
+corner_radius_top_right = 6
+corner_radius_bottom_right = 6
+corner_radius_bottom_left = 6
+
+[node name="BackgroundMusic" type="HBoxContainer"]
+margin_right = 1798.0
+margin_bottom = 42.0
+size_flags_horizontal = 3
+size_flags_vertical = 9
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Indent" type="Control" parent="."]
+visible = false
+margin_left = 6.0
+margin_top = 6.0
+margin_right = 1792.0
+margin_bottom = 36.0
+
+[node name="PanelContainer" type="PanelContainer" parent="."]
+margin_right = 1798.0
+margin_bottom = 42.0
+mouse_filter = 1
+size_flags_horizontal = 3
+custom_styles/panel = SubResource( 1 )
+
+[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
+margin_left = 16.0
+margin_top = 6.0
+margin_right = 1792.0
+margin_bottom = 36.0
+size_flags_horizontal = 3
+
+[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
+margin_right = 1776.0
+margin_bottom = 28.0
+
+[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/Header"]
+margin_right = 22.0
+margin_bottom = 28.0
+texture = ExtResource( 3 )
+stretch_mode = 6
+
+[node name="Title" type="Label" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 26.0
+margin_top = 7.0
+margin_right = 150.0
+margin_bottom = 21.0
+text = " Background Music"
+
+[node name="Name" type="Label" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 154.0
+margin_top = 7.0
+margin_right = 188.0
+margin_bottom = 21.0
+text = "None"
+
+[node name="ButtonAudio" type="Button" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 192.0
+margin_right = 216.0
+margin_bottom = 28.0
+text = "..."
+
+[node name="ButtonClear" type="Button" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 220.0
+margin_right = 248.0
+margin_bottom = 28.0
+disabled = true
+icon = ExtResource( 7 )
+
+[node name="ButtonPreviewPlay" type="Button" parent="PanelContainer/VBoxContainer/Header"]
+margin_left = 252.0
+margin_right = 286.0
+margin_bottom = 28.0
+disabled = true
+icon = ExtResource( 5 )
+
+[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
+visible = false
+margin_left = 103.0
+margin_top = 8.0
+margin_right = 131.0
+margin_bottom = 22.0
+custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
+text = " ..."
+
+[node name="Spacer" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 2 )]
+margin_left = 290.0
+margin_right = 1735.0
+margin_bottom = 28.0
+
+[node name="OptionButton" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 4 )]
+margin_left = 1739.0
+margin_right = 1776.0
+margin_bottom = 28.0
+items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", true, "Remove", null, 0, false, false, 3, 0, null, "", false ]
+
+[node name="AudioPreview" type="AudioStreamPlayer" parent="PanelContainer"]
+
+[node name="DragController" parent="." instance=ExtResource( 6 )]
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonAudio" to="." method="_on_ButtonAudio_pressed"]
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonClear" to="." method="_on_ButtonClear_pressed"]
+[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/ButtonPreviewPlay" to="." method="_on_ButtonPreviewPlay_pressed"]
+[connection signal="finished" from="PanelContainer/AudioPreview" to="." method="_on_AudioPreview_finished"]
diff --git a/addons/dialogic/Editor/Pieces/Common/OperationPicker.gd b/addons/dialogic/Editor/Pieces/Common/OperationPicker.gd
new file mode 100644
index 0000000..7444688
--- /dev/null
+++ b/addons/dialogic/Editor/Pieces/Common/OperationPicker.gd
@@ -0,0 +1,54 @@
+tool
+extends MenuButton
+
+var options = [
+ {
+ "text": "[ To be ]",
+ "operation": "="
+ },
+ {
+ "text": "[ add ]",
+ "operation": "+"
+ },
+ {
+ "text": "[ remove ]",
+ "operation": "-"
+ },
+ {
+ "text": "[ multiply by ]",
+ "operation": "*"
+ },
+ {
+ "text": "[ divide by ]",
+ "operation": "/"
+ },
+]
+
+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['operation'] == condition):
+ text = o['text']
+ else:
+ text = options[0]['text']
diff --git a/addons/dialogic/Editor/Pieces/Common/OperationPicker.tscn b/addons/dialogic/Editor/Pieces/Common/OperationPicker.tscn
new file mode 100644
index 0000000..8620076
--- /dev/null
+++ b/addons/dialogic/Editor/Pieces/Common/OperationPicker.tscn
@@ -0,0 +1,13 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/OperationPicker.gd" type="Script" id=1]
+
+[node name="OperationPicker" type="MenuButton"]
+margin_left = 284.0
+margin_right = 296.0
+margin_bottom = 28.0
+text = "[ To be ]"
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
diff --git a/addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd b/addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd
index b008c26..213e32a 100644
--- a/addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd
+++ b/addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.gd
@@ -12,14 +12,17 @@ func _ready():
func _on_OptionSelected(index):
+ var timeline_editor = current_piece.editor_reference.get_node('MainPanel/TimelineEditor')
if index == 0:
# Moving this up
- current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'up')
+ timeline_editor.move_block(current_piece, 'up')
elif index == 1:
# Moving piece down
- current_piece.editor_reference.get_node('MainPanel/TimelineEditor').move_block(current_piece, 'down')
+ timeline_editor.move_block(current_piece, 'down')
elif index == 3:
# Removing a piece
+ if timeline_editor.selected_item == current_piece:
+ timeline_editor.selected_item = null
# TODO: Add a warning here if the event has changes
current_piece.queue_free()
- current_piece.editor_reference.get_node('MainPanel/TimelineEditor').indent_events()
+ timeline_editor.indent_events()
diff --git a/addons/dialogic/Editor/Pieces/SetValue.gd b/addons/dialogic/Editor/Pieces/SetValue.gd
index 9e4bd16..831fe1d 100644
--- a/addons/dialogic/Editor/Pieces/SetValue.gd
+++ b/addons/dialogic/Editor/Pieces/SetValue.gd
@@ -7,27 +7,38 @@ var editorPopup
# This is the information of this event and it will get parsed and saved to the JSON file.
var event_data = {
+ 'definition': '',
+ 'operation': '=',
'set_value': '',
- 'definition': ''
}
onready var nodes = {
'definition_picker': $PanelContainer/VBoxContainer/Header/DefinitionPicker,
+ 'operation_picker': $PanelContainer/VBoxContainer/Header/OperationPicker,
}
func _ready():
nodes['definition_picker'].get_popup().connect("index_pressed", self, '_on_definition_entry_selected')
+ nodes['operation_picker'].get_popup().connect("index_pressed", self, '_on_operation_entry_selected')
func _on_definition_entry_selected(index):
var metadata = nodes['definition_picker'].get_popup().get_item_metadata(index)
event_data['definition'] = metadata['id']
+func _on_operation_entry_selected(index):
+ var metadata = nodes['operation_picker'].get_popup().get_item_metadata(index)
+ event_data['operation'] = metadata['operation']
+
func load_data(data):
event_data = data
$PanelContainer/VBoxContainer/Header/LineEdit.text = event_data['set_value']
nodes['definition_picker'].load_definition(data['definition'])
+ var operation = ''
+ if 'operation' in data:
+ operation = data['operation']
+ nodes['operation_picker'].load_condition(operation)
func _on_LineEdit_text_changed(new_text):
diff --git a/addons/dialogic/Editor/Pieces/SetValue.tscn b/addons/dialogic/Editor/Pieces/SetValue.tscn
index a5713d4..a35ecd8 100644
--- a/addons/dialogic/Editor/Pieces/SetValue.tscn
+++ b/addons/dialogic/Editor/Pieces/SetValue.tscn
@@ -1,11 +1,12 @@
-[gd_scene load_steps=9 format=2]
+[gd_scene load_steps=10 format=2]
[ext_resource path="res://addons/dialogic/Editor/Pieces/SetValue.gd" type="Script" id=1]
-[ext_resource path="res://addons/dialogic/Images/Events/set-value.svg" type="Texture" id=2]
+[ext_resource path="res://addons/dialogic/Images/Resources/definition.svg" type="Texture" id=2]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/Spacer.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/PieceExtraSettings.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DragController.tscn" type="PackedScene" id=5]
[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/DefinitionPicker.tscn" type="PackedScene" id=6]
+[ext_resource path="res://addons/dialogic/Editor/Pieces/Common/OperationPicker.tscn" type="PackedScene" id=7]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 16.0
@@ -86,16 +87,12 @@ margin_left = 137.0
margin_right = 280.0
margin_bottom = 28.0
-[node name="Title2" type="Label" parent="PanelContainer/VBoxContainer/Header"]
-margin_left = 284.0
-margin_top = 7.0
-margin_right = 333.0
-margin_bottom = 21.0
-text = "to be "
+[node name="OperationPicker" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 7 )]
+margin_right = 347.0
[node name="LineEdit" type="LineEdit" parent="PanelContainer/VBoxContainer/Header"]
-margin_left = 337.0
-margin_right = 385.0
+margin_left = 351.0
+margin_right = 399.0
margin_bottom = 28.0
custom_styles/read_only = SubResource( 2 )
custom_styles/focus = SubResource( 2 )
@@ -112,14 +109,14 @@ caret_blink = true
caret_blink_speed = 0.5
[node name="Preview" type="Label" parent="PanelContainer/VBoxContainer/Header"]
-margin_left = 389.0
+margin_left = 403.0
margin_top = 7.0
-margin_right = 389.0
+margin_right = 403.0
margin_bottom = 21.0
custom_colors/font_color = Color( 1, 1, 1, 0.513726 )
[node name="Spacer" parent="PanelContainer/VBoxContainer/Header" instance=ExtResource( 3 )]
-margin_left = 393.0
+margin_left = 407.0
margin_right = 941.0
margin_bottom = 28.0
@@ -130,4 +127,5 @@ margin_bottom = 28.0
items = [ "Move Up", null, 0, false, false, 0, 0, null, "", false, "Move Down", null, 0, false, false, 1, 0, null, "", false, "", null, 0, false, false, 2, 0, null, "", true, "Remove", null, 0, false, false, 3, 0, null, "", false ]
[node name="DragController" parent="." instance=ExtResource( 5 )]
+
[connection signal="text_changed" from="PanelContainer/VBoxContainer/Header/LineEdit" to="." method="_on_LineEdit_text_changed"]
diff --git a/addons/dialogic/Editor/ThemeEditor/SectionTitle.gd b/addons/dialogic/Editor/ThemeEditor/SectionTitle.gd
new file mode 100644
index 0000000..95d0db3
--- /dev/null
+++ b/addons/dialogic/Editor/ThemeEditor/SectionTitle.gd
@@ -0,0 +1,6 @@
+tool
+extends Panel
+
+
+func _ready():
+ $HBoxContainer/Label.text = name
diff --git a/addons/dialogic/Editor/ThemeEditor/SectionTitle.tscn b/addons/dialogic/Editor/ThemeEditor/SectionTitle.tscn
new file mode 100644
index 0000000..dd3124c
--- /dev/null
+++ b/addons/dialogic/Editor/ThemeEditor/SectionTitle.tscn
@@ -0,0 +1,35 @@
+[gd_scene load_steps=2 format=2]
+
+[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/SectionTitle.gd" type="Script" id=1]
+
+[node name="PanelContainer" type="Panel"]
+margin_right = 138.0
+margin_bottom = 30.0
+rect_min_size = Vector2( 0, 30 )
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="HBoxContainer" type="HBoxContainer" parent="."]
+anchor_right = 1.0
+anchor_bottom = 1.0
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Label" type="Label" parent="HBoxContainer"]
+margin_top = 8.0
+margin_right = 138.0
+margin_bottom = 22.0
+size_flags_horizontal = 3
+text = "PanelContainer"
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="CheckBox" type="CheckBox" parent="HBoxContainer"]
+visible = false
+margin_left = 114.0
+margin_right = 138.0
+margin_bottom = 30.0
diff --git a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd
index 740adbc..e8bb6ef 100644
--- a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd
+++ b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd
@@ -51,6 +51,18 @@ onready var n = {
# Text preview
'preview_panel': $VBoxContainer/Panel,
'text_preview': $VBoxContainer/HBoxContainer3/TextEdit,
+
+ # Character Names
+ 'name_auto_color': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/CheckBox,
+ 'name_background_visible': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2/CheckBox,
+ 'name_background': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2/ColorPickerButton,
+ 'name_image': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3/BackgroundTextureButton,
+ 'name_image_visible': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3/CheckBox,
+ 'name_shadow': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4/ColorPickerButtonShadow,
+ 'name_shadow_visible': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4/CheckBoxShadow,
+ 'name_shadow_offset_x': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer/ShadowOffsetX,
+ 'name_shadow_offset_y': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer/ShadowOffsetY,
+ 'name_bottom_gap': $VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer5/BottomGap,
}
func _ready():
@@ -113,9 +125,29 @@ func load_theme(filename):
'Right':
n['alignment'].select(2)
+
+ # Name
+ n['name_auto_color'].pressed = theme.get_value('name', 'auto_color', true)
+ n['name_background_visible'].pressed = theme.get_value('name', 'background_visible', false)
+ n['name_background'].color = Color(theme.get_value('name', 'background', "#ff000000"))
+ n['name_image_visible'].pressed = theme.get_value('name', 'image_visible', false)
+ n['name_image'].text = DialogicResources.get_filename_from_path(theme.get_value('name', 'image', 'res://addons/dialogic/Images/background/background-2.png'))
+
+
+ n['name_shadow'].color = Color(theme.get_value('name', 'shadow', "#9e000000"))
+ n['name_shadow_visible'].pressed = theme.get_value('name', 'shadow_visible', true)
+ n['name_shadow_offset_x'].value = theme.get_value('name', 'shadow_offset', Vector2(2,2)).x
+ n['name_shadow_offset_y'].value = theme.get_value('name', 'shadow_offset', Vector2(2,2)).y
+ n['name_bottom_gap'].value = theme.get_value('name', 'bottom_gap', 48)
+
+
+
# Preview text
n['text_preview'].text = theme.get_value('text', 'preview', 'This is preview text. You can use [color=#A5EFAC]BBCode[/color] to style it.\n[wave amp=50 freq=2]You can even use effects![/wave]')
+ # Updating the preview
+ _on_PreviewButton_pressed()
+
func new_theme():
var theme_file = 'theme-' + str(OS.get_unix_time()) + '.cfg'
@@ -172,21 +204,36 @@ func _on_PreviewButton_pressed():
preview_dialog.preview = true
preview_dialog.get_node('DefinitionInfo').in_theme_editor = true
preview_dialog.get_node('TextBubble/NextIndicator/AnimationPlayer').play('IDLE')
+
+ # Random character preview if there are any
+ var characters = DialogicUtil.get_character_list()
+ var character_file = ''
+ if characters.size():
+ characters.shuffle()
+ character_file = characters[0]['file']
+
+ # Creating the one event timeline for the dialog
preview_dialog.dialog_script['events'] = [{
- "character":"",
- "portrait":"",
+ "character": character_file,
+ "portrait":'',
"text": preview_dialog.parse_definitions(n['text_preview'].text)
}]
- # Settings
+ preview_dialog.parse_characters(preview_dialog.dialog_script)
preview_dialog.settings = DialogicResources.get_settings_config()
+
# Alignment
n['preview_panel'].add_child(preview_dialog)
- # Not sure why but I need to reload the theme again for it to work properly
+
preview_dialog.load_dialog()
preview_dialog.current_theme = preview_dialog.load_theme(current_theme)
+ # When not performing this step, the dialog name doesn't update the color for some reason
+ # I should probably refactor the preview dialog to stop making everything manually.
+ if n['name_auto_color'].pressed:
+ if characters.size():
+ preview_dialog.get_node('TextBubble/NameLabel').set('custom_colors/font_color', characters[0]['color'])
+
# maintaining the preview panel big enough for the dialog box
-
n['preview_panel'].rect_min_size.y = preview_dialog.current_theme.get_value('box', 'size', Vector2(910, 167)).y + 90 + preview_dialog.current_theme.get_value('box', 'bottom_gap', 40)
n['preview_panel'].rect_size.y = 0
@@ -324,3 +371,46 @@ func _on_Alignment_item_selected(index):
func _on_Preview_text_changed():
DialogicResources.set_theme_value(current_theme, 'text', 'preview', n['text_preview'].text)
+
+
+func _on_name_auto_color_toggled(button_pressed):
+ DialogicResources.set_theme_value(current_theme, 'name', 'auto_color', button_pressed)
+
+
+func _on_name_background_visible_toggled(button_pressed):
+ DialogicResources.set_theme_value(current_theme, 'name', 'background_visible', button_pressed)
+
+
+func _on_name_background_color_changed(color):
+ DialogicResources.set_theme_value(current_theme, 'name', 'background', '#' + color.to_html())
+
+
+func _on_name_image_visible_toggled(button_pressed):
+ DialogicResources.set_theme_value(current_theme, 'name', 'image_visible', button_pressed)
+
+
+func _on_name_image_pressed():
+ editor_reference.godot_dialog("*.png")
+ editor_reference.godot_dialog_connect(self, "_on_name_texture_selected")
+
+
+func _on_name_texture_selected(path, target):
+ DialogicResources.set_theme_value(current_theme, 'name', 'image', path)
+ n['name_image'].text = DialogicResources.get_filename_from_path(path)
+
+
+func _on_shadow_visible_toggled(button_pressed):
+ DialogicResources.set_theme_value(current_theme, 'name', 'shadow_visible', button_pressed)
+
+
+func _on_name_shadow_color_changed(color):
+ DialogicResources.set_theme_value(current_theme, 'name', 'shadow', '#' + color.to_html())
+
+
+func _on_name_ShadowOffset_value_changed(_value):
+ DialogicResources.set_theme_value(current_theme, 'name','shadow_offset',
+ Vector2(n['name_shadow_offset_x'].value,n['name_shadow_offset_y'].value))
+
+
+func _on_name_BottomGap_value_changed(value):
+ DialogicResources.set_theme_value(current_theme, 'name', 'bottom_gap', value)
diff --git a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn
index c8e8d22..924d0b0 100644
--- a/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn
+++ b/addons/dialogic/Editor/ThemeEditor/ThemeEditor.tscn
@@ -1,30 +1,32 @@
-[gd_scene load_steps=3 format=2]
+[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/dialogic/Images/plugin-editor-icon.svg" type="Texture" id=1]
[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/ThemeEditor.gd" type="Script" id=2]
+[ext_resource path="res://addons/dialogic/Editor/ThemeEditor/SectionTitle.tscn" type="PackedScene" id=3]
[node name="ThemeEditor" type="ScrollContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
+margin_right = 261.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_right = 1048.0
-margin_bottom = 623.0
+margin_right = 1273.0
+margin_bottom = 701.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 15
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
-margin_right = 1048.0
-margin_bottom = 218.0
+margin_right = 1273.0
+margin_bottom = 296.0
[node name="Text" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
margin_right = 316.0
-margin_bottom = 218.0
+margin_bottom = 296.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
@@ -169,10 +171,257 @@ text = "Left"
items = [ "Left", null, false, 0, null, "Center", null, false, 1, null, "Right", null, false, 2, null ]
selected = 0
-[node name="DialogBox" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
+[node name="Glossary" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
margin_left = 320.0
-margin_right = 614.0
-margin_bottom = 218.0
+margin_right = 635.0
+margin_bottom = 296.0
+size_flags_horizontal = 3
+size_flags_vertical = 3
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Character Name" parent="VBoxContainer/HBoxContainer2/Glossary" instance=ExtResource( 3 )]
+margin_right = 315.0
+
+[node name="GridContainer2" type="GridContainer" parent="VBoxContainer/HBoxContainer2/Glossary"]
+margin_top = 34.0
+margin_right = 315.0
+margin_bottom = 204.0
+columns = 2
+
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 5.0
+margin_right = 126.0
+margin_bottom = 19.0
+text = "Background Color"
+
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_right = 288.0
+margin_bottom = 24.0
+
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2"]
+margin_right = 24.0
+margin_bottom = 24.0
+
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2"]
+margin_left = 28.0
+margin_right = 158.0
+margin_bottom = 24.0
+size_flags_horizontal = 3
+
+[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 33.0
+margin_right = 126.0
+margin_bottom = 47.0
+text = "Background Texture"
+
+[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_top = 28.0
+margin_right = 288.0
+margin_bottom = 52.0
+
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3"]
+margin_right = 24.0
+margin_bottom = 24.0
+pressed = true
+
+[node name="BackgroundTextureButton" type="Button" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3"]
+margin_left = 28.0
+margin_right = 158.0
+margin_bottom = 24.0
+size_flags_horizontal = 3
+text = "background-2"
+
+[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 64.0
+margin_right = 126.0
+margin_bottom = 78.0
+text = "Shadow"
+
+[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_top = 56.0
+margin_right = 288.0
+margin_bottom = 86.0
+
+[node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4"]
+margin_right = 24.0
+margin_bottom = 30.0
+
+[node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4"]
+margin_left = 28.0
+margin_right = 158.0
+margin_bottom = 30.0
+rect_min_size = Vector2( 50, 30 )
+size_flags_horizontal = 3
+color = Color( 0, 0, 0, 0.619608 )
+
+[node name="Label4" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 95.0
+margin_right = 126.0
+margin_bottom = 109.0
+text = "Shadow Offset"
+
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_top = 90.0
+margin_right = 288.0
+margin_bottom = 114.0
+custom_constants/separation = 10
+
+[node name="ShadowOffsetX" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer"]
+margin_right = 74.0
+margin_bottom = 24.0
+value = 2.0
+rounded = true
+allow_lesser = true
+prefix = "X"
+
+[node name="ShadowOffsetY" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer"]
+margin_left = 84.0
+margin_right = 158.0
+margin_bottom = 24.0
+value = 2.0
+rounded = true
+allow_lesser = true
+prefix = "Y"
+
+[node name="Label8" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 123.0
+margin_right = 126.0
+margin_bottom = 137.0
+text = "Bottom gap"
+
+[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_top = 118.0
+margin_right = 288.0
+margin_bottom = 142.0
+
+[node name="BottomGap" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer5"]
+margin_right = 74.0
+margin_bottom = 24.0
+max_value = 999.0
+value = 48.0
+allow_greater = true
+allow_lesser = true
+
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_top = 151.0
+margin_right = 126.0
+margin_bottom = 165.0
+text = "Auto color"
+
+[node name="CheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer2"]
+margin_left = 130.0
+margin_top = 146.0
+margin_right = 288.0
+margin_bottom = 170.0
+
+[node name="Glossary Panel" parent="VBoxContainer/HBoxContainer2/Glossary" instance=ExtResource( 3 )]
+margin_top = 208.0
+margin_right = 315.0
+margin_bottom = 238.0
+
+[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/Glossary"]
+margin_top = 242.0
+margin_right = 315.0
+margin_bottom = 296.0
+size_flags_horizontal = 3
+custom_constants/hseparation = 10
+columns = 2
+
+[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+margin_top = 3.0
+margin_right = 210.0
+margin_bottom = 17.0
+size_flags_horizontal = 3
+text = "Font"
+
+[node name="FontButton" type="Button" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+margin_left = 220.0
+margin_right = 315.0
+margin_bottom = 20.0
+size_flags_vertical = 4
+text = "GlossaryFont"
+
+[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+margin_top = 32.0
+margin_right = 210.0
+margin_bottom = 46.0
+text = "Color"
+
+[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+margin_left = 220.0
+margin_top = 24.0
+margin_right = 315.0
+margin_bottom = 54.0
+rect_min_size = Vector2( 50, 30 )
+color = Color( 0.215686, 0.654902, 0.67451, 1 )
+
+[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+visible = false
+margin_top = 66.0
+margin_right = 141.0
+margin_bottom = 80.0
+text = "Shadow"
+
+[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+visible = false
+margin_top = 58.0
+margin_right = 213.0
+margin_bottom = 88.0
+
+[node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
+margin_right = 24.0
+margin_bottom = 30.0
+
+[node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
+margin_left = 28.0
+margin_right = 213.0
+margin_bottom = 30.0
+rect_min_size = Vector2( 50, 30 )
+size_flags_horizontal = 3
+color = Color( 0, 0, 0, 0.619608 )
+
+[node name="Label4" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+visible = false
+margin_top = 63.0
+margin_right = 141.0
+margin_bottom = 77.0
+text = "S, Offset"
+
+[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
+visible = false
+margin_top = 58.0
+margin_right = 213.0
+margin_bottom = 82.0
+custom_constants/separation = 10
+
+[node name="ShadowOffsetX" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
+margin_right = 74.0
+margin_bottom = 24.0
+value = 2.0
+rounded = true
+allow_lesser = true
+prefix = "X"
+
+[node name="ShadowOffsetY" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
+margin_left = 84.0
+margin_right = 158.0
+margin_bottom = 24.0
+value = 2.0
+rounded = true
+allow_lesser = true
+prefix = "Y"
+
+[node name="DialogBox" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
+margin_left = 639.0
+margin_right = 954.0
+margin_bottom = 296.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
@@ -180,7 +429,7 @@ __meta__ = {
}
[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/DialogBox"]
-margin_right = 294.0
+margin_right = 315.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
@@ -194,7 +443,7 @@ __meta__ = {
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/DialogBox"]
margin_top = 34.0
-margin_right = 294.0
+margin_right = 315.0
margin_bottom = 218.0
size_flags_horizontal = 3
custom_constants/hseparation = 10
@@ -359,9 +608,9 @@ items = [ "[Select Action]", null, false, 0, null, "ui_accept", null, false, 1,
selected = 0
[node name="ButtonStyle" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
-margin_left = 618.0
-margin_right = 906.0
-margin_bottom = 218.0
+margin_left = 958.0
+margin_right = 1273.0
+margin_bottom = 296.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
@@ -369,7 +618,7 @@ __meta__ = {
}
[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/ButtonStyle"]
-margin_right = 288.0
+margin_right = 315.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
@@ -383,7 +632,7 @@ __meta__ = {
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/ButtonStyle"]
margin_top = 34.0
-margin_right = 288.0
+margin_right = 315.0
margin_bottom = 170.0
size_flags_horizontal = 3
custom_constants/hseparation = 10
@@ -505,125 +754,10 @@ value = 5.0
rounded = true
allow_lesser = true
-[node name="Glossary" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2"]
-margin_left = 910.0
-margin_right = 1048.0
-margin_bottom = 218.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="PanelContainer" type="Panel" parent="VBoxContainer/HBoxContainer2/Glossary"]
-margin_right = 138.0
-margin_bottom = 30.0
-rect_min_size = Vector2( 0, 30 )
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/PanelContainer"]
-margin_right = 40.0
-margin_bottom = 14.0
-text = "Glossary Panel"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer2/Glossary"]
-margin_top = 34.0
-margin_right = 138.0
-margin_bottom = 88.0
-size_flags_horizontal = 3
-custom_constants/hseparation = 10
-columns = 2
-
-[node name="Label5" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-margin_top = 3.0
-margin_right = 33.0
-margin_bottom = 17.0
-size_flags_horizontal = 3
-text = "Font"
-
-[node name="FontButton" type="Button" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-margin_left = 43.0
-margin_right = 138.0
-margin_bottom = 20.0
-size_flags_vertical = 4
-text = "GlossaryFont"
-
-[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-margin_top = 32.0
-margin_right = 33.0
-margin_bottom = 46.0
-text = "Color"
-
-[node name="ColorPickerButton" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-margin_left = 43.0
-margin_top = 24.0
-margin_right = 138.0
-margin_bottom = 54.0
-rect_min_size = Vector2( 50, 30 )
-color = Color( 0.215686, 0.654902, 0.67451, 1 )
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-visible = false
-margin_top = 66.0
-margin_right = 141.0
-margin_bottom = 80.0
-text = "Shadow"
-
-[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-visible = false
-margin_top = 58.0
-margin_right = 213.0
-margin_bottom = 88.0
-
-[node name="CheckBoxShadow" type="CheckBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
-margin_right = 24.0
-margin_bottom = 30.0
-
-[node name="ColorPickerButtonShadow" type="ColorPickerButton" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2"]
-margin_left = 28.0
-margin_right = 213.0
-margin_bottom = 30.0
-rect_min_size = Vector2( 50, 30 )
-size_flags_horizontal = 3
-color = Color( 0, 0, 0, 0.619608 )
-
-[node name="Label4" type="Label" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-visible = false
-margin_top = 63.0
-margin_right = 141.0
-margin_bottom = 77.0
-text = "S, Offset"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer"]
-visible = false
-margin_top = 58.0
-margin_right = 213.0
-margin_bottom = 82.0
-custom_constants/separation = 10
-
-[node name="ShadowOffsetX" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
-margin_right = 74.0
-margin_bottom = 24.0
-value = 2.0
-rounded = true
-allow_lesser = true
-prefix = "X"
-
-[node name="ShadowOffsetY" type="SpinBox" parent="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer"]
-margin_left = 84.0
-margin_right = 158.0
-margin_bottom = 24.0
-value = 2.0
-rounded = true
-allow_lesser = true
-prefix = "Y"
-
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 233.0
-margin_right = 1048.0
-margin_bottom = 293.0
+margin_top = 311.0
+margin_right = 1273.0
+margin_bottom = 371.0
custom_constants/separation = 10
[node name="PreviewButton" type="Button" parent="VBoxContainer/HBoxContainer3"]
@@ -634,7 +768,7 @@ icon = ExtResource( 1 )
[node name="TextEdit" type="TextEdit" parent="VBoxContainer/HBoxContainer3"]
margin_left = 162.0
-margin_right = 1048.0
+margin_right = 1273.0
margin_bottom = 60.0
rect_min_size = Vector2( 400, 60 )
size_flags_horizontal = 3
@@ -643,18 +777,18 @@ text = "This is preview text. You can use [color=#A5EFAC]BBCode[/color] to styl
wrap_enabled = true
[node name="Panel" type="Panel" parent="VBoxContainer"]
-margin_top = 308.0
-margin_right = 1048.0
-margin_bottom = 608.0
+margin_top = 386.0
+margin_right = 1273.0
+margin_bottom = 686.0
rect_min_size = Vector2( 0, 300 )
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 623.0
-margin_right = 1048.0
-margin_bottom = 623.0
+margin_top = 701.0
+margin_right = 1273.0
+margin_bottom = 701.0
[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer"]
-margin_right = 1048.0
+margin_right = 1273.0
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -666,6 +800,22 @@ size_flags_vertical = 3
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Text/GridContainer/TextSpeed" to="." method="_on_textSpeed_value_changed"]
[connection signal="item_selected" from="VBoxContainer/HBoxContainer2/Text/GridContainer/HBoxContainer3/Alignment" to="." method="_on_Alignment_item_selected"]
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2/CheckBox" to="." method="_on_name_background_visible_toggled"]
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer2/ColorPickerButton" to="." method="_on_name_background_color_changed"]
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3/CheckBox" to="." method="_on_name_image_visible_toggled"]
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer3/BackgroundTextureButton" to="." method="_on_name_image_pressed"]
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4/CheckBoxShadow" to="." method="_on_shadow_visible_toggled"]
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer4/ColorPickerButtonShadow" to="." method="_on_name_shadow_color_changed"]
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer/ShadowOffsetX" to="." method="_on_name_ShadowOffset_value_changed"]
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer/ShadowOffsetY" to="." method="_on_name_ShadowOffset_value_changed"]
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/HBoxContainer5/BottomGap" to="." method="_on_name_BottomGap_value_changed"]
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer2/CheckBox" to="." method="_on_name_auto_color_toggled"]
+[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/FontButton" to="." method="_on_GlossaryFontButton_pressed"]
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/ColorPickerButton" to="." method="_on_GlossaryColorPicker_color_changed"]
+[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/CheckBoxShadow" to="." method="_on_CheckBoxShadow_toggled"]
+[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"]
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"]
+[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/CheckBox" to="." method="_on_BackgroundColor_CheckBox_toggled"]
[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer2/ColorPickerButton" to="." method="_on_BackgroundColor_ColorPickerButton_color_changed"]
[connection signal="toggled" from="VBoxContainer/HBoxContainer2/DialogBox/GridContainer/HBoxContainer3/CheckBox" to="." method="_on_BackgroundTexture_CheckBox_toggled"]
@@ -687,11 +837,5 @@ size_flags_vertical = 3
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetV" to="." method="_on_ButtonOffset_value_changed"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/HBoxContainer/TextOffsetH" to="." method="_on_ButtonOffset_value_changed"]
[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/ButtonStyle/GridContainer/VerticalSeparation" to="." method="_on_VerticalSeparation_value_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/FontButton" to="." method="_on_GlossaryFontButton_pressed"]
-[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/ColorPickerButton" to="." method="_on_GlossaryColorPicker_color_changed"]
-[connection signal="toggled" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/CheckBoxShadow" to="." method="_on_CheckBoxShadow_toggled"]
-[connection signal="color_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer2/ColorPickerButtonShadow" to="." method="_on_ColorPickerButtonShadow_color_changed"]
-[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetX" to="." method="_on_ShadowOffset_value_changed"]
-[connection signal="value_changed" from="VBoxContainer/HBoxContainer2/Glossary/GridContainer/HBoxContainer/ShadowOffsetY" to="." method="_on_ShadowOffset_value_changed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer3/PreviewButton" to="." method="_on_PreviewButton_pressed"]
[connection signal="text_changed" from="VBoxContainer/HBoxContainer3/TextEdit" to="." method="_on_Preview_text_changed"]
diff --git a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd
index 4797461..16bb4f3 100644
--- a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd
+++ b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.gd
@@ -172,6 +172,8 @@ func load_timeline(filename: String):
create_event("CharacterJoinBlock", i)
{'audio', 'file'}:
create_event("AudioBlock", i)
+ {'background-music', 'file'}:
+ create_event("BackgroundMusic", i)
{'question', 'options'}:
create_event("Question", i)
{'choice'}:
@@ -192,7 +194,7 @@ func load_timeline(filename: String):
create_event("WaitSeconds", i)
{'condition', 'definition', 'value'}:
create_event("IfCondition", i)
- {'set_value', 'definition'}:
+ {'set_value', 'definition', ..}:
create_event("SetValue", i)
{'set_theme'}:
create_event("SetTheme", i)
diff --git a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn
index feb4f75..fa569aa 100644
--- a/addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn
+++ b/addons/dialogic/Editor/TimelineEditor/TimelineEditor.tscn
@@ -10,7 +10,7 @@
[ext_resource path="res://addons/dialogic/Images/question.svg" type="Texture" id=8]
[ext_resource path="res://addons/dialogic/Images/end-choice.svg" type="Texture" id=9]
[ext_resource path="res://addons/dialogic/Images/change-timeline.svg" type="Texture" id=10]
-[ext_resource path="res://addons/dialogic/Images/ListSelect.svg" type="Texture" id=11]
+[ext_resource path="res://addons/dialogic/Images/Resources/definition.svg" type="Texture" id=11]
[ext_resource path="res://addons/dialogic/Images/choice.svg" type="Texture" id=12]
[ext_resource path="res://addons/dialogic/Images/tutorials/arrow-down.svg" type="Texture" id=13]
[ext_resource path="res://addons/dialogic/Images/Wait.svg" type="Texture" id=14]
@@ -54,7 +54,7 @@ __meta__ = {
}
[node name="TimelineArea" type="ScrollContainer" parent="."]
-margin_right = 826.0
+margin_right = 816.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -66,7 +66,7 @@ __meta__ = {
[node name="TimeLine" type="VBoxContainer" parent="TimelineArea"]
margin_left = 5.0
margin_top = 5.0
-margin_right = 821.0
+margin_right = 811.0
margin_bottom = 595.0
grow_horizontal = 2
grow_vertical = 2
@@ -74,14 +74,14 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="."]
-margin_left = 834.0
+margin_left = 824.0
margin_right = 1024.0
margin_bottom = 600.0
-rect_min_size = Vector2( 190, 0 )
+rect_min_size = Vector2( 200, 0 )
[node name="EventContainer" type="VBoxContainer" parent="ScrollContainer"]
-margin_right = 178.0
-margin_bottom = 664.0
+margin_right = 188.0
+margin_bottom = 702.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
@@ -89,13 +89,13 @@ __meta__ = {
}
[node name="EventsWarning" type="PanelContainer" parent="ScrollContainer/EventContainer"]
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 68.0
custom_styles/panel = SubResource( 2 )
[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/EventContainer/EventsWarning"]
margin_top = 10.0
-margin_right = 172.0
+margin_right = 182.0
margin_bottom = 58.0
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -112,7 +112,7 @@ stretch_mode = 4
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/EventsWarning/HBoxContainer"]
margin_left = 44.0
-margin_right = 172.0
+margin_right = 182.0
margin_bottom = 48.0
rect_min_size = Vector2( 100, 0 )
size_flags_horizontal = 3
@@ -123,7 +123,7 @@ autowrap = true
[node name="HBoxContainer6" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
margin_top = 72.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 86.0
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer6"]
@@ -133,13 +133,13 @@ text = "Main Events"
[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer6"]
margin_left = 81.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="TextBlock" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 90.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 118.0
text = " Text Event"
icon = ExtResource( 2 )
@@ -147,7 +147,7 @@ align = 0
[node name="CharacterJoinBlock" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 122.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 150.0
text = " Character Join"
icon = ExtResource( 1 )
@@ -155,7 +155,7 @@ align = 0
[node name="CharacterLeaveBlock" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 154.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 182.0
text = " Character Leave"
icon = ExtResource( 7 )
@@ -163,7 +163,7 @@ align = 0
[node name="HBoxContainer5" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
margin_top = 186.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 200.0
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer5"]
@@ -173,13 +173,13 @@ text = "Logic"
[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer5"]
margin_left = 37.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="ButtonQuestion" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 204.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 232.0
text = " Question"
icon = ExtResource( 8 )
@@ -187,7 +187,7 @@ align = 0
[node name="Choice" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 236.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 264.0
text = " Choice"
icon = ExtResource( 12 )
@@ -195,7 +195,7 @@ align = 0
[node name="IfCondition" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 268.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 296.0
text = " Condition"
icon = ExtResource( 5 )
@@ -203,7 +203,7 @@ align = 0
[node name="EndBranch" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 300.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 328.0
text = " End Branch"
icon = ExtResource( 9 )
@@ -211,16 +211,16 @@ align = 0
[node name="SetValue" type="Button" parent="ScrollContainer/EventContainer"]
margin_top = 332.0
-margin_right = 178.0
-margin_bottom = 354.0
+margin_right = 188.0
+margin_bottom = 360.0
text = " Set Value"
icon = ExtResource( 11 )
align = 0
[node name="HBoxContainer3" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
-margin_top = 358.0
-margin_right = 178.0
-margin_bottom = 372.0
+margin_top = 364.0
+margin_right = 188.0
+margin_bottom = 378.0
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer3"]
margin_right = 56.0
@@ -229,55 +229,55 @@ text = "Timeline"
[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer3"]
margin_left = 60.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="ChangeTimeline" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 376.0
-margin_right = 178.0
-margin_bottom = 404.0
+margin_top = 382.0
+margin_right = 188.0
+margin_bottom = 410.0
hint_tooltip = "This will instantly teleport you to the start of the desired timeline."
text = " Change Timeline"
icon = ExtResource( 10 )
align = 0
[node name="SceneEvent" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 408.0
-margin_right = 178.0
-margin_bottom = 436.0
+margin_top = 414.0
+margin_right = 188.0
+margin_bottom = 442.0
text = " Scene Event"
icon = ExtResource( 4 )
align = 0
[node name="CloseDialog" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 440.0
-margin_right = 178.0
-margin_bottom = 468.0
+margin_top = 446.0
+margin_right = 188.0
+margin_bottom = 474.0
text = " Close Dialog"
icon = ExtResource( 6 )
align = 0
[node name="WaitSeconds" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 472.0
-margin_right = 178.0
-margin_bottom = 500.0
+margin_top = 478.0
+margin_right = 188.0
+margin_bottom = 506.0
text = " Wait Seconds"
icon = ExtResource( 14 )
align = 0
[node name="SetTheme" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 504.0
-margin_right = 178.0
-margin_bottom = 532.0
+margin_top = 510.0
+margin_right = 188.0
+margin_bottom = 538.0
text = " Set Theme"
icon = ExtResource( 18 )
align = 0
[node name="HBoxContainer4" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
-margin_top = 536.0
-margin_right = 178.0
-margin_bottom = 550.0
+margin_top = 542.0
+margin_right = 188.0
+margin_bottom = 556.0
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer4"]
margin_right = 37.0
@@ -286,22 +286,30 @@ text = "Audio"
[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer4"]
margin_left = 41.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="AudioBlock" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 554.0
-margin_right = 178.0
-margin_bottom = 582.0
+margin_top = 560.0
+margin_right = 188.0
+margin_bottom = 588.0
text = " Audio Event"
icon = ExtResource( 3 )
align = 0
+[node name="BackgroundMusic" type="Button" parent="ScrollContainer/EventContainer"]
+margin_top = 592.0
+margin_right = 188.0
+margin_bottom = 620.0
+text = " Background Music"
+icon = ExtResource( 3 )
+align = 0
+
[node name="HBoxContainer" type="HBoxContainer" parent="ScrollContainer/EventContainer"]
-margin_top = 586.0
-margin_right = 178.0
-margin_bottom = 600.0
+margin_top = 624.0
+margin_right = 188.0
+margin_bottom = 638.0
[node name="Label" type="Label" parent="ScrollContainer/EventContainer/HBoxContainer"]
margin_right = 39.0
@@ -310,22 +318,22 @@ text = "Godot"
[node name="HSeparator2" type="HSeparator" parent="ScrollContainer/EventContainer/HBoxContainer"]
margin_left = 43.0
-margin_right = 178.0
+margin_right = 188.0
margin_bottom = 14.0
size_flags_horizontal = 3
[node name="EmitSignal" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 604.0
-margin_right = 178.0
-margin_bottom = 632.0
+margin_top = 642.0
+margin_right = 188.0
+margin_bottom = 670.0
text = " Emit Signal"
icon = ExtResource( 16 )
align = 0
[node name="ChangeScene" type="Button" parent="ScrollContainer/EventContainer"]
-margin_top = 636.0
-margin_right = 178.0
-margin_bottom = 664.0
+margin_top = 674.0
+margin_right = 188.0
+margin_bottom = 702.0
hint_tooltip = "This will instantly change
the current scene."
text = " Change Scene"
diff --git a/addons/dialogic/Images/ListSelect.svg b/addons/dialogic/Images/ListSelect.svg
deleted file mode 100644
index 9e2bf38..0000000
--- a/addons/dialogic/Images/ListSelect.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/addons/dialogic/Images/Resources/definition.svg b/addons/dialogic/Images/Resources/definition.svg
new file mode 100644
index 0000000..ed40659
--- /dev/null
+++ b/addons/dialogic/Images/Resources/definition.svg
@@ -0,0 +1,3 @@
+
diff --git a/addons/dialogic/Images/Resources/definition.svg.import b/addons/dialogic/Images/Resources/definition.svg.import
new file mode 100644
index 0000000..ea9db63
--- /dev/null
+++ b/addons/dialogic/Images/Resources/definition.svg.import
@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="StreamTexture"
+path="res://.import/definition.svg-336e1b41e3ab4ef43367e0f0bbc50c2c.stex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://addons/dialogic/Images/Resources/definition.svg"
+dest_files=[ "res://.import/definition.svg-336e1b41e3ab4ef43367e0f0bbc50c2c.stex" ]
+
+[params]
+
+compress/mode=0
+compress/lossy_quality=0.7
+compress/hdr_mode=0
+compress/bptc_ldr=0
+compress/normal_map=0
+flags/repeat=0
+flags/filter=true
+flags/mipmaps=false
+flags/anisotropic=false
+flags/srgb=2
+process/fix_alpha_border=true
+process/premult_alpha=false
+process/HDR_as_SRGB=false
+process/invert_color=false
+stream=false
+size_limit=0
+detect_3d=true
+svg/scale=1.0
diff --git a/addons/dialogic/Images/Resources/glossary.svg b/addons/dialogic/Images/Resources/glossary.svg
new file mode 100644
index 0000000..78ceada
--- /dev/null
+++ b/addons/dialogic/Images/Resources/glossary.svg
@@ -0,0 +1,3 @@
+
diff --git a/addons/dialogic/Images/glossary.svg.import b/addons/dialogic/Images/Resources/glossary.svg.import
similarity index 69%
rename from addons/dialogic/Images/glossary.svg.import
rename to addons/dialogic/Images/Resources/glossary.svg.import
index d9ad7e7..7dbd484 100644
--- a/addons/dialogic/Images/glossary.svg.import
+++ b/addons/dialogic/Images/Resources/glossary.svg.import
@@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
-path="res://.import/glossary.svg-469b641a988c9791f270a494be069208.stex"
+path="res://.import/glossary.svg-6fbd6bb0ce43791e7b31d146806b81c8.stex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://addons/dialogic/Images/glossary.svg"
-dest_files=[ "res://.import/glossary.svg-469b641a988c9791f270a494be069208.stex" ]
+source_file="res://addons/dialogic/Images/Resources/glossary.svg"
+dest_files=[ "res://.import/glossary.svg-6fbd6bb0ce43791e7b31d146806b81c8.stex" ]
[params]
diff --git a/addons/dialogic/Images/Resources/theme.svg b/addons/dialogic/Images/Resources/theme.svg
new file mode 100644
index 0000000..e21235f
--- /dev/null
+++ b/addons/dialogic/Images/Resources/theme.svg
@@ -0,0 +1,4 @@
+
diff --git a/addons/dialogic/Images/ListSelect.svg.import b/addons/dialogic/Images/Resources/theme.svg.import
similarity index 68%
rename from addons/dialogic/Images/ListSelect.svg.import
rename to addons/dialogic/Images/Resources/theme.svg.import
index dc2483a..998a166 100644
--- a/addons/dialogic/Images/ListSelect.svg.import
+++ b/addons/dialogic/Images/Resources/theme.svg.import
@@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
-path="res://.import/ListSelect.svg-13f1ed55ed7b218cc38ee6eb54d49a49.stex"
+path="res://.import/theme.svg-d2e167fcbacd86111397e731ff3f28eb.stex"
metadata={
"vram_texture": false
}
[deps]
-source_file="res://addons/dialogic/Images/ListSelect.svg"
-dest_files=[ "res://.import/ListSelect.svg-13f1ed55ed7b218cc38ee6eb54d49a49.stex" ]
+source_file="res://addons/dialogic/Images/Resources/theme.svg"
+dest_files=[ "res://.import/theme.svg-d2e167fcbacd86111397e731ff3f28eb.stex" ]
[params]
diff --git a/addons/dialogic/Images/Toolbar/add-character.svg b/addons/dialogic/Images/Toolbar/add-character.svg
index 61393d8..4010c28 100644
--- a/addons/dialogic/Images/Toolbar/add-character.svg
+++ b/addons/dialogic/Images/Toolbar/add-character.svg
@@ -1,5 +1,4 @@
diff --git a/addons/dialogic/Images/Toolbar/add-definition.svg b/addons/dialogic/Images/Toolbar/add-definition.svg
index ca3cd08..3a95fbf 100644
--- a/addons/dialogic/Images/Toolbar/add-definition.svg
+++ b/addons/dialogic/Images/Toolbar/add-definition.svg
@@ -1,4 +1,4 @@
diff --git a/addons/dialogic/Images/Toolbar/add-theme.svg b/addons/dialogic/Images/Toolbar/add-theme.svg
index 126740f..ede9be4 100644
--- a/addons/dialogic/Images/Toolbar/add-theme.svg
+++ b/addons/dialogic/Images/Toolbar/add-theme.svg
@@ -1,5 +1,5 @@
diff --git a/addons/dialogic/Images/Toolbar/add-timeline.svg b/addons/dialogic/Images/Toolbar/add-timeline.svg
index 1717323..26685bd 100644
--- a/addons/dialogic/Images/Toolbar/add-timeline.svg
+++ b/addons/dialogic/Images/Toolbar/add-timeline.svg
@@ -1,11 +1,7 @@
diff --git a/addons/dialogic/Images/glossary.svg b/addons/dialogic/Images/glossary.svg
deleted file mode 100644
index 65482d5..0000000
--- a/addons/dialogic/Images/glossary.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
diff --git a/addons/dialogic/Nodes/BackgroundMusic.gd b/addons/dialogic/Nodes/BackgroundMusic.gd
new file mode 100644
index 0000000..f80ea9e
--- /dev/null
+++ b/addons/dialogic/Nodes/BackgroundMusic.gd
@@ -0,0 +1,24 @@
+extends Control
+class_name DialogicBackgroundMusic
+
+onready var _anim_player := $AnimationPlayer
+onready var _track1 := $Track1
+onready var _track2 := $Track2
+
+
+func crossfade_to(audio_stream: AudioStream) -> void:
+ if _track1.playing and _track2.playing:
+ return
+
+ if _track2.playing:
+ _track1.stream = audio_stream
+ _track1.play()
+ _anim_player.play("FadeToTrack1")
+ else:
+ _track2.stream = audio_stream
+ _track2.play()
+ _anim_player.play("FadeToTrack2")
+
+
+func fade_out() -> void:
+ _anim_player.play("FadeOut")
diff --git a/addons/dialogic/Nodes/BackgroundMusic.tscn b/addons/dialogic/Nodes/BackgroundMusic.tscn
new file mode 100644
index 0000000..7d3da6e
--- /dev/null
+++ b/addons/dialogic/Nodes/BackgroundMusic.tscn
@@ -0,0 +1,152 @@
+[gd_scene load_steps=5 format=2]
+
+[ext_resource path="res://addons/dialogic/Nodes/BackgroundMusic.gd" type="Script" id=1]
+
+
+[sub_resource type="Animation" id=3]
+resource_name = "FadeOut"
+tracks/0/type = "value"
+tracks/0/path = NodePath("Track1:volume_db")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ 0.0, -80.0 ]
+}
+tracks/1/type = "value"
+tracks/1/path = NodePath("Track2:volume_db")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ 0.0, -80.0 ]
+}
+tracks/2/type = "value"
+tracks/2/path = NodePath("Track2:playing")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/keys = {
+"times": PoolRealArray( 0.5 ),
+"transitions": PoolRealArray( 1 ),
+"update": 1,
+"values": [ false ]
+}
+tracks/3/type = "value"
+tracks/3/path = NodePath("Track1:playing")
+tracks/3/interp = 1
+tracks/3/loop_wrap = true
+tracks/3/imported = false
+tracks/3/enabled = true
+tracks/3/keys = {
+"times": PoolRealArray( 0.5 ),
+"transitions": PoolRealArray( 1 ),
+"update": 1,
+"values": [ false ]
+}
+
+[sub_resource type="Animation" id=1]
+resource_name = "FadeToTrack1"
+length = 0.5
+tracks/0/type = "value"
+tracks/0/path = NodePath("Track1:volume_db")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ -80.0, 0.0 ]
+}
+tracks/1/type = "value"
+tracks/1/path = NodePath("Track2:volume_db")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ 0.0, -80.0 ]
+}
+tracks/2/type = "value"
+tracks/2/path = NodePath("Track2:playing")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/keys = {
+"times": PoolRealArray( 0.5 ),
+"transitions": PoolRealArray( 1 ),
+"update": 1,
+"values": [ false ]
+}
+
+[sub_resource type="Animation" id=2]
+resource_name = "FadeToTrack2"
+length = 0.5
+tracks/0/type = "value"
+tracks/0/path = NodePath("Track1:volume_db")
+tracks/0/interp = 1
+tracks/0/loop_wrap = true
+tracks/0/imported = false
+tracks/0/enabled = true
+tracks/0/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ 0.0, -80.0 ]
+}
+tracks/1/type = "value"
+tracks/1/path = NodePath("Track1:playing")
+tracks/1/interp = 1
+tracks/1/loop_wrap = true
+tracks/1/imported = false
+tracks/1/enabled = true
+tracks/1/keys = {
+"times": PoolRealArray( 0.5 ),
+"transitions": PoolRealArray( 1 ),
+"update": 1,
+"values": [ false ]
+}
+tracks/2/type = "value"
+tracks/2/path = NodePath("Track2:volume_db")
+tracks/2/interp = 1
+tracks/2/loop_wrap = true
+tracks/2/imported = false
+tracks/2/enabled = true
+tracks/2/keys = {
+"times": PoolRealArray( 0, 0.5 ),
+"transitions": PoolRealArray( 5.66, 1 ),
+"update": 0,
+"values": [ -80.0, 0.0 ]
+}
+
+[node name="BackgroundMusic" type="Control"]
+margin_right = 40.0
+margin_bottom = 40.0
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Track1" type="AudioStreamPlayer" parent="."]
+
+[node name="Track2" type="AudioStreamPlayer" parent="."]
+
+[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
+anims/FadeOut = SubResource( 3 )
+anims/FadeToTrack1 = SubResource( 1 )
+anims/FadeToTrack2 = SubResource( 2 )
diff --git a/addons/dialogic/Nodes/dialog_node.gd b/addons/dialogic/Nodes/dialog_node.gd
index 394e4e6..2332883 100644
--- a/addons/dialogic/Nodes/dialog_node.gd
+++ b/addons/dialogic/Nodes/dialog_node.gd
@@ -239,6 +239,7 @@ func parse_definitions(text: String):
final_text = _insert_glossary_definitions(final_text)
return final_text
+
func _insert_variable_definitions(text: String):
var final_text := text;
for d in definitions['variables']:
@@ -299,23 +300,29 @@ func start_text_tween():
$TextBubble/Tween.start()
-func update_name(character, color='#FFFFFF'):
+func update_name(character, color: Color = Color.white) -> void:
if character.has('name'):
var parsed_name = character['name']
if character.has('display_name'):
if character['display_name'] != '':
parsed_name = character['display_name']
if character.has('color'):
- color = '#' + character['color'].to_html()
- $TextBubble/NameLabel.bbcode_text = '[color=' + color + ']' + parsed_name + '[/color]'
+ color = character['color']
+ parsed_name = parse_definitions(parsed_name)
+ $TextBubble/NameLabel.visible = true
+ # Hack to reset the size
+ $TextBubble/NameLabel.rect_min_size = Vector2(0, 0)
+ $TextBubble/NameLabel.rect_size = Vector2(-1, 40)
+ # Setting the color and text
+ $TextBubble/NameLabel.text = parsed_name
+ $TextBubble/NameLabel.set('custom_colors/font_color', color)
else:
- $TextBubble/NameLabel.bbcode_text = ''
- return true
+ $TextBubble/NameLabel.visible = false
func update_text(text):
# Updating the text and starting the animation from 0
- $TextBubble/RichTextLabel.bbcode_text = self.parse_definitions(text)
+ $TextBubble/RichTextLabel.bbcode_text = parse_definitions(text)
$TextBubble/RichTextLabel.percent_visible = 0
# The call to this function needs to be deferred.
@@ -337,6 +344,7 @@ func on_timeline_end():
DialogicSingleton.set_current_timeline('')
emit_signal("event_end", "timeline")
+
func load_dialog(skip_add = false):
# Emitting signals
if dialog_script.has('events'):
@@ -361,7 +369,8 @@ func load_dialog(skip_add = false):
func reset_dialog_extras():
- $TextBubble/NameLabel.bbcode_text = ''
+ $TextBubble/NameLabel.text = ''
+ $TextBubble/NameLabel.visible = false
func get_character(character_id):
@@ -450,10 +459,19 @@ func event_handler(event: Dictionary):
go_to_next_event()
{'audio'}, {'audio', 'file'}:
emit_signal("event_start", "audio", event)
- if event['audio'] == 'play':
+ if event['audio'] == 'play' and 'file' in event.keys() and not event['file'].empty():
$FX/AudioStreamPlayer.stream = load(event['file'])
$FX/AudioStreamPlayer.play()
- # Todo: audio stop
+ else:
+ $FX/AudioStreamPlayer.stop()
+ go_to_next_event()
+ {'background-music'}, {'background-music', 'file'}:
+ emit_signal("event_start", "background-music", event)
+ if event['background-music'] == 'play' and 'file' in event.keys() and not event['file'].empty():
+ var stream: AudioStream = load(event['file'])
+ $FX/BackgroundMusic.crossfade_to(stream)
+ else:
+ $FX/BackgroundMusic.fade_out()
go_to_next_event()
{'endbranch', ..}:
emit_signal("event_start", "endbranch", event)
@@ -500,9 +518,12 @@ func event_handler(event: Dictionary):
else:
# condition met, entering branch
go_to_next_event()
- {'set_value', 'definition'}:
+ {'set_value', 'definition', ..}:
emit_signal("event_start", "set_value", event)
- DialogicSingleton.set_variable_from_id(event['definition'], event['set_value'])
+ var operation = '='
+ if 'operation' in event and not event['operation'].empty():
+ operation = event["operation"]
+ DialogicSingleton.set_variable_from_id(event['definition'], event['set_value'], operation)
go_to_next_event()
_:
visible = false
@@ -650,6 +671,7 @@ func deferred_resize(current_size, result):
if current_size != $TextBubble.rect_size:
resize_main()
+
func load_theme(filename):
var theme = DialogicResources.get_theme_config(filename)
@@ -659,11 +681,11 @@ func load_theme(filename):
# Text
var theme_font = load(theme.get_value('text', 'font', 'res://addons/dialogic/Fonts/DefaultFont.tres'))
$TextBubble/RichTextLabel.set('custom_fonts/normal_font', theme_font)
- $TextBubble/NameLabel.set('custom_fonts/normal_font', theme_font)
+ $TextBubble/NameLabel.set('custom_fonts/font', theme_font)
var text_color = Color(theme.get_value('text', 'color', '#ffffffff'))
$TextBubble/RichTextLabel.set('custom_colors/default_color', text_color)
- $TextBubble/NameLabel.set('custom_colors/default_color', text_color)
+ $TextBubble/NameLabel.set('custom_colors/font_color', text_color)
$TextBubble/RichTextLabel.set('custom_colors/font_color_shadow', Color('#00ffffff'))
$TextBubble/NameLabel.set('custom_colors/font_color_shadow', Color('#00ffffff'))
@@ -671,13 +693,11 @@ func load_theme(filename):
if theme.get_value('text', 'shadow', false):
var text_shadow_color = Color(theme.get_value('text', 'shadow_color', '#9e000000'))
$TextBubble/RichTextLabel.set('custom_colors/font_color_shadow', text_shadow_color)
- $TextBubble/NameLabel.set('custom_colors/font_color_shadow', text_shadow_color)
var shadow_offset = theme.get_value('text', 'shadow_offset', Vector2(2,2))
$TextBubble/RichTextLabel.set('custom_constants/shadow_offset_x', shadow_offset.x)
- $TextBubble/NameLabel.set('custom_constants/shadow_offset_x', shadow_offset.x)
$TextBubble/RichTextLabel.set('custom_constants/shadow_offset_y', shadow_offset.y)
- $TextBubble/NameLabel.set('custom_constants/shadow_offset_y', shadow_offset.y)
+
# Text speed
text_speed = theme.get_value('text','speed', 2) * 0.01
@@ -705,7 +725,19 @@ func load_theme(filename):
$DefinitionInfo/VBoxContainer/Title.set('custom_fonts/normal_font', definitions_font)
$DefinitionInfo/VBoxContainer/Content.set('custom_fonts/normal_font', definitions_font)
$DefinitionInfo/VBoxContainer/Extra.set('custom_fonts/normal_font', definitions_font)
-
+
+ # Character Name
+ $TextBubble/NameLabel/ColorRect.visible = theme.get_value('name', 'background_visible', false)
+ $TextBubble/NameLabel/ColorRect.color = Color(theme.get_value('name', 'background', '#282828'))
+ $TextBubble/NameLabel/TextureRect.visible = theme.get_value('name', 'image_visible', false)
+ $TextBubble/NameLabel/TextureRect.texture = load(theme.get_value('name','image', "res://addons/dialogic/Images/background/background-2.png"))
+ var name_shadow_offset = theme.get_value('name', 'shadow_offset', Vector2(2,2))
+ if theme.get_value('name', 'shadow_visible', false):
+ $TextBubble/NameLabel.set('custom_colors/font_color_shadow', Color(theme.get_value('name', 'shadow', '#9e000000')))
+ $TextBubble/NameLabel.set('custom_constants/shadow_offset_x', name_shadow_offset.x)
+ $TextBubble/NameLabel.set('custom_constants/shadow_offset_y', name_shadow_offset.y)
+ $TextBubble/NameLabel.rect_position.y = theme.get_value('name', 'bottom_gap', 48) * -1
+
return theme
diff --git a/addons/dialogic/Other/DialogicSingleton.gd b/addons/dialogic/Other/DialogicSingleton.gd
index 49ce4f6..b72e955 100644
--- a/addons/dialogic/Other/DialogicSingleton.gd
+++ b/addons/dialogic/Other/DialogicSingleton.gd
@@ -50,10 +50,35 @@ func set_variable(name: String, value) -> void:
d['value'] = str(value)
-func set_variable_from_id(id: String, value) -> void:
+func set_variable_from_id(id: String, value: String, operation: String) -> void:
+ var target_def: Dictionary;
for d in current_definitions['variables']:
if d['id'] == id:
- d['value'] = str(value)
+ target_def = d;
+ if target_def != null:
+ var converted_set_value = value
+ var converted_target_value = target_def['value']
+ var is_number = converted_set_value.is_valid_float() and converted_target_value.is_valid_float()
+ if is_number:
+ converted_set_value = float(value)
+ converted_target_value = float(target_def['value'])
+ var result = target_def['value']
+ # Do nothing for -, * and / operations on string
+ match operation:
+ '=':
+ result = converted_set_value
+ '+':
+ result = converted_target_value + converted_set_value
+ '-':
+ if is_number:
+ result = converted_target_value - converted_set_value
+ '*':
+ if is_number:
+ result = converted_target_value * converted_set_value
+ '/':
+ if is_number:
+ result = converted_target_value / converted_set_value
+ target_def['value'] = str(result)
func get_glossary(name: String) -> Dictionary:
diff --git a/dialogic/themes/theme-1616657646.cfg b/dialogic/themes/theme-1616657646.cfg
index 453bc55..b2f4d18 100644
--- a/dialogic/themes/theme-1616657646.cfg
+++ b/dialogic/themes/theme-1616657646.cfg
@@ -10,3 +10,9 @@ color="#ffd11515"
[settings]
name="theme_questions"
+
+[name]
+
+auto_color=true
+image_visible=true
+shadow_visible=true
diff --git a/dialogic/themes/theme-1616657657.cfg b/dialogic/themes/theme-1616657657.cfg
index 52e4632..0c611ed 100644
--- a/dialogic/themes/theme-1616657657.cfg
+++ b/dialogic/themes/theme-1616657657.cfg
@@ -15,3 +15,12 @@ size=Vector2( 910, 167 )
[text]
margin=Vector2( 20, 10 )
+alignment="Left"
+
+[definitions]
+
+color="#ffffffff"
+
+[name]
+
+image_visible=true
diff --git a/project.godot b/project.godot
index a12a77f..6e95681 100644
--- a/project.godot
+++ b/project.godot
@@ -14,6 +14,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://addons/dialogic/Other/DialogicClass.gd"
}, {
+"base": "Control",
+"class": "DialogicBackgroundMusic",
+"language": "GDScript",
+"path": "res://addons/dialogic/Nodes/BackgroundMusic.gd"
+}, {
"base": "Node",
"class": "DialogicDefinitionsUtil",
"language": "GDScript",
@@ -31,6 +36,7 @@ _global_script_classes=[ {
} ]
_global_script_class_icons={
"Dialogic": "",
+"DialogicBackgroundMusic": "",
"DialogicDefinitionsUtil": "",
"DialogicResources": "",
"DialogicUtil": ""