WIP: Correcting for switched camera limits. Updating validation for camera methods, although this is a WIP.

This commit is contained in:
Duncan Brown
2022-10-28 00:16:07 -04:00
parent d95d26ff5f
commit ec33580d73
5 changed files with 53 additions and 19 deletions

View File

@@ -62,7 +62,7 @@ func validate(arguments: Array):
if not camera.check_point_is_inside_viewport_limits(target_pos):
escoria.logger.warn(
self,
"[%s]: Invalid camera position. Moving camera by %s to %s will result in viewport being clamped to the current camera limit %s but its actual position not reflecting this."
"[%s]: Invalid camera position. Camera cannot be moved to %s at position %s as this is outside the current viewport with camera limit %s."
% [
get_command_name(),
arguments[0],

View File

@@ -49,7 +49,10 @@ func validate(arguments: Array):
# Run the command
func run(command_params: Array) -> int:
var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
camera.clamp_to_viewport_limits()
escoria.main.set_camera_limits(command_params[0])
return ESCExecution.RC_OK

View File

@@ -36,7 +36,7 @@ func validate(arguments: Array):
if not camera.check_point_is_inside_viewport_limits(new_pos):
escoria.logger.warn(
self,
"[%s]: Invalid camera position. Moving camera by %s to %s will result in viewport being clamped to the current camera limit %s but its actual position not reflecting this."
"[%s]: Invalid camera position. Camera cannot be moved to %s as this is outside the viewport with current camera limit %s."
% [
get_command_name(),
new_pos,

View File

@@ -83,7 +83,7 @@ func validate(arguments: Array):
if not camera.check_point_is_inside_viewport_limits(new_pos):
escoria.logger.warn(
self,
"[%s]: Invalid camera position. Moving camera by %s to %s will result in viewport being clamped to the current camera limit %s but its actual position not reflecting this."
"[%s]: Invalid camera position. Camera cannot be moved by %s to %s as this is outside the current viewport with camera limit %s."
% [
get_command_name(),
shift_by,
@@ -91,6 +91,7 @@ func validate(arguments: Array):
camera_limit
]
)
return false
return true