WIP: Correcting for switched camera limits. Updating validation for camera methods, although this is a WIP.
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user