feat(credits): enable music volume, closes #89

This commit is contained in:
2024-11-12 19:36:05 +01:00
parent bde4587c76
commit c7079bfc08
3 changed files with 48 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
# `music_enable`
#
# Enable music volume
#
# @ESC
extends ESCBaseCommand
class_name MusicEnableCommand
var item_count_manager = ESCItemCountManager.new()
# Return the descriptor of the arguments of this command
func configure() -> ESCCommandArgumentDescriptor:
return ESCCommandArgumentDescriptor.new()
# Validate wether the given arguments match the command descriptor
func validate(arguments: Array):
return .validate(arguments)
# Run the command
func run(command_params: Array) -> int:
AudioServer.set_bus_volume_db(
AudioServer.get_bus_index(escoria.BUS_MUSIC),
linear2db(
ESCProjectSettingsManager.get_setting(
ESCProjectSettingsManager.MUSIC_VOLUME
)
)
)
escoria.game_scene.musicEnabled = true
return ESCExecution.RC_OK
# Function called when the command is interrupted.
func interrupt():
# Do nothing
pass

View File

@@ -17,6 +17,7 @@ say player "Parece un cuerno de algún animal. Lo usan para llamar a comer."
stop_snd
> [turno_cocina_eneko_cata_ok]
set_gui_visible false
music_enable
change_scene res://gymkhana/rooms/turno_cocina/creditos/creditos.tscn
stop
play_video res://gymkhana/videos/turno_cocina/cuerno_antes_de_tiempo.ogv

View File

@@ -550,6 +550,11 @@ _global_script_classes=[ {
"path": "res://addons/escoria-ui-return-monkey-island/item_outline.gd"
}, {
"base": "ESCBaseCommand",
"class": "MusicEnableCommand",
"language": "GDScript",
"path": "res://addons/escoria-ui-return-monkey-island/esc/commands/music_enable.gd"
}, {
"base": "ESCBaseCommand",
"class": "PlayLibSound",
"language": "GDScript",
"path": "res://addons/escoria-ui-return-monkey-island/esc/commands/play_lib_snd.gd"
@@ -892,7 +897,8 @@ _global_script_class_icons={
"InventoryAddCommand": "",
"InventoryRemoveCommand": "",
"ItemCountAddCommand": "",
"ItemOutline": "res://addons/escoria-core/design/esc_item.svg",
"ItemOutline": "",
"MusicEnableCommand": "",
"PlayLibSound": "",
"PlaySndCommand": "",
"PlayVideoCommand": "",