Creditos music
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# `set_volume value player`
|
||||
#
|
||||
# Sets the volume for the specified channel.
|
||||
#
|
||||
# **Parameters**
|
||||
#
|
||||
# - *volume*: Targeted volume
|
||||
# - *player*: Sound player to use. Can either be `_sound`, which is used to play non-
|
||||
# looping sound effects; `_music`, which plays looping music; or `_speech`, which
|
||||
# plays non-looping voice files (default: `_sound`)
|
||||
#
|
||||
# @ESC
|
||||
|
||||
extends ESCBaseCommand
|
||||
class_name SetVolumeCommand
|
||||
|
||||
|
||||
# Return the descriptor of the arguments of this command
|
||||
func configure() -> ESCCommandArgumentDescriptor:
|
||||
return ESCCommandArgumentDescriptor.new(
|
||||
1,
|
||||
[TYPE_FLOAT,TYPE_STRING],
|
||||
[null, "_music"]
|
||||
)
|
||||
|
||||
|
||||
# Validate whether the given arguments match the command descriptor
|
||||
func validate(arguments: Array):
|
||||
if not super.validate(arguments):
|
||||
return false
|
||||
|
||||
if not escoria.object_manager.has(arguments[1]):
|
||||
raise_error(self, "Invalid sound player. Sound player %s not registered." % arguments[1])
|
||||
return false
|
||||
|
||||
return true
|
||||
|
||||
|
||||
# Run the command
|
||||
func run(command_params: Array) -> int:
|
||||
AudioServer.set_bus_volume_db(
|
||||
AudioServer.get_bus_index(escoria.BUS_MUSIC),
|
||||
linear_to_db(
|
||||
command_params[0]
|
||||
)
|
||||
)
|
||||
return ESCExecution.RC_OK
|
||||
|
||||
|
||||
# Function called when the command is interrupted.
|
||||
func interrupt():
|
||||
# Do nothing
|
||||
pass
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://dqxnqfx6f0n6k
|
||||
@@ -21,6 +21,7 @@
|
||||
say($oier_dancing, "Hmm, mejor no.", "turno_cocina_creditos_8")
|
||||
say($oier_dancing, "Lanzamos los créditos?", "turno_cocina_creditos_9")
|
||||
say($eneko_dancing, "Daleee!", "turno_cocina_creditos_10")
|
||||
set_volume(1.0,"_music")
|
||||
play_snd("res://gymkhana/sounds/intro_menu_loop.ogg", "_music")
|
||||
set_global("turno_credits_rolling", true)
|
||||
set_global("turno_cocina_credits_dancing", true)
|
||||
|
||||
Reference in New Issue
Block a user