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