fix: accommodate empty parameter

This commit is contained in:
Duncan Brown
2022-03-17 19:15:10 -04:00
committed by Julian Murgia
parent 0556ccbf32
commit ecb7bfb528
6 changed files with 10 additions and 9 deletions

View File

@@ -25,7 +25,8 @@ func configure() -> ESCCommandArgumentDescriptor:
# Validate whether the given arguments match the command descriptor
func validate(arguments: Array):
if not escoria.main.scene_transition.has_transition(arguments[0]):
if not escoria.main.scene_transition.has_transition(arguments[0]) \
and not arguments[0].empty():
escoria.logger.report_errors(
"transition: argument invalid",
[

View File

@@ -289,7 +289,7 @@ func _perform_script_events(room: ESCRoom):
[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION
escoria.project_settings_manager.DEFAULT_TRANSITION
)
],
"%s 0.1" % _wait.get_command_name()
@@ -346,7 +346,7 @@ func _perform_script_events(room: ESCRoom):
[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION
escoria.project_settings_manager.DEFAULT_TRANSITION
)
],
"%s 0.1" % _wait.get_command_name()

View File

@@ -268,7 +268,7 @@ func load_game(id: int):
[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION
escoria.project_settings_manager.DEFAULT_TRANSITION
)]
)
)
@@ -380,7 +380,7 @@ func load_game(id: int):
[
_transition.get_command_name(),
escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION
escoria.project_settings_manager.DEFAULT_TRANSITION
)]
)
)

View File

@@ -10,7 +10,7 @@ const _ESCORIA_SETTINGS_ROOT = "escoria"
const _UI_ROOT = "ui"
const DEFAULT_DIALOG_TYPE = "%s/%s/default_dialog_type" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
const DEFAULT_TRANISITION = "%s/%s/default_transition" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
const DEFAULT_TRANSITION = "%s/%s/default_transition" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
const DIALOG_MANAGERS = "%s/%s/dialog_managers" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
const GAME_SCENE = "%s/%s/game_scene" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
const INVENTORY_ITEM_SIZE = "%s/%s/inventory_item_size" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]

View File

@@ -63,7 +63,7 @@ func transition(
if transition_name.empty():
transition_name = escoria.project_settings_manager.get_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION
escoria.project_settings_manager.DEFAULT_TRANSITION
)
if not has_transition(transition_name):

View File

@@ -68,10 +68,10 @@ func set_escoria_ui_settings():
)
escoria.project_settings_manager.register_setting(
escoria.project_settings_manager.DEFAULT_TRANISITION,
escoria.project_settings_manager.DEFAULT_TRANSITION,
"curtain",
{
"name": escoria.project_settings_manager.DEFAULT_TRANISITION,
"name": escoria.project_settings_manager.DEFAULT_TRANSITION,
"type": TYPE_STRING
}
)