Skip to content

Commit

Permalink
fix: accommodate empty parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
BHSDuncan authored and StraToN committed Apr 8, 2022
1 parent 0556ccb commit ecb7bfb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand Down
4 changes: 2 additions & 2 deletions addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
)]
)
)
Expand Down Expand Up @@ -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
)]
)
)
Expand Down
2 changes: 1 addition & 1 deletion addons/escoria-core/game/project_settings_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions addons/escoria-core/plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)
Expand Down

0 comments on commit ecb7bfb

Please sign in to comment.