summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-08-02 20:28:10 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-08-02 20:28:10 -0300
commitcbee679bd78c1b3317db1ea4e349f278576304a1 (patch)
tree862e1d13df996bd0d06fc2e97073e74ea78ec284 /tools/editor
parent59961c99144523d7cc2881a4abe6d0a319a975df (diff)
live debug fixes
removing node in live debugging fixed
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/scene_tree_dock.cpp6
-rw-r--r--tools/editor/script_editor_debugger.cpp19
-rw-r--r--tools/editor/script_editor_debugger.h2
3 files changed, 14 insertions, 13 deletions
diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp
index 111d307b8e..ae0b58a665 100644
--- a/tools/editor/scene_tree_dock.cpp
+++ b/tools/editor/scene_tree_dock.cpp
@@ -402,7 +402,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
- editor_data->get_undo_redo().add_do_method(sed,"live_debug_duplicate_node",edited_scene->get_path_to(node),edited_scene->get_path_to(parent),attempt);
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_duplicate_node",edited_scene->get_path_to(node),attempt);
editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+attempt));
//parent->add_child(dup);
@@ -919,8 +919,8 @@ void SceneTreeDock::_node_reparent(NodePath p_path,bool p_node_only) {
ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
String new_name = new_parent->validate_child_name(node->get_name());
- editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name);
- editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),node->get_parent(),node->get_name());
+ editor_data->get_undo_redo().add_do_method(sed,"live_debug_reparent_node",edited_scene->get_path_to(node),edited_scene->get_path_to(new_parent),new_name,-1);
+ editor_data->get_undo_redo().add_undo_method(sed,"live_debug_reparent_node",NodePath(String(edited_scene->get_path_to(new_parent))+"/"+new_name),edited_scene->get_path_to(node->get_parent()),node->get_name(),node->get_index());
editor_data->get_undo_redo().add_do_method(this,"_set_owners",edited_scene,owners);
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index a0ff55e845..a4bd8f3bd7 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -927,7 +927,7 @@ void ScriptEditorDebugger::update_live_edit_root() {
void ScriptEditorDebugger::live_debug_create_node(const NodePath& p_parent,const String& p_type,const String& p_name) {
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_create_node");
msg.push_back(p_parent);
@@ -939,7 +939,7 @@ void ScriptEditorDebugger::live_debug_create_node(const NodePath& p_parent,const
void ScriptEditorDebugger::live_debug_instance_node(const NodePath& p_parent,const String& p_path,const String& p_name){
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_instance_node");
msg.push_back(p_parent);
@@ -951,7 +951,7 @@ void ScriptEditorDebugger::live_debug_instance_node(const NodePath& p_parent,con
}
void ScriptEditorDebugger::live_debug_remove_node(const NodePath& p_at){
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_remove_node");
msg.push_back(p_at);
@@ -961,9 +961,9 @@ void ScriptEditorDebugger::live_debug_remove_node(const NodePath& p_at){
}
void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath& p_at,ObjectID p_keep_id) {
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
- msg.push_back("live_remove_and_keep_mode");
+ msg.push_back("live_remove_and_keep_node");
msg.push_back(p_at);
msg.push_back(p_keep_id);
ppeer->put_var(msg);
@@ -972,7 +972,7 @@ void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath& p_at,
}
void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath& p_at, int p_at_pos){
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_restore_node");
msg.push_back(p_id);
@@ -984,7 +984,7 @@ void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath
}
void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath& p_at,const String& p_new_name){
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_duplicate_node");
msg.push_back(p_at);
@@ -993,14 +993,15 @@ void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath& p_at,const
}
}
-void ScriptEditorDebugger::live_debug_reparent_node(const NodePath& p_at, const NodePath& p_new_place, const String &p_new_name){
+void ScriptEditorDebugger::live_debug_reparent_node(const NodePath& p_at, const NodePath& p_new_place, const String &p_new_name, int p_at_pos){
- if (connection.is_valid()) {
+ if (live_debug && connection.is_valid()) {
Array msg;
msg.push_back("live_reparent_node");
msg.push_back(p_at);
msg.push_back(p_new_place);
msg.push_back(p_new_name);
+ msg.push_back(p_at_pos);
ppeer->put_var(msg);
}
diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h
index e8ac0fddb3..cad41ce8a7 100644
--- a/tools/editor/script_editor_debugger.h
+++ b/tools/editor/script_editor_debugger.h
@@ -159,7 +159,7 @@ public:
void live_debug_remove_and_keep_node(const NodePath& p_at,ObjectID p_keep_id);
void live_debug_restore_node(ObjectID p_id,const NodePath& p_at,int p_at_pos);
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);
+ void live_debug_reparent_node(const NodePath& p_at,const NodePath& p_new_place,const String& p_new_name,int p_at_pos);
void update_live_edit_root();