From 6279fb50ef5324028be5989d1b58119202e2a152 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Tue, 19 May 2026 10:30:20 +0100 Subject: [PATCH] Phantom Camera: Update to 0.11.0.2 --- addons/phantom_camera/plugin.cfg | 2 +- .../phantom_camera_host.gd | 19 +++++-------------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/addons/phantom_camera/plugin.cfg b/addons/phantom_camera/plugin.cfg index 497b86b6c..7858bb8ca 100644 --- a/addons/phantom_camera/plugin.cfg +++ b/addons/phantom_camera/plugin.cfg @@ -3,5 +3,5 @@ name="Phantom Camera" description="Control the movement and dynamically tween 2D & 3D cameras positions. Built for Godot 4. Inspired by Cinemachine." author="Marcus Skov" -version="0.11" +version="0.11.0.2" script="plugin.gd" diff --git a/addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd b/addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd index 758c87cc5..ee3d25c1d 100644 --- a/addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd +++ b/addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd @@ -91,7 +91,6 @@ var _is_child_of_camera: bool = false var _is_2d: bool = false var _viewfinder_node: Control = null -var _viewfinder_needed_check: bool = true var _camera_zoom: Vector2 = Vector2.ONE @@ -671,17 +670,11 @@ func _assign_new_active_pcam(pcam: Node) -> void: viewfinder_update.emit(false) if _is_2d: - if _active_pcam_2d.show_viewfinder_in_play: - _viewfinder_needed_check = true - _active_pcam_2d.set_is_active(self, true) _active_pcam_2d.became_active.emit() pcam_became_active.emit(_active_pcam_2d) _camera_zoom = camera_2d.zoom else: - if _active_pcam_3d.show_viewfinder_in_play: - _viewfinder_needed_check = true - _active_pcam_3d.set_is_active(self, true) _active_pcam_3d.became_active.emit() pcam_became_active.emit(_active_pcam_3d) @@ -690,6 +683,8 @@ func _assign_new_active_pcam(pcam: Node) -> void: camera_3d.cull_mask = _active_pcam_3d.cull_mask camera_3d.projection = _active_pcam_3d.projection + _check_viewfinder_in_play() + if no_previous_pcam: if _is_2d: _prev_active_pcam_2d_transform = _active_pcam_2d.get_transform_output() @@ -922,10 +917,6 @@ func _pcam_follow(_delta: float) -> void: else: camera_3d.global_transform = _active_pcam_3d_glob_transform - if _viewfinder_needed_check: - _show_viewfinder_in_play() - _viewfinder_needed_check = false - if Engine.is_editor_hint(): if not _is_2d: # TODO - Signal-based solution pending merge of: https://github.com/godotengine/godot/pull/99729 @@ -1238,9 +1229,9 @@ func _tween_interpolate_value(from: Variant, to: Variant) -> Variant: ) -func _show_viewfinder_in_play() -> void: +func _check_viewfinder_in_play() -> void: # Don't show the viewfinder in the actual editor or project builds - if Engine.is_editor_hint() or !OS.has_feature("editor"): return + if Engine.is_editor_hint() or not OS.has_feature("editor"): return # Default the viewfinder node to be hidden if is_instance_valid(_phantom_camera_manager.get_viewfinder()): @@ -1258,7 +1249,7 @@ func _show_viewfinder_in_play() -> void: # Instantiate the viewfinder scene if it isn't already if not is_instance_valid(_phantom_camera_manager.get_viewfinder()): - var _viewfinder_scene: PackedScene = preload("res://addons/phantom_camera/panel/viewfinder/viewfinder_panel.tscn") + var _viewfinder_scene: PackedScene = load("res://addons/phantom_camera/panel/viewfinder/viewfinder_panel.tscn") _phantom_camera_manager.set_viewfinder(self, _viewfinder_scene.instantiate()) canvas_layer.add_child(_phantom_camera_manager.get_viewfinder()) # _phantom_camera_manager.viewfinder = _viewfinder_node