diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | tools/editor/plugins/tile_map_editor_plugin.h | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 21474205d7..118ddc97e6 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -728,7 +728,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { add_child(palette); // Add menu items - HBoxContainer *canvas_item_editor_hb = memnew( HBoxContainer ); + canvas_item_editor_hb = memnew( HBoxContainer ); CanvasItemEditor::get_singleton()->add_control_to_menu_panel(canvas_item_editor_hb); canvas_item_editor_hb->add_child( memnew( VSeparator )); mirror_x = memnew( ToolButton ); @@ -741,6 +741,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { mirror_y->set_tooltip("Mirror Y (S)"); mirror_y->set_focus_mode(FOCUS_NONE); canvas_item_editor_hb->add_child(mirror_y); + canvas_item_editor_hb->hide(); tool=TOOL_NONE; selection_active=false; @@ -762,10 +763,12 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { if (p_visible) { tile_map_editor->show(); + tile_map_editor->get_canvas_item_editor_hb()->show(); } else { tile_map_editor->hide(); + tile_map_editor->get_canvas_item_editor_hb()->hide(); tile_map_editor->edit(NULL); } diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h index 0a09a29f9d..ef869591bd 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.h +++ b/tools/editor/plugins/tile_map_editor_plugin.h @@ -73,6 +73,8 @@ class TileMapEditor : public VBoxContainer { ToolButton *mirror_x; ToolButton *mirror_y; + HBoxContainer *canvas_item_editor_hb; + struct CellOp { int idx; @@ -102,6 +104,7 @@ protected: static void _bind_methods(); public: + HBoxContainer *get_canvas_item_editor_hb() const { return canvas_item_editor_hb; } Vector2 snap_point(const Vector2& p_point) const; bool forward_input_event(const InputEvent& p_event); void edit(Node *p_tile_map); @@ -115,6 +118,7 @@ class TileMapEditorPlugin : public EditorPlugin { TileMapEditor *tile_map_editor; EditorNode *editor; + public: virtual bool forward_input_event(const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); } |