feat(credits): enable music volume, closes #89
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user