From 6fa1b5eca7bfcc32c4f9284819a7c3e87b08ad3c Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Tue, 21 Aug 2018 01:35:48 -0300 Subject: Add option to move Tile/GridMap editors to another side --- editor/editor_plugin.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'editor/editor_plugin.cpp') diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 137e710c5c..6818de8281 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -353,11 +353,17 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C SpatialEditor::get_singleton()->add_control_to_menu_panel(p_control); } break; - case CONTAINER_SPATIAL_EDITOR_SIDE: { + case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: { SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control); SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 0); + } break; + case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { + + SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control); + SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 1); + } break; case CONTAINER_SPATIAL_EDITOR_BOTTOM: { @@ -369,11 +375,17 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C CanvasItemEditor::get_singleton()->add_control_to_menu_panel(p_control); } break; - case CONTAINER_CANVAS_EDITOR_SIDE: { + case CONTAINER_CANVAS_EDITOR_SIDE_LEFT: { CanvasItemEditor::get_singleton()->get_palette_split()->add_child(p_control); CanvasItemEditor::get_singleton()->get_palette_split()->move_child(p_control, 0); + } break; + case CONTAINER_CANVAS_EDITOR_SIDE_RIGHT: { + + CanvasItemEditor::get_singleton()->get_palette_split()->add_child(p_control); + CanvasItemEditor::get_singleton()->get_palette_split()->move_child(p_control, 1); + } break; case CONTAINER_CANVAS_EDITOR_BOTTOM: { @@ -403,7 +415,8 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati SpatialEditor::get_singleton()->remove_control_from_menu_panel(p_control); } break; - case CONTAINER_SPATIAL_EDITOR_SIDE: { + case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: + case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: { SpatialEditor::get_singleton()->get_palette_split()->remove_child(p_control); @@ -418,7 +431,8 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati CanvasItemEditor::get_singleton()->remove_control_from_menu_panel(p_control); } break; - case CONTAINER_CANVAS_EDITOR_SIDE: { + case CONTAINER_CANVAS_EDITOR_SIDE_LEFT: + case CONTAINER_CANVAS_EDITOR_SIDE_RIGHT: { CanvasItemEditor::get_singleton()->get_palette_split()->remove_child(p_control); @@ -785,10 +799,12 @@ void EditorPlugin::_bind_methods() { BIND_ENUM_CONSTANT(CONTAINER_TOOLBAR); BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_MENU); - BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE); + BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE_LEFT); + BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT); BIND_ENUM_CONSTANT(CONTAINER_SPATIAL_EDITOR_BOTTOM); BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_MENU); - BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE); + BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_LEFT); + BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_SIDE_RIGHT); BIND_ENUM_CONSTANT(CONTAINER_CANVAS_EDITOR_BOTTOM); BIND_ENUM_CONSTANT(CONTAINER_PROPERTY_EDITOR_BOTTOM); -- cgit v1.2.3