Merge pull request #56620 from timothyqiu/left-right-palette-3.x

This commit is contained in:
Rémi Verschelde
2022-01-18 16:38:26 +01:00
committed by GitHub
7 changed files with 138 additions and 42 deletions

View File

@@ -1511,10 +1511,10 @@ void GridMapEditorPlugin::_notification(int p_what) {
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
switch ((int)EditorSettings::get_singleton()->get("editors/grid_map/editor_side")) {
case 0: { // Left.
SpatialEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 0);
SpatialEditor::get_singleton()->move_control_to_left_panel(grid_map_editor);
} break;
case 1: { // Right.
SpatialEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 1);
SpatialEditor::get_singleton()->move_control_to_right_panel(grid_map_editor);
} break;
}
}
@@ -1550,10 +1550,10 @@ GridMapEditorPlugin::GridMapEditorPlugin(EditorNode *p_node) {
grid_map_editor = memnew(GridMapEditor(editor));
switch ((int)EditorSettings::get_singleton()->get("editors/grid_map/editor_side")) {
case 0: { // Left.
add_control_to_container(CONTAINER_SPATIAL_EDITOR_SIDE_LEFT, grid_map_editor);
SpatialEditor::get_singleton()->add_control_to_left_panel(grid_map_editor);
} break;
case 1: { // Right.
add_control_to_container(CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT, grid_map_editor);
SpatialEditor::get_singleton()->add_control_to_right_panel(grid_map_editor);
} break;
}
grid_map_editor->hide();