summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrequizm <mehmet41650@gmail.com>2021-08-21 21:24:09 +0300
committerrequizm <mehmet41650@gmail.com>2021-08-21 21:24:09 +0300
commit3d3f64f9492c5c53e5d60d2df00ea1bd755226f3 (patch)
treead6b041893ce8b7e83cb4bcf6e9c7988002411ab
parent2daef0400a95bb467dacff845052a27e464e4dec (diff)
Fix camera override not working
-rw-r--r--editor/debugger/editor_debugger_node.cpp11
-rw-r--r--editor/debugger/editor_debugger_node.h5
-rw-r--r--scene/debugger/scene_debugger.cpp2
3 files changed, 14 insertions, 4 deletions
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index 5d654ca756..a9cb1a0131 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -655,6 +655,17 @@ void EditorDebuggerNode::live_debug_reparent_node(const NodePath &p_at, const No
});
}
+void EditorDebuggerNode::set_camera_override(CameraOverride p_override) {
+ _for_all(tabs, [&](ScriptEditorDebugger *dbg) {
+ dbg->set_camera_override(p_override);
+ });
+ camera_override = p_override;
+}
+
+EditorDebuggerNode::CameraOverride EditorDebuggerNode::get_camera_override() {
+ return camera_override;
+}
+
void EditorDebuggerNode::add_debugger_plugin(const Ref<Script> &p_script) {
ERR_FAIL_COND_MSG(debugger_plugins.has(p_script), "Debugger plugin already exists.");
ERR_FAIL_COND_MSG(p_script.is_null(), "Debugger plugin script is null");
diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h
index 0849ecf1c9..39a95326be 100644
--- a/editor/debugger/editor_debugger_node.h
+++ b/editor/debugger/editor_debugger_node.h
@@ -185,9 +185,8 @@ public:
void live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name);
void live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos);
- // Camera
- void set_camera_override(CameraOverride p_override) { camera_override = p_override; }
- CameraOverride get_camera_override() { return camera_override; }
+ void set_camera_override(CameraOverride p_override);
+ CameraOverride get_camera_override();
Error start(const String &p_protocol = "tcp://");
diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp
index df1aece80a..f4e477b613 100644
--- a/scene/debugger/scene_debugger.cpp
+++ b/scene/debugger/scene_debugger.cpp
@@ -88,7 +88,7 @@ Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Arra
} else if (p_msg == "override_camera_2D:transform") {
ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA);
- Transform2D transform = p_args[1];
+ Transform2D transform = p_args[0];
scene_tree->get_root()->set_canvas_transform_override(transform);
#ifndef _3D_DISABLED
} else if (p_msg == "override_camera_3D:set") {