First work on dialogic, resized guild, and started implementing portraits.
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
@tool
|
||||
extends DialogicCharacterEditorMainSection
|
||||
|
||||
## Character editor section that allows editing typing sound moods.
|
||||
|
||||
var current_mood := ''
|
||||
var current_moods_info := {}
|
||||
var default_mood := ''
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
hint_text = 'Typing sound moods allow you to vary the "typing" sounds of your character. \nThey can be changed based on the portrait or with the [mood=something] text effect.'
|
||||
|
||||
|
||||
func _get_title() -> String:
|
||||
return "Typing Sounds"
|
||||
|
||||
################################################################################
|
||||
## COMMUNICATION WITH EDITOR
|
||||
################################################################################
|
||||
|
||||
func _load_character(character:DialogicCharacter):
|
||||
default_mood = character.custom_info.get('sound_mood_default', '')
|
||||
|
||||
current_moods_info = character.custom_info.get('sound_moods', {}).duplicate(true)
|
||||
|
||||
current_mood = ""
|
||||
update_mood_list()
|
||||
|
||||
|
||||
func _save_changes(character:DialogicCharacter) -> DialogicCharacter:
|
||||
# Quickly save latest mood
|
||||
if current_mood:
|
||||
current_moods_info[current_mood] = get_mood_info()
|
||||
|
||||
character.custom_info['sound_mood_default'] = default_mood
|
||||
character.custom_info['sound_moods'] = current_moods_info.duplicate(true)
|
||||
return character
|
||||
|
||||
|
||||
func get_portrait_data() -> Dictionary:
|
||||
if character_editor.selected_item and is_instance_valid(character_editor.selected_item):
|
||||
return character_editor.selected_item.get_metadata(0)
|
||||
return {}
|
||||
|
||||
|
||||
func set_portrait_data(data:Dictionary) -> void:
|
||||
if character_editor.selected_item and is_instance_valid(character_editor.selected_item):
|
||||
character_editor.selected_item.set_metadata(0, data)
|
||||
|
||||
|
||||
################################################################################
|
||||
## OWN STUFF
|
||||
################################################################################
|
||||
|
||||
func _ready() -> void:
|
||||
%ListPanel.self_modulate = get_theme_color("base_color", "Editor")
|
||||
%Add.icon = get_theme_icon("Add", "EditorIcons")
|
||||
%Delete.icon = get_theme_icon("Remove", "EditorIcons")
|
||||
%Duplicate.icon = get_theme_icon("Duplicate", "EditorIcons")
|
||||
%Play.icon = get_theme_icon("Play", "EditorIcons")
|
||||
%Default.icon = get_theme_icon("NonFavorite", "EditorIcons")
|
||||
|
||||
%NameWarning.texture = get_theme_icon("StatusWarning", "EditorIcons")
|
||||
|
||||
|
||||
func update_mood_list(selected_name := "") -> void:
|
||||
%MoodList.clear()
|
||||
|
||||
for mood in current_moods_info:
|
||||
var idx: int = %MoodList.add_item(mood, get_theme_icon("AudioStreamPlayer", "EditorIcons"))
|
||||
if mood == selected_name:
|
||||
%MoodList.select(idx)
|
||||
_on_mood_list_item_selected(idx)
|
||||
if !%MoodList.is_anything_selected() and %MoodList.item_count:
|
||||
%MoodList.select(0)
|
||||
_on_mood_list_item_selected(0)
|
||||
|
||||
if %MoodList.item_count == 0:
|
||||
current_mood = ""
|
||||
|
||||
%Delete.disabled = !%MoodList.is_anything_selected()
|
||||
%Play.disabled = !%MoodList.is_anything_selected()
|
||||
%Duplicate.disabled = !%MoodList.is_anything_selected()
|
||||
%Default.disabled = !%MoodList.is_anything_selected()
|
||||
%Settings.visible = %MoodList.is_anything_selected()
|
||||
|
||||
%MoodList.custom_minimum_size.y = min(%MoodList.item_count*45, 100)
|
||||
%MoodList.visible = %MoodList.item_count != 0
|
||||
|
||||
character_editor.get_settings_section_by_name('Typing Sound Mood', false).update_visibility(%MoodList.item_count != 0)
|
||||
|
||||
|
||||
|
||||
func _input(event:InputEvent) -> void:
|
||||
if !is_visible_in_tree() or (get_viewport().gui_get_focus_owner() and !name+'/' in str(get_viewport().gui_get_focus_owner().get_path())):
|
||||
return
|
||||
if event is InputEventKey and event.keycode == KEY_F2 and event.pressed:
|
||||
if %MoodList.is_anything_selected():
|
||||
%Name.grab_focus()
|
||||
%Name.select_all()
|
||||
get_viewport().set_input_as_handled()
|
||||
|
||||
|
||||
func _on_mood_list_item_selected(index:int) -> void:
|
||||
if current_mood:
|
||||
current_moods_info[current_mood] = get_mood_info()
|
||||
|
||||
current_mood = %MoodList.get_item_text(index)
|
||||
load_mood_info(current_moods_info[current_mood])
|
||||
|
||||
%Delete.disabled = !%MoodList.is_anything_selected()
|
||||
%Play.disabled = !%MoodList.is_anything_selected()
|
||||
%Duplicate.disabled = !%MoodList.is_anything_selected()
|
||||
%Default.disabled = !%MoodList.is_anything_selected()
|
||||
%Settings.visible = %MoodList.is_anything_selected()
|
||||
|
||||
|
||||
func load_mood_info(dict:Dictionary) -> void:
|
||||
%Name.text = dict.get('name', '')
|
||||
%NameWarning.hide()
|
||||
set_default_button(default_mood == dict.get('name', ''))
|
||||
%SoundFolder.set_value(dict.get('sound_path', ''))
|
||||
%Mode.select(dict.get('mode', 0))
|
||||
%PitchBase.set_value(dict.get('pitch_base', 1))
|
||||
%PitchVariance.set_value(dict.get('pitch_variance', 0))
|
||||
%VolumeBase.set_value(dict.get('volume_base', 0))
|
||||
%VolumeVariance.set_value(dict.get('volume_variance', 0))
|
||||
%Skip.set_value(dict.get('skip_characters', 0))
|
||||
|
||||
|
||||
func get_mood_info() -> Dictionary:
|
||||
var dict := {}
|
||||
dict['name'] = %Name.text
|
||||
dict['sound_path'] = %SoundFolder.current_value
|
||||
dict['mode'] = %Mode.selected
|
||||
dict['pitch_base'] = %PitchBase.value
|
||||
dict['pitch_variance'] = %PitchVariance.value
|
||||
dict['volume_base'] = %VolumeBase.value
|
||||
dict['volume_variance'] = %VolumeVariance.value
|
||||
dict['skip_characters'] = %Skip.value
|
||||
return dict
|
||||
|
||||
|
||||
func _on_add_pressed() -> void:
|
||||
if !current_mood.is_empty():
|
||||
current_moods_info[current_mood] = get_mood_info()
|
||||
|
||||
var new_name := 'Mood '
|
||||
var counter := 1
|
||||
while new_name+str(counter) in current_moods_info:
|
||||
counter+=1
|
||||
new_name += str(counter)
|
||||
|
||||
current_moods_info[new_name] = {'name':new_name}
|
||||
|
||||
update_mood_list(new_name)
|
||||
|
||||
|
||||
func _on_duplicate_pressed() -> void:
|
||||
if !current_mood.is_empty():
|
||||
current_moods_info[current_mood] = get_mood_info()
|
||||
|
||||
current_moods_info[current_mood+"_copy"] = get_mood_info()
|
||||
current_moods_info[current_mood+"_copy"].name = current_mood+"_copy"
|
||||
update_mood_list(current_mood+"_copy")
|
||||
|
||||
|
||||
func _on_delete_pressed() -> void:
|
||||
if current_mood.is_empty():
|
||||
return
|
||||
current_moods_info.erase(current_mood)
|
||||
current_mood = ""
|
||||
update_mood_list()
|
||||
|
||||
|
||||
func _on_name_text_changed(new_text:String) -> void:
|
||||
if new_text.is_empty():
|
||||
%NameWarning.show()
|
||||
%NameWarning.tooltip_text = "Name cannot be empty!"
|
||||
elif new_text in current_moods_info and new_text != current_mood:
|
||||
%NameWarning.show()
|
||||
%NameWarning.tooltip_text = "Name is already in use!"
|
||||
else:
|
||||
%NameWarning.hide()
|
||||
|
||||
|
||||
func _on_name_text_submitted(new_text:String) -> void:
|
||||
if %NameWarning.visible:
|
||||
new_text = current_mood
|
||||
%NameWarning.hide()
|
||||
else:
|
||||
%MoodList.set_item_text(%MoodList.get_selected_items()[0], new_text)
|
||||
current_moods_info.erase(current_mood)
|
||||
current_moods_info[new_text] = get_mood_info()
|
||||
current_mood = new_text
|
||||
|
||||
|
||||
func _on_name_focus_exited() -> void:
|
||||
_on_name_text_submitted(%Name.text)
|
||||
|
||||
|
||||
func _on_default_toggled(button_pressed:bool) -> void:
|
||||
if button_pressed:
|
||||
default_mood = current_mood
|
||||
else:
|
||||
default_mood = ''
|
||||
set_default_button(button_pressed)
|
||||
|
||||
|
||||
func set_default_button(enabled:bool) -> void:
|
||||
%Default.set_pressed_no_signal(enabled)
|
||||
if enabled:
|
||||
%Default.icon = get_theme_icon("Favorites", "EditorIcons")
|
||||
else:
|
||||
%Default.icon = get_theme_icon("NonFavorite", "EditorIcons")
|
||||
|
||||
|
||||
func preview() -> void:
|
||||
$Preview.load_overwrite(get_mood_info())
|
||||
var preview_timer := Timer.new()
|
||||
DialogicUtil.update_timer_process_callback(preview_timer)
|
||||
add_child(preview_timer)
|
||||
preview_timer.start(ProjectSettings.get_setting('dialogic/text/letter_speed', 0.01))
|
||||
|
||||
for i in range(20):
|
||||
$Preview._on_continued_revealing_text("a")
|
||||
await preview_timer.timeout
|
||||
|
||||
preview_timer.queue_free()
|
||||
@@ -0,0 +1 @@
|
||||
uid://bnvr6kitj8u3j
|
||||
@@ -0,0 +1,235 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://8ad1pwbjuqpt"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/character_moods_settings.gd" id="1_3px07"]
|
||||
[ext_resource type="PackedScene" uid="uid://7mvxuaulctcq" path="res://addons/dialogic/Editor/Events/Fields/field_file.tscn" id="2_e1vyd"]
|
||||
[ext_resource type="PackedScene" uid="uid://kdpp3mibml33" path="res://addons/dialogic/Editor/Events/Fields/field_number.tscn" id="3_yjcns"]
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/node_type_sound.gd" id="5_yscws"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y7t05"]
|
||||
content_margin_left = 10.0
|
||||
content_margin_top = 10.0
|
||||
content_margin_right = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
|
||||
[sub_resource type="Image" id="Image_ylh4a"]
|
||||
data = {
|
||||
"data": PackedByteArray(255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 94, 94, 127, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 231, 255, 94, 94, 54, 255, 94, 94, 57, 255, 93, 93, 233, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 93, 93, 41, 255, 255, 255, 0, 255, 255, 255, 0, 255, 97, 97, 42, 255, 93, 93, 233, 255, 93, 93, 232, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 44, 255, 255, 255, 0, 255, 97, 97, 42, 255, 97, 97, 42, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 96, 96, 45, 255, 93, 93, 235, 255, 94, 94, 234, 255, 95, 95, 43, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 93, 93, 235, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 233, 255, 95, 95, 59, 255, 96, 96, 61, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 93, 93, 255, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0),
|
||||
"format": "RGBA8",
|
||||
"height": 16,
|
||||
"mipmaps": false,
|
||||
"width": 16
|
||||
}
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_drtd2"]
|
||||
image = SubResource("Image_ylh4a")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_40fkd"]
|
||||
content_margin_top = 10.0
|
||||
content_margin_bottom = 10.0
|
||||
bg_color = Color(1, 1, 1, 0.0588235)
|
||||
border_width_left = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[node name="Typing Sounds" type="VBoxContainer"]
|
||||
offset_right = 443.0
|
||||
offset_bottom = 144.0
|
||||
script = ExtResource("1_3px07")
|
||||
|
||||
[node name="VBox" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ListPanel" type="PanelContainer" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_y7t05")
|
||||
|
||||
[node name="Vbox" type="VBoxContainer" parent="VBox/ListPanel"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBox/ListPanel/Vbox"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Add" type="Button" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Add type sound mood"
|
||||
icon = SubResource("ImageTexture_drtd2")
|
||||
|
||||
[node name="Duplicate" type="Button" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Duplicate"
|
||||
icon = SubResource("ImageTexture_drtd2")
|
||||
|
||||
[node name="Delete" type="Button" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Delete mood"
|
||||
icon = SubResource("ImageTexture_drtd2")
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Play" type="Button" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Preview"
|
||||
icon = SubResource("ImageTexture_drtd2")
|
||||
|
||||
[node name="Default" type="Button" parent="VBox/ListPanel/Vbox/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Default"
|
||||
toggle_mode = true
|
||||
icon = SubResource("ImageTexture_drtd2")
|
||||
|
||||
[node name="MoodList" type="ItemList" parent="VBox/ListPanel/Vbox"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Settings" type="PanelContainer" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_40fkd")
|
||||
|
||||
[node name="Grid" type="GridContainer" parent="VBox/Settings"]
|
||||
layout_mode = 2
|
||||
columns = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "Name:"
|
||||
|
||||
[node name="Name" type="LineEdit" parent="VBox/Settings/Grid"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
tooltip_text = "Mood name"
|
||||
text = "New Mood"
|
||||
placeholder_text = "Enter Mood Name"
|
||||
caret_blink = true
|
||||
|
||||
[node name="NameWarning" type="TextureRect" parent="VBox/Settings/Grid/Name"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 11
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -31.0
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 2
|
||||
texture = SubResource("ImageTexture_drtd2")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="Label6" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "Mode:"
|
||||
|
||||
[node name="Mode" type="OptionButton" parent="VBox/Settings/Grid"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
tooltip_text = "Interrupt = The next sound will stop the previous
|
||||
Overlap = Multiple sounds may play at once
|
||||
Await = A sound will only be played if the previous has finished"
|
||||
item_count = 3
|
||||
selected = 0
|
||||
popup/item_0/text = "Interrupt"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Overlap"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Await"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="Label4" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "File/Folder:"
|
||||
|
||||
[node name="SoundFolder" parent="VBox/Settings/Grid" instance=ExtResource("2_e1vyd")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
file_filter = "*.ogg, *.mp3, *.wav"
|
||||
file_mode = 3
|
||||
|
||||
[node name="Label2" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "Pitch:"
|
||||
|
||||
[node name="Pitch" type="HBoxContainer" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = -6
|
||||
alignment = 2
|
||||
|
||||
[node name="PitchBase" parent="VBox/Settings/Grid/Pitch" instance=ExtResource("3_yjcns")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
enforce_step = false
|
||||
max = 4.0
|
||||
|
||||
[node name="Label4" type="Label" parent="VBox/Settings/Grid/Pitch"]
|
||||
layout_mode = 2
|
||||
text = "+/- "
|
||||
|
||||
[node name="PitchVariance" parent="VBox/Settings/Grid/Pitch" instance=ExtResource("3_yjcns")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
enforce_step = false
|
||||
|
||||
[node name="Label3" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "Volume:"
|
||||
|
||||
[node name="Volume" type="HBoxContainer" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = -6
|
||||
alignment = 2
|
||||
|
||||
[node name="VolumeBase" parent="VBox/Settings/Grid/Volume" instance=ExtResource("3_yjcns")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
min = -60.0
|
||||
max = 30.0
|
||||
|
||||
[node name="Label4" type="Label" parent="VBox/Settings/Grid/Volume"]
|
||||
layout_mode = 2
|
||||
text = "+/- "
|
||||
|
||||
[node name="VolumeVariance" parent="VBox/Settings/Grid/Volume" instance=ExtResource("3_yjcns")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label5" type="Label" parent="VBox/Settings/Grid"]
|
||||
layout_mode = 2
|
||||
text = "Skip:"
|
||||
|
||||
[node name="Skip" parent="VBox/Settings/Grid" instance=ExtResource("3_yjcns")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
step = 1.0
|
||||
|
||||
[node name="Preview" type="AudioStreamPlayer" parent="."]
|
||||
script = ExtResource("5_yscws")
|
||||
play_every_character = 0
|
||||
|
||||
[connection signal="pressed" from="VBox/ListPanel/Vbox/HBoxContainer/Add" to="." method="_on_add_pressed"]
|
||||
[connection signal="pressed" from="VBox/ListPanel/Vbox/HBoxContainer/Duplicate" to="." method="_on_duplicate_pressed"]
|
||||
[connection signal="pressed" from="VBox/ListPanel/Vbox/HBoxContainer/Delete" to="." method="_on_delete_pressed"]
|
||||
[connection signal="pressed" from="VBox/ListPanel/Vbox/HBoxContainer/Play" to="." method="preview"]
|
||||
[connection signal="toggled" from="VBox/ListPanel/Vbox/HBoxContainer/Default" to="." method="_on_default_toggled"]
|
||||
[connection signal="item_selected" from="VBox/ListPanel/Vbox/MoodList" to="." method="_on_mood_list_item_selected"]
|
||||
[connection signal="focus_exited" from="VBox/Settings/Grid/Name" to="." method="_on_name_focus_exited"]
|
||||
[connection signal="text_changed" from="VBox/Settings/Grid/Name" to="." method="_on_name_text_changed"]
|
||||
[connection signal="text_submitted" from="VBox/Settings/Grid/Name" to="." method="_on_name_text_submitted"]
|
||||
@@ -0,0 +1,37 @@
|
||||
@tool
|
||||
extends DialogicCharacterEditorPortraitSection
|
||||
|
||||
|
||||
func _get_title() -> String:
|
||||
return "Typing Sound Mood"
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
%PortraitMood.get_suggestions_func = mood_suggestions
|
||||
%PortraitMood.resource_icon = get_theme_icon("AudioStreamPlayer", "EditorIcons")
|
||||
|
||||
|
||||
func _load_portrait_data(data:Dictionary):
|
||||
%PortraitMood.set_value(data.get('sound_mood'))
|
||||
|
||||
|
||||
func update_visibility(show:=true):
|
||||
if !show:
|
||||
hide()
|
||||
get_parent().get_child(get_index()-1).hide()
|
||||
get_parent().get_child(get_index()+1).hide()
|
||||
else:
|
||||
get_parent().get_child(get_index()-1).show()
|
||||
|
||||
|
||||
func _on_portrait_mood_value_changed(property_name:String, value:String):
|
||||
var data: Dictionary = selected_item.get_metadata(0)
|
||||
data['sound_mood'] = value
|
||||
changed.emit()
|
||||
|
||||
|
||||
func mood_suggestions(filter:String) -> Dictionary:
|
||||
var suggestions := {}
|
||||
for mood in character_editor.get_settings_section_by_name('Typing Sounds').current_moods_info:
|
||||
suggestions[mood] = {'value':mood}
|
||||
return suggestions
|
||||
@@ -0,0 +1 @@
|
||||
uid://cvcjnwoogv8ls
|
||||
@@ -0,0 +1,25 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bvfiv5uhmkqq7"]
|
||||
|
||||
[ext_resource type="Script" path="res://addons/dialogic/Modules/Text/character_settings/character_portrait_mood_settings.gd" id="1_5ni5u"]
|
||||
[ext_resource type="PackedScene" uid="uid://dpwhshre1n4t6" path="res://addons/dialogic/Editor/Events/Fields/field_options_dynamic.tscn" id="1_oggvu"]
|
||||
|
||||
[node name="Typing Sound Mood" type="HBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_5ni5u")
|
||||
|
||||
[node name="PortraitMoodLabel" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Sound Mood:"
|
||||
|
||||
[node name="PortraitMood" parent="." instance=ExtResource("1_oggvu")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "Select Mood"
|
||||
|
||||
[connection signal="value_changed" from="PortraitMood" to="." method="_on_portrait_mood_value_changed"]
|
||||
Reference in New Issue
Block a user