diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_run.cpp | 2 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/cube_grid_theme_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/sample_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 17 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.h | 1 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 1 | ||||
-rw-r--r-- | editor/project_manager.cpp | 3 | ||||
-rw-r--r-- | editor/property_editor.cpp | 6 |
10 files changed, 39 insertions, 16 deletions
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index 4954b1f741..e1ef20255b 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -93,7 +93,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li int window_placement = EditorSettings::get_singleton()->get("run/window_placement/rect"); switch (window_placement) { - case 0: { // default + case 0: { // top left args.push_back("-p"); args.push_back(itos(screen_rect.position.x) + "x" + itos(screen_rect.position.y)); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 8494c7199e..843e5d0748 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -664,6 +664,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("editors/3d/emulate_3_button_mouse", false); set("editors/3d/warped_mouse_panning", true); + set("editors/3d/orbit_sensitivity", 0.7); + set("editors/3d/freelook_base_speed", 1); set("editors/3d/freelook_activation_modifier", 0); @@ -684,7 +686,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("editors/poly_editor/point_grab_radius", 8); set("run/window_placement/rect", 1); - hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Default,Centered,Custom Position,Force Maximized,Force Full Screen"); + hints["run/window_placement/rect"] = PropertyInfo(Variant::INT, "run/window_placement/rect", PROPERTY_HINT_ENUM, "Top Left,Centered,Custom Position,Force Maximized,Force Fullscreen"); String screen_hints = TTR("Default (Same as Editor)"); for (int i = 0; i < OS::get_singleton()->get_screen_count(); i++) { screen_hints += ",Monitor " + itos(i + 1); diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp index b26b2aec4f..1fcd514b31 100644 --- a/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -368,7 +368,6 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) { p_node->get_viewport()->add_child(theme_editor); theme_editor->set_area_as_parent_rect(); - theme_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END); theme_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN); theme_editor->set_end(Point2(0, 22)); theme_editor->hide(); diff --git a/editor/plugins/sample_editor_plugin.cpp b/editor/plugins/sample_editor_plugin.cpp index 1d6417e2d5..2dd6de1683 100644 --- a/editor/plugins/sample_editor_plugin.cpp +++ b/editor/plugins/sample_editor_plugin.cpp @@ -374,8 +374,8 @@ SampleEditor::SampleEditor() { sample_texframe->add_child(info_label); info_label->set_area_as_parent_rect(); info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,-15); - info_label->set_margin(MARGIN_BOTTOM,4); - info_label->set_margin(MARGIN_RIGHT,4); + info_label->set_margin(MARGIN_BOTTOM,-4); + info_label->set_margin(MARGIN_RIGHT,-4); info_label->set_align(Label::ALIGN_RIGHT); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 1aa9f04484..1a3092b6e4 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -867,6 +867,21 @@ void ScriptTextEditor::_edit_option(int p_op) { //tx->deselect(); } break; + case EDIT_DELETE_LINE: { + + TextEdit *tx = code_editor->get_text_edit(); + Ref<Script> scr = get_edited_script(); + if (scr.is_null()) + return; + + tx->begin_complex_operation(); + int line = tx->cursor_get_line(); + tx->set_line(tx->cursor_get_line(), ""); + tx->backspace_at_cursor(); + tx->cursor_set_line(line); + tx->end_complex_operation(); + + } break; case EDIT_CLONE_DOWN: { TextEdit *tx = code_editor->get_text_edit(); @@ -1392,6 +1407,7 @@ ScriptTextEditor::ScriptTextEditor() { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/move_down"), EDIT_MOVE_LINE_DOWN); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); + edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/delete_line"), EDIT_DELETE_LINE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/clone_down"), EDIT_CLONE_DOWN); edit_menu->get_popup()->add_separator(); @@ -1466,6 +1482,7 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD | KEY_A); ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT | KEY_UP); ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT | KEY_DOWN); + ED_SHORTCUT("script_text_editor/delete_line", TTR("Delete Line"), KEY_MASK_CTRL | KEY_MASK_SHIFT | KEY_K); //leave these at zero, same can be accomplished with tab/shift-tab, including selection //the next/previous in history shortcut in this case makes a lot more sene. diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index e55847832f..c505976223 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -74,6 +74,7 @@ class ScriptTextEditor : public ScriptEditorBase { EDIT_MOVE_LINE_DOWN, EDIT_INDENT_RIGHT, EDIT_INDENT_LEFT, + EDIT_DELETE_LINE, EDIT_CLONE_DOWN, EDIT_PICK_COLOR, EDIT_TO_UPPERCASE, diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 5faacf7a67..41fb275922 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -1453,8 +1453,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { case NAVIGATION_ORBIT: { Point2i relative = _get_warped_mouse_motion(m); - cursor.x_rot += relative.y / 80.0; - cursor.y_rot += relative.x / 80.0; + + real_t degrees_per_pixel = EditorSettings::get_singleton()->get("editors/3d/orbit_sensitivity"); + real_t radians_per_pixel = Math::deg2rad(degrees_per_pixel); + + cursor.x_rot += relative.y * radians_per_pixel; + cursor.y_rot += relative.x * radians_per_pixel; if (cursor.x_rot > Math_PI / 2.0) cursor.x_rot = Math_PI / 2.0; if (cursor.x_rot < -Math_PI / 2.0) @@ -1468,8 +1472,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // It technically works too in ortho, but it's awful for a user due to fov being near zero if (!orthogonal) { Point2i relative = _get_warped_mouse_motion(m); - cursor.x_rot += relative.y / 120.0; - cursor.y_rot += relative.x / 120.0; + + real_t degrees_per_pixel = EditorSettings::get_singleton()->get("editors/3d/orbit_sensitivity"); + real_t radians_per_pixel = Math::deg2rad(degrees_per_pixel); + + cursor.x_rot += relative.y * radians_per_pixel; + cursor.y_rot += relative.x * radians_per_pixel; if (cursor.x_rot > Math_PI / 2.0) cursor.x_rot = Math_PI / 2.0; if (cursor.x_rot < -Math_PI / 2.0) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index bed4727bb9..8396b4d412 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -294,7 +294,6 @@ TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) { p_node->get_viewport()->add_child(tileset_editor); tileset_editor->set_area_as_parent_rect(); - tileset_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END); tileset_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN); tileset_editor->set_end(Point2(0, 22)); tileset_editor->hide(); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index dc0c888eea..1ea8440508 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -969,7 +969,6 @@ void ProjectManager::_run_project_confirm() { return; } - const String &selected = E->key(); String path = EditorSettings::get_singleton()->get("projects/" + selected); @@ -1220,7 +1219,7 @@ ProjectManager::ProjectManager() { panel->add_child(vb); vb->set_area_as_parent_rect(20 * EDSCALE); vb->set_margin(MARGIN_TOP, 4 * EDSCALE); - vb->set_margin(MARGIN_BOTTOM, 4 * EDSCALE); + vb->set_margin(MARGIN_BOTTOM, -4 * EDSCALE); vb->add_constant_override("separation", 15 * EDSCALE); String cp; diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 0ec83d8a36..1bd748a083 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -1939,10 +1939,8 @@ CustomPropertyEditor::CustomPropertyEditor() { text_edit = memnew(TextEdit); add_child(text_edit); - text_edit->set_area_as_parent_rect(); - for (int i = 0; i < 4; i++) - text_edit->set_margin((Margin)i, 5); - text_edit->set_margin(MARGIN_BOTTOM, 30); + text_edit->set_area_as_parent_rect(5); + text_edit->set_margin(MARGIN_BOTTOM, -30); text_edit->hide(); text_edit->connect("text_changed", this, "_text_edit_changed"); |