diff --git a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd b/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd index ef9272ce..81d1aa37 100644 --- a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd +++ b/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd @@ -54,8 +54,3 @@ func run(command_params: Array) -> int: command_params[0] ) return ESCExecution.RC_OK - - -# Function called when the command is interrupted. -func interrupt(): - escoria.object_manager.get_object(_snd_player).node.set_state("off") diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd index 52739ebc..030e7389 100644 --- a/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd +++ b/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd @@ -22,7 +22,7 @@ func _init() -> void: # Return the descriptor of the arguments of this command func configure() -> ESCCommandArgumentDescriptor: - escoria.logger.error("Command %s did not override configure." % get_class()) + escoria.logger.error("Command %s did not override configure." % get_command_name()) return ESCCommandArgumentDescriptor.new() @@ -33,10 +33,15 @@ func validate(arguments: Array) -> bool: # Run the command func run(command_params: Array) -> int: - escoria.logger.error("Command %s did not override run." % get_class()) + escoria.logger.error("Command %s did not override run." % get_command_name()) return 0 # Return the name of the command based on the script's filename func get_command_name() -> String: return command_name_regex.search(get_script().get_path()).get_string(FILE_REGEX_GROUP) + + +# Function called when the command is interrupted. +func interrupt(): + escoria.logger.info("Command %s did not override interrupt." % get_command_name()) diff --git a/addons/escoria-core/game/core-scripts/esc_game.gd b/addons/escoria-core/game/core-scripts/esc_game.gd index 61c23982..81453c42 100644 --- a/addons/escoria-core/game/core-scripts/esc_game.gd +++ b/addons/escoria-core/game/core-scripts/esc_game.gd @@ -111,7 +111,7 @@ func _draw(): # - can_interrupt: if true, this command will interrupt any ongoing event func do_walk(destination, params: Array = [], can_interrupt: bool = false) -> void: if can_interrupt: - escoria.event_manager.interrupt_running_event() + escoria.event_manager.interrupt() escoria.action_manager.clear_current_action() diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd b/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd index 493db95c..19487ed4 100644 --- a/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd +++ b/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd @@ -261,7 +261,7 @@ func load_game(id: int): ) ) - escoria.event_manager.interrupt_running_event() + escoria.event_manager.interrupt() var load_event = ESCEvent.new("%s%s" % [ESCEvent.PREFIX, escoria.event_manager.EVENT_LOAD]) var load_statements = [] diff --git a/addons/escoria-core/ui_library/tools/room_select/room_select.gd b/addons/escoria-core/ui_library/tools/room_select/room_select.gd index ead6fae7..2a46ed28 100644 --- a/addons/escoria-core/ui_library/tools/room_select/room_select.gd +++ b/addons/escoria-core/ui_library/tools/room_select/room_select.gd @@ -66,8 +66,7 @@ func _on_button_pressed(): ], get_class() ) - escoria.event_manager.interrupt_running_event() - escoria.event_manager.clear_event_queue() + escoria.event_manager.interrupt() escoria.event_manager.queue_event(script.events['room_selector'])