diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-01-25 10:30:47 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-01-25 10:30:47 -0300 |
commit | 5245adcf81dd61ddb4eac048f6b004f3f455d7ed (patch) | |
tree | 272c46c2ee422d9fe6d4dfaeca51fa52c264ffb3 /tools | |
parent | 07e79094802a2eb2d7c0cd64cecf673db386ec5a (diff) | |
parent | 87517c564b83218871ac53afdad375a9501e6cb8 (diff) |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/editor_node.cpp | 10 | ||||
-rw-r--r-- | tools/editor/editor_node.h | 1 | ||||
-rw-r--r-- | tools/editor/groups_editor.cpp | 2 | ||||
-rw-r--r-- | tools/editor/plugins/canvas_item_editor_plugin.cpp | 59 | ||||
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 19 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.cpp | 22 | ||||
-rw-r--r-- | tools/editor/script_editor_debugger.h | 4 |
7 files changed, 93 insertions, 24 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 9fe76a738a..79f5e66401 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -4592,6 +4592,16 @@ ToolButton *EditorNode::add_bottom_panel_item(String p_text,Control *p_item) { } +bool EditorNode::are_bottom_panels_hidden() const { + + for(int i=0;i<bottom_panel_items.size();i++) { + if (bottom_panel_items[i].button->is_pressed()) + return false; + } + + return true; +} + void EditorNode::hide_bottom_panel() { _bottom_panel_switch(false,0); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 4dc942c023..c687643d30 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -670,6 +670,7 @@ public: ToolButton* add_bottom_panel_item(String p_text,Control *p_item); + bool are_bottom_panels_hidden() const; void make_bottom_panel_item_visible(Control *p_item); void raise_bottom_panel_item(Control *p_item); void hide_bottom_panel(); diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp index 6840a8b205..4b1096148a 100644 --- a/tools/editor/groups_editor.cpp +++ b/tools/editor/groups_editor.cpp @@ -51,6 +51,8 @@ void GroupsEditor::_add_group(const String& p_group) { undo_redo->add_undo_method(this,"update_tree"); undo_redo->commit_action(); + + group_name->clear(); } void GroupsEditor::_remove_group(Object *p_item, int p_column, int p_id) { diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index a259fa0fcc..0afea26957 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -603,6 +603,9 @@ bool CanvasItemEditor::_select(CanvasItem *item, Point2 p_click_pos, bool p_appe CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -643,6 +646,9 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -702,6 +708,9 @@ Point2 CanvasItemEditor::_find_topleftmost_point() { CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + @@ -731,6 +740,9 @@ int CanvasItemEditor::get_item_count() { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + ic++; }; @@ -749,6 +761,8 @@ CanvasItem *CanvasItemEditor::get_single_item() { CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; if (single_item) return NULL; //morethan one @@ -1102,6 +1116,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) @@ -1194,6 +1211,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -1400,6 +1420,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -1507,6 +1530,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -1881,6 +1907,8 @@ void CanvasItemEditor::_viewport_draw() { CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (!se) continue; @@ -2104,6 +2132,9 @@ void CanvasItemEditor::_notification(int p_what) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + if (canvas_item->cast_to<Control>()) has_control=true; else @@ -2509,6 +2540,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + canvas_item->set_meta("_edit_lock_",true); emit_signal("item_lock_status_changed"); } @@ -2524,6 +2558,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + canvas_item->set_meta("_edit_lock_",Variant()); emit_signal("item_lock_status_changed"); @@ -2542,6 +2579,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + canvas_item->set_meta("_edit_group_",true); emit_signal("item_group_status_changed"); } @@ -2557,6 +2597,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + canvas_item->set_meta("_edit_group_",Variant()); emit_signal("item_group_status_changed"); } @@ -2575,6 +2618,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + Control *c = canvas_item->cast_to<Control>(); if (!c) @@ -2693,6 +2739,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + if (canvas_item->cast_to<Node2D>()) { Node2D *n2d = canvas_item->cast_to<Node2D>(); @@ -2803,6 +2852,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; if (canvas_item->cast_to<Node2D>()) { @@ -2853,6 +2904,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + if (canvas_item->cast_to<Node2D>()) { Node2D *n2d = canvas_item->cast_to<Node2D>(); @@ -2887,6 +2941,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) { CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); if (!canvas_item) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; + // counting invisible items, for now //if (!canvas_item->is_visible()) continue; @@ -2979,6 +3036,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { if (!canvas_item || !canvas_item->is_visible()) continue; + if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root()) + continue; canvas_item->set_meta("_edit_ik_",true); diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 29326a2222..acacd37f66 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -533,6 +533,8 @@ void TileMapEditor::_canvas_draw() { if (node->get_half_offset()!=TileMap::HALF_OFFSET_X) { + int max_lines=2000; //avoid crash if size too smal + for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) { Vector2 from = xform.xform(node->map_to_world(Vector2(i,si.pos.y))); @@ -540,10 +542,12 @@ void TileMapEditor::_canvas_draw() { Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); canvas_item_editor->draw_line(from,to,col,1); - + if (max_lines--==0) + break; } } else { + int max_lines=10000; //avoid crash if size too smal for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) { @@ -558,11 +562,17 @@ void TileMapEditor::_canvas_draw() { Vector2 to = xform.xform(node->map_to_world(Vector2(i,j+1),true)+ofs); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); canvas_item_editor->draw_line(from,to,col,1); + + if (max_lines--==0) + break; + } } } + int max_lines=10000; //avoid crash if size too smal + if (node->get_half_offset()!=TileMap::HALF_OFFSET_Y) { for(int i=(si.pos.y)-1;i<=(si.pos.y+si.size.y);i++) { @@ -573,6 +583,9 @@ void TileMapEditor::_canvas_draw() { Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); canvas_item_editor->draw_line(from,to,col,1); + if (max_lines--==0) + break; + } } else { @@ -590,6 +603,10 @@ void TileMapEditor::_canvas_draw() { Vector2 to = xform.xform(node->map_to_world(Vector2(j+1,i),true)+ofs); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); canvas_item_editor->draw_line(from,to,col,1); + + if (max_lines--==0) + break; + } } diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index e727668c49..fed5ab1a16 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -360,7 +360,9 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat if (EditorNode::get_log()->is_hidden()) { log_forced_visible=true; - EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); + if (EditorNode::get_singleton()->are_bottom_panels_hidden()) { + EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); + } } EditorNode::get_log()->add_message(t); @@ -538,9 +540,6 @@ void ScriptEditorDebugger::_notification(int p_what) { forward->set_icon( get_icon("Forward","EditorIcons")); dobreak->set_icon( get_icon("Pause","EditorIcons")); docontinue->set_icon( get_icon("DebugContinue","EditorIcons")); - tb->set_normal_texture( get_icon("Close","EditorIcons")); - tb->set_hover_texture( get_icon("CloseHover","EditorIcons")); - tb->set_pressed_texture( get_icon("Close","EditorIcons")); scene_tree_refresh->set_icon( get_icon("Reload","EditorIcons")); le_set->connect("pressed",this,"_live_edit_set"); le_clear->connect("pressed",this,"_live_edit_clear"); @@ -781,13 +780,6 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() { } -void ScriptEditorDebugger::_hide_request() { - - if (EditorNode::get_log()->is_visible()) - EditorNode::get_singleton()->hide_bottom_panel(); - emit_signal("show_debugger",false); -} - void ScriptEditorDebugger::_output_clear() { //output->clear(); @@ -1188,7 +1180,6 @@ void ScriptEditorDebugger::_bind_methods() { ObjectTypeDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break); ObjectTypeDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue); ObjectTypeDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear); - ObjectTypeDB::bind_method(_MD("_hide_request"),&ScriptEditorDebugger::_hide_request); ObjectTypeDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); ObjectTypeDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select); ObjectTypeDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); @@ -1224,13 +1215,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ tabs->set_area_as_parent_rect(); add_child(tabs); - tb = memnew( TextureButton ); - tb->connect("pressed",this,"_hide_request"); - tb->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,20); - tb->set_margin(MARGIN_TOP,2); - add_child(tb); - - VBoxContainer *vbc = memnew( VBoxContainer ); vbc->set_name("Debugger"); diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h index 0be311a990..ecd0494955 100644 --- a/tools/editor/script_editor_debugger.h +++ b/tools/editor/script_editor_debugger.h @@ -76,9 +76,6 @@ class ScriptEditorDebugger : public Control { - TextureButton *tb; - - TabContainer *tabs; LineEdit *reason; @@ -129,7 +126,6 @@ class ScriptEditorDebugger : public Control { void _performance_select(Object *, int, bool); void _stack_dump_frame_selected(); void _output_clear(); - void _hide_request(); void _scene_tree_request(); void _parse_message(const String& p_msg,const Array& p_data); |