Updated dialogic

This commit is contained in:
MaddoScientisto 2026-01-05 16:00:41 +01:00
commit cbb82512ee
483 changed files with 5743 additions and 2177 deletions

View file

@ -1 +1 @@
uid://drwfgv17x3478
uid://bcsda7vbawlgv

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://cfcs7lb6gqnmd"]
[ext_resource type="Script" uid="uid://drwfgv17x3478" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"]
[ext_resource type="Script" uid="uid://bcsda7vbawlgv" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_exports.gd" id="1_isys8"]
[node name="Settings" type="VBoxContainer"]
custom_minimum_size = Vector2(0, 35)

View file

@ -10,13 +10,13 @@ func _get_title() -> String:
func _load_portrait_data(data:Dictionary) -> void:
%IgnoreScale.set_pressed_no_signal(data.get('ignore_char_scale', false))
%PortraitScale.value = data.get('scale', 1.0)*100
%PortraitScale.set_value(data.get('scale', 1.0)*100)
%PortraitOffset.set_value(data.get('offset', Vector2()))
%PortraitOffset._load_display_info({'step':1})
%PortraitMirror.set_pressed_no_signal(data.get('mirror', false))
func _on_portrait_scale_value_changed(value:float) -> void:
func _on_portrait_scale_value_changed(_property:String, value:float) -> void:
var data: Dictionary = selected_item.get_metadata(0)
data['scale'] = value/100.0
update_preview.emit()
@ -37,7 +37,7 @@ func _on_ignore_scale_toggled(button_pressed:bool) -> void:
changed.emit()
func _on_portrait_offset_value_changed(property:String, value:Vector2) -> void:
func _on_portrait_offset_value_changed(_property:String, value:Vector2) -> void:
var data: Dictionary = selected_item.get_metadata(0)
data['offset'] = value
update_preview.emit()

View file

@ -1 +1 @@
uid://kq0tngakxiwn
uid://uv6dx3sofwae

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://crke8suvv52c6"]
[gd_scene load_steps=4 format=3 uid="uid://crke8suvv52c6"]
[ext_resource type="Script" uid="uid://kq0tngakxiwn" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"]
[ext_resource type="Script" uid="uid://uv6dx3sofwae" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_layout.gd" id="1_76vf2"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="2_c8kyi"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="2_daw3l"]
[node name="Layout" type="HFlowContainer"]
offset_right = 428.0
@ -25,13 +26,13 @@ layout_mode = 2
layout_mode = 2
text = "Scale:"
[node name="PortraitScale" type="SpinBox" parent="HBoxContainer"]
[node name="PortraitScale" parent="HBoxContainer" instance=ExtResource("2_daw3l")]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "A scale to be applied on top of the main scale
(unless ignore main scale is pressed)."
value = 100.0
allow_greater = true
mode = 1
step = 1.0
min_value = 0.0
max_value = 100.0
suffix = "%"
[node name="HBoxContainer2" type="HBoxContainer" parent="."]

View file

@ -1 +1 @@
uid://b2026s2q7x8d4
uid://busjn8oo7kl1s

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://djq4aasoihexj"]
[ext_resource type="Script" uid="uid://b2026s2q7x8d4" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"]
[ext_resource type="Script" uid="uid://busjn8oo7kl1s" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main.gd" id="1_ht8lu"]
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/field_file.tscn" id="2_k8xs0"]
[ext_resource type="PackedScene" uid="uid://b1wn8r84uh11b" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.tscn" id="3_ngvgq"]

View file

@ -1 +1 @@
uid://tmtk8wwimgxt
uid://cp0o6sycac85b

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://ba5w02lm3ewkj"]
[ext_resource type="Script" uid="uid://tmtk8wwimgxt" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.gd" id="1_mttrr"]
[ext_resource type="Script" uid="uid://cp0o6sycac85b" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.gd" id="1_mttrr"]
[node name="MainExports" type="VBoxContainer"]
offset_right = 374.0

View file

@ -1 +1 @@
uid://ckh08sqv1a081
uid://c0nilv2pybryh

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://bnkck3hocbkk5"]
[ext_resource type="Script" uid="uid://ckh08sqv1a081" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd" id="1_3e1i1"]
[ext_resource type="Script" uid="uid://c0nilv2pybryh" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.gd" id="1_3e1i1"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_cxfqm"]
[sub_resource type="Image" id="Image_ywoka"]

View file

@ -19,7 +19,7 @@ func _ready() -> void:
# Setting up Default Portrait Picker
%DefaultPortraitPicker.resource_icon = load("res://addons/dialogic/Editor/Images/Resources/portrait.svg")
%DefaultPortraitPicker.get_suggestions_func = suggest_portraits
%DefaultPortraitPicker.suggestions_func = suggest_portraits
## Make sure preview get's updated when portrait settings change
@ -33,7 +33,7 @@ func main_portrait_settings_update(_something=null, _value=null) -> void:
character_editor.something_changed()
func default_portrait_changed(property:String, value:String) -> void:
func default_portrait_changed(_property:String, value:String) -> void:
character_editor.current_resource.default_portrait = value
character_editor.update_default_portrait_star(value)
@ -47,7 +47,7 @@ func _load_character(resource:DialogicCharacter) -> void:
loading = true
%DefaultPortraitPicker.set_value(resource.default_portrait)
%MainScale.value = 100*resource.scale
%MainScale.set_value(100*resource.scale)
%MainOffset.set_value(resource.offset)
%MainMirror.button_pressed = resource.mirror
loading = false
@ -69,9 +69,8 @@ func _save_changes(resource:DialogicCharacter) -> DialogicCharacter:
## Get suggestions for DefaultPortraitPicker
func suggest_portraits(search:String) -> Dictionary:
func suggest_portraits(_search:String) -> Dictionary:
var suggestions := {}
for portrait in character_editor.get_updated_portrait_dict().keys():
suggestions[portrait] = {'value':portrait}
return suggestions

View file

@ -1 +1 @@
uid://0pki4ffx8ix4
uid://yulfiomudcob

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://cmrgbo8qi145o"]
[gd_scene load_steps=5 format=3 uid="uid://cmrgbo8qi145o"]
[ext_resource type="Script" uid="uid://0pki4ffx8ix4" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"]
[ext_resource type="Script" uid="uid://yulfiomudcob" path="res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.gd" id="1_6sxsl"]
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="2_birla"]
[ext_resource type="PackedScene" uid="uid://dtimnsj014cu" path="res://addons/dialogic/Editor/Events/Fields/field_vector2.tscn" id="3_vcvin"]
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="4_w4pvv"]
[node name="Portraits" type="GridContainer"]
offset_right = 453.0
@ -29,8 +30,9 @@ layout_mode = 2
size_flags_vertical = 0
text = "Main Scale"
[node name="MainScale" type="SpinBox" parent="."]
[node name="MainScaleOld" type="SpinBox" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 8
value = 100.0
@ -38,6 +40,16 @@ allow_greater = true
alignment = 1
suffix = "%"
[node name="MainScale" parent="." instance=ExtResource("4_w4pvv")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 8
mode = 1
step = 1.0
min_value = 0.0
max_value = 100.0
suffix = "%"
[node name="Label2" type="Label" parent="."]
layout_mode = 2
size_flags_vertical = 0

View file

@ -71,9 +71,9 @@ func _open_resource(resource:Resource) -> void:
load_portrait_tree()
loading = false
character_loaded.emit(resource.resource_path)
character_loaded.emit(current_resource.resource_path)
%CharacterName.text = DialogicResourceUtil.get_unique_identifier(resource.resource_path)
%CharacterName.text = current_resource.get_identifier()
$NoCharacterScreen.hide()
%PortraitChangeInfo.hide()
@ -119,6 +119,9 @@ func _save() -> void:
## Saves a new empty character to the given path
func new_character(path: String) -> void:
if not path.ends_with(".dch"):
path = path.trim_suffix(".")
path += ".dch"
var resource := DialogicCharacter.new()
resource.resource_path = path
resource.display_name = path.get_file().trim_suffix("."+path.get_extension())
@ -165,6 +168,7 @@ func _ready() -> void:
## Add general tabs
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_general.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_section_portraits.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/character_prefix_suffix.tscn").instantiate(), %MainSettingsSections)
add_settings_section(load("res://addons/dialogic/Editor/CharacterEditor/char_edit_p_section_main_exports.tscn").instantiate(), %PortraitSettingsSection)
@ -188,10 +192,12 @@ func _ready() -> void:
func add_settings_section(edit:Control, parent:Node) -> void:
edit.changed.connect(something_changed)
edit.character_editor = self
if edit.has_signal('update_preview'):
edit.update_preview.connect(update_preview)
var button: Button
if edit._show_title():
var hbox := HBoxContainer.new()
hbox.name = edit._get_title()+"BOX"
@ -365,7 +371,7 @@ func add_portrait(portrait_name:String='New portrait', portrait_data:Dictionary=
func add_portrait_group() -> void:
var parent_item: TreeItem = %PortraitTree.get_root()
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0).has('group'):
if %PortraitTree.get_selected() and %PortraitTree.get_selected().get_metadata(0) and %PortraitTree.get_selected().get_metadata(0).has('group'):
parent_item = %PortraitTree.get_selected()
var item: TreeItem = %PortraitTree.add_portrait_group("Group", parent_item)
item.set_meta('new', true)
@ -543,7 +549,7 @@ func report_name_change(item: TreeItem) -> void:
editors_manager.reference_manager.add_portrait_ref_change(
item.get_meta('previous_name'),
%PortraitTree.get_full_item_name(item),
[DialogicResourceUtil.get_unique_identifier(current_resource.resource_path)])
[current_resource.get_identifier()])
item.set_meta('previous_name', %PortraitTree.get_full_item_name(item))
%PortraitChangeInfo.show()

View file

@ -1 +1 @@
uid://b05ouwe0s28rb
uid://cwhe7tpe75oh7

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=11 format=3 uid="uid://dlskc36c5hrwv"]
[ext_resource type="Script" uid="uid://b05ouwe0s28rb" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="Script" uid="uid://cwhe7tpe75oh7" path="res://addons/dialogic/Editor/CharacterEditor/character_editor.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="2_uhhqs"]
[ext_resource type="Script" uid="uid://b0elpsugbconk" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Script" uid="uid://deliic6d8vajo" path="res://addons/dialogic/Editor/CharacterEditor/character_editor_portrait_tree.gd" id="2_vad0i"]
[ext_resource type="Texture2D" uid="uid://babwe22dqjta" path="res://addons/dialogic/Editor/Images/Pieces/add-folder.svg" id="3_v1qnr"]
[sub_resource type="Image" id="Image_r5ayh"]

View file

@ -5,6 +5,7 @@ extends Control
## Base class for all character editor main sections. Methods should be overriden.
## Emit this, if something changed
@warning_ignore("unused_signal") # this is used by extending scripts
signal changed
## Reference to the character editor, set when instantiated
@ -30,7 +31,7 @@ func _start_opened() -> bool:
## Overwrite to load all the information from the character into this section.
func _load_character(resource:DialogicCharacter) -> void:
func _load_character(_resource:DialogicCharacter) -> void:
pass

View file

@ -1 +1 @@
uid://cm0wi5jwnqitc
uid://wltbab3qq63b

View file

@ -1 +1 @@
uid://d11n63mblxvlw
uid://ckblurnjla80i

View file

@ -1 +1 @@
uid://b0elpsugbconk
uid://deliic6d8vajo

View file

@ -0,0 +1,79 @@
@tool
class_name DialogicCharacterPrefixSuffixSection
extends DialogicCharacterEditorMainSection
## Character Editor Section for setting the prefix and suffix of a character.
##
## loads and sets the prefix and suffix of a character.
## Provides [const PREFIX_CUSTOM_KEY] and [const SUFFIX_CUSTOM_KEY] to
## access the `custom_info` dictionary of the [class DialogicCharacter].
@export var prefix_input: LineEdit
@export var suffix_input: LineEdit
## We won't force any prefixes or suffixes onto the player,
## to ensure their games are working as previously when updating.
const DEFAULT_PREFIX = ""
const DEFAULT_SUFFIX = ""
## `custom_info` dictionary keys for the prefix.
const PREFIX_CUSTOM_KEY = "prefix"
## `custom_info` dictionary keys for the prefix.
const SUFFIX_CUSTOM_KEY = "suffix"
var suffix := ""
var prefix := ""
func _ready() -> void:
suffix_input.text_changed.connect(_suffix_changed)
prefix_input.text_changed.connect(_prefix_changed)
func _suffix_changed(text: String) -> void:
suffix = text
func _prefix_changed(text: String) -> void:
prefix = text
func _get_title() -> String:
return "Character Prefix & Suffix"
func _show_title() -> bool:
return true
func _start_opened() -> bool:
return false
func _load_portrait_data(portrait_data: Dictionary) -> void:
_load_prefix_data(portrait_data)
## We load the prefix and suffix from the character's `custom_info` dictionary.
func _load_character(resource: DialogicCharacter) -> void:
_load_prefix_data(resource.custom_info)
func _load_prefix_data(data: Dictionary) -> void:
suffix = data.get(SUFFIX_CUSTOM_KEY, DEFAULT_SUFFIX)
prefix = data.get(PREFIX_CUSTOM_KEY, DEFAULT_PREFIX)
suffix_input.text = suffix
prefix_input.text = prefix
## Whenever the user makes a save to the character, we save the prefix and suffix.
func _save_changes(character: DialogicCharacter) -> DialogicCharacter:
if not character:
printerr("[Dialogic] Unable to save Prefix and Suffix, the character is missing.")
return character
character.custom_info[PREFIX_CUSTOM_KEY] = prefix
character.custom_info[SUFFIX_CUSTOM_KEY] = suffix
return character

View file

@ -0,0 +1 @@
uid://i1ujoar8jf80

View file

@ -0,0 +1,48 @@
[gd_scene load_steps=3 format=3 uid="uid://1ctcs6ywjjtd"]
[ext_resource type="PackedScene" uid="uid://dbpkta2tjsqim" path="res://addons/dialogic/Editor/Common/hint_tooltip_icon.tscn" id="1_o3alv"]
[ext_resource type="Script" uid="uid://i1ujoar8jf80" path="res://addons/dialogic/Editor/CharacterEditor/character_prefix_suffix.gd" id="1_tkxff"]
[node name="CharacterPrefixSuffix" type="GridContainer" node_paths=PackedStringArray("prefix_input", "suffix_input")]
offset_right = 121.0
offset_bottom = 66.0
columns = 2
script = ExtResource("1_tkxff")
prefix_input = NodePath("PrefixInput")
suffix_input = NodePath("SuffixInput")
[node name="Prefix" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="Prefix"]
layout_mode = 2
text = "Prefix"
[node name="HintTooltip" parent="Prefix" instance=ExtResource("1_o3alv")]
layout_mode = 2
texture = null
hint_text = "If a character speaks, this appears before their text.
Example: Color Tags or Quotation Marks."
[node name="PrefixInput" type="LineEdit" parent="."]
layout_mode = 2
size_flags_horizontal = 3
caret_blink = true
[node name="Suffix" type="HBoxContainer" parent="."]
layout_mode = 2
[node name="Label" type="Label" parent="Suffix"]
layout_mode = 2
text = "Suffix"
[node name="HintTooltip" parent="Suffix" instance=ExtResource("1_o3alv")]
layout_mode = 2
texture = null
hint_text = "If a character speaks, this appears after their text.
Example: Color Tags or Quotation Marks."
[node name="SuffixInput" type="LineEdit" parent="."]
layout_mode = 2
size_flags_horizontal = 3
caret_blink = true

View file

@ -1 +1 @@
uid://duj68ruvoapq0
uid://iwv7qff6g0f0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=11 format=3 uid="uid://b1wn8r84uh11b"]
[ext_resource type="Script" uid="uid://duj68ruvoapq0" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.gd" id="1_an6nc"]
[ext_resource type="Script" uid="uid://iwv7qff6g0f0" path="res://addons/dialogic/Editor/CharacterEditor/portrait_scene_browser.gd" id="1_an6nc"]
[sub_resource type="Gradient" id="Gradient_0o1u0"]
colors = PackedColorArray(0.100572, 0.303996, 0.476999, 1, 0.296448, 0.231485, 0.52887, 1)