Fix camera override not working

This commit is contained in:
requizm 2021-08-21 21:24:09 +03:00
parent 2daef0400a
commit 3d3f64f949
3 changed files with 14 additions and 4 deletions

View File

@ -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) { 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(debugger_plugins.has(p_script), "Debugger plugin already exists.");
ERR_FAIL_COND_MSG(p_script.is_null(), "Debugger plugin script is null"); ERR_FAIL_COND_MSG(p_script.is_null(), "Debugger plugin script is null");

View File

@ -185,9 +185,8 @@ public:
void live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name); 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); 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);
void set_camera_override(CameraOverride p_override) { camera_override = p_override; } CameraOverride get_camera_override();
CameraOverride get_camera_override() { return camera_override; }
Error start(const String &p_protocol = "tcp://"); Error start(const String &p_protocol = "tcp://");

View File

@ -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") { } else if (p_msg == "override_camera_2D:transform") {
ERR_FAIL_COND_V(p_args.size() < 1, ERR_INVALID_DATA); 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); scene_tree->get_root()->set_canvas_transform_override(transform);
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
} else if (p_msg == "override_camera_3D:set") { } else if (p_msg == "override_camera_3D:set") {