diff options
-rw-r--r-- | core/variant_call.cpp | 4 | ||||
-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 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | modules/visual_script/visual_script_editor.cpp | 1 | ||||
-rw-r--r-- | scene/gui/popup.cpp | 7 |
14 files changed, 47 insertions, 22 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index aabc2546bc..59d31d2586 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -747,6 +747,7 @@ struct _VariantCall { VCALL_PTR1R(Transform, translated); VCALL_PTR0R(Transform, orthonormalized); VCALL_PTR2R(Transform, looking_at); + VCALL_PTR2R(Transform, interpolate_with); static void _call_Transform_xform(Variant &r_ret, Variant &p_self, const Variant **p_args) { @@ -1691,7 +1692,7 @@ void register_variant_methods() { ADDFUNC1(TRANSFORM2D, TRANSFORM2D, Transform2D, xform_inv, NIL, "v", varray()); ADDFUNC1(TRANSFORM2D, TRANSFORM2D, Transform2D, basis_xform, NIL, "v", varray()); ADDFUNC1(TRANSFORM2D, TRANSFORM2D, Transform2D, basis_xform_inv, NIL, "v", varray()); - ADDFUNC2(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "m", REAL, "c", varray()); + ADDFUNC2(TRANSFORM2D, TRANSFORM2D, Transform2D, interpolate_with, TRANSFORM2D, "transform", REAL, "weight", varray()); ADDFUNC0(BASIS, BASIS, Basis, inverse, varray()); ADDFUNC0(BASIS, BASIS, Basis, transposed, varray()); @@ -1718,6 +1719,7 @@ void register_variant_methods() { ADDFUNC1(TRANSFORM, TRANSFORM, Transform, scaled, VECTOR3, "scale", varray()); ADDFUNC1(TRANSFORM, TRANSFORM, Transform, translated, VECTOR3, "ofs", varray()); ADDFUNC2(TRANSFORM, TRANSFORM, Transform, looking_at, VECTOR3, "target", VECTOR3, "up", varray()); + ADDFUNC2(TRANSFORM, TRANSFORM, Transform, interpolate_with, TRANSFORM, "transform", REAL, "weight", varray()); ADDFUNC1(TRANSFORM, NIL, Transform, xform, NIL, "v", varray()); ADDFUNC1(TRANSFORM, NIL, Transform, xform_inv, NIL, "v", varray()); 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"); diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 38f58799df..7bb80c2510 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -1203,7 +1203,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { edit_mode = memnew(OptionButton); edit_mode->set_area_as_parent_rect(); edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24); - edit_mode->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -14); + edit_mode->set_margin(MARGIN_RIGHT, -14); edit_mode->add_item("Tiles"); edit_mode->add_item("Areas"); hb->add_child(edit_mode); diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 9a1033e954..b9e7a6ffc4 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -3279,7 +3279,6 @@ VisualScriptEditor::VisualScriptEditor() { select_func_text->set_valign(Label::VALIGN_CENTER); select_func_text->set_h_size_flags(SIZE_EXPAND_FILL); add_child(select_func_text); - graph->set_area_as_parent_rect(); hint_text = memnew(Label); hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -100); diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index f2ba6bfbc4..b21139f969 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -276,9 +276,10 @@ void PopupPanel::set_child_rect(Control *p_child) { Ref<StyleBox> p = get_stylebox("panel"); p_child->set_area_as_parent_rect(); - for (int i = 0; i < 4; i++) { - p_child->set_margin(Margin(i), p->get_margin(Margin(i))); - } + p_child->set_margin(MARGIN_LEFT, p->get_margin(MARGIN_LEFT)); + p_child->set_margin(MARGIN_RIGHT, -p->get_margin(MARGIN_RIGHT)); + p_child->set_margin(MARGIN_TOP, p->get_margin(MARGIN_TOP)); + p_child->set_margin(MARGIN_BOTTOM, -p->get_margin(MARGIN_BOTTOM)); } void PopupPanel::_notification(int p_what) { |