fix: repeating fix from another branch; these will be merged anyway

This commit is contained in:
Duncan Brown
2022-05-07 18:05:05 -04:00
committed by Julian Murgia
parent 05ca4c1795
commit 64ac7654f4
5 changed files with 10 additions and 11 deletions

View File

@@ -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")

View File

@@ -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())

View File

@@ -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()

View File

@@ -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 = []

View File

@@ -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'])