Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Typing Sound Audio Bus in Character Settings #2425

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func _ready() -> void:
%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")
_load_audio_bus_options()


func update_mood_list(selected_name := "") -> void:
Expand Down Expand Up @@ -127,6 +127,7 @@ func load_mood_info(dict:Dictionary) -> void:
%VolumeBase.set_value(dict.get('volume_base', 0))
%VolumeVariance.set_value(dict.get('volume_variance', 0))
%Skip.set_value(dict.get('skip_characters', 0))
%AudioBus.select(dict.get('audio_bus', 0))


func get_mood_info() -> Dictionary:
Expand All @@ -139,6 +140,7 @@ func get_mood_info() -> Dictionary:
dict['volume_base'] = %VolumeBase.value
dict['volume_variance'] = %VolumeVariance.value
dict['skip_characters'] = %Skip.value
dict['audio_bus'] = %AudioBus.selected
return dict


Expand Down Expand Up @@ -228,3 +230,10 @@ func preview() -> void:
await preview_timer.timeout

preview_timer.queue_free()


func _load_audio_bus_options() -> void:
%AudioBus.clear()
for i in AudioServer.bus_count:
anis-mahsoume marked this conversation as resolved.
Show resolved Hide resolved
var bus = AudioServer.get_bus_name(i)
%AudioBus.add_item(bus)
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ size_flags_horizontal = 3
file_filter = "*.ogg, *.mp3, *.wav"
file_mode = 3

[node name="AudioBusLabel" type="Label" parent="VBox/Settings/Grid"]
layout_mode = 2
text = "Audio Bus:"

[node name="AudioBus" type="OptionButton" parent="VBox/Settings/Grid"]
unique_name_in_owner = true
layout_mode = 2
tooltip_text = "Audio bus in which the type sounds will be sent"
anis-mahsoume marked this conversation as resolved.
Show resolved Hide resolved
selected = 0
item_count = 1
popup/item_0/text = "Master"

[node name="Label2" type="Label" parent="VBox/Settings/Grid"]
layout_mode = 2
text = "Pitch:"
Expand Down
3 changes: 3 additions & 0 deletions addons/dialogic/Modules/Text/node_type_sound.gd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func _ready() -> void:


func _on_started_revealing_text() -> void:
var default_bus_index: int = AudioServer.get_bus_index(bus)
var bus_index: int = current_overwrite_data.get('audio_bus', default_bus_index)
bus = AudioServer.get_bus_name(bus_index)
if !enabled or (get_parent() is DialogicNode_DialogText and !get_parent().enabled):
anis-mahsoume marked this conversation as resolved.
Show resolved Hide resolved
return
characters_since_last_sound = current_overwrite_data.get('skip_characters', play_every_character-1)+1
Expand Down
Loading