diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 8 | ||||
-rw-r--r-- | editor/doc/doc_data.cpp | 14 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 19 | ||||
-rw-r--r-- | editor/editor_file_system.cpp | 10 | ||||
-rw-r--r-- | editor/editor_inspector.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 16 | ||||
-rw-r--r-- | editor/editor_node.h | 1 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 22 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 4 | ||||
-rw-r--r-- | editor/editor_spin_slider.cpp | 4 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 20 | ||||
-rw-r--r-- | editor/icons/icon_point_mesh.svg | 7 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.h | 1 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 46 | ||||
-rw-r--r-- | editor/plugins/text_editor.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/text_editor.h | 1 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 5 |
20 files changed, 117 insertions, 105 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index b52148b758..9b376ae090 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -170,7 +170,7 @@ public: case Animation::TYPE_TRANSFORM: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); d_new[p_name] = p_value; setting = true; undo_redo->create_action(TTR("Anim Change Transform")); @@ -209,7 +209,7 @@ public: case Animation::TYPE_METHOD: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); bool change_notify_deserved = false; bool mergeable = false; @@ -840,7 +840,7 @@ public: case Animation::TYPE_TRANSFORM: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); d_new[p_name] = p_value; if (!setting) { @@ -874,7 +874,7 @@ public: case Animation::TYPE_METHOD: { Dictionary d_old = animation->track_get_key_value(track, key); - Dictionary d_new = d_old; + Dictionary d_new = d_old.duplicate(); bool mergeable = false; diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 6f09e73fab..5b8c8fffb8 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -741,10 +741,9 @@ Error DocData::load_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { Ref<XMLParser> parser = memnew(XMLParser); Error err2 = parser->open(p_dir.plus_file(path)); if (err2) @@ -752,7 +751,7 @@ Error DocData::load_classes(const String &p_dir) { _load(parser); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); @@ -771,13 +770,12 @@ Error DocData::erase_classes(const String &p_dir) { da->list_dir_begin(); String path; - bool isdir; - path = da->get_next(&isdir); + path = da->get_next(); while (path != String()) { - if (!isdir && path.ends_with("xml")) { + if (!da->current_is_dir() && path.ends_with("xml")) { to_erase.push_back(path); } - path = da->get_next(&isdir); + path = da->get_next(); } da->list_dir_end(); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 24c5a788b6..be01df76f7 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "editor_file_dialog.h" + #include "core/os/file_access.h" #include "core/os/keyboard.h" #include "core/os/os.h" @@ -731,19 +732,15 @@ void EditorFileDialog::update_file_list() { List<String> files; List<String> dirs; - bool is_dir; - bool is_hidden; String item; - while ((item = dir_access->get_next(&is_dir)) != "") { + while ((item = dir_access->get_next()) != "") { if (item == "." || item == "..") continue; - is_hidden = dir_access->current_is_hidden(); - - if (show_hidden_files || !is_hidden) { - if (!is_dir) + if (show_hidden_files || !dir_access->current_is_hidden()) { + if (!dir_access->current_is_dir()) files.push_back(item); else dirs.push_back(item); @@ -1507,9 +1504,9 @@ EditorFileDialog::EditorFileDialog() { HBoxContainer *pathhb = memnew(HBoxContainer); dir_prev = memnew(ToolButton); - dir_prev->set_tooltip(TTR("Previous Folder")); + dir_prev->set_tooltip(TTR("Go to previous folder.")); dir_next = memnew(ToolButton); - dir_next->set_tooltip(TTR("Next Folder")); + dir_next->set_tooltip(TTR("Go to next folder.")); dir_up = memnew(ToolButton); dir_up->set_tooltip(TTR("Go to parent folder.")); @@ -1528,7 +1525,7 @@ EditorFileDialog::EditorFileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); - refresh->set_tooltip(TTR("Refresh")); + refresh->set_tooltip(TTR("Refresh files.")); refresh->connect("pressed", this, "_update_file_list"); pathhb->add_child(refresh); @@ -1541,7 +1538,7 @@ EditorFileDialog::EditorFileDialog() { show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); - show_hidden->set_tooltip(TTR("Toggle visibility of hidden files.")); + show_hidden->set_tooltip(TTR("Toggle the visibility of hidden files.")); show_hidden->connect("toggled", this, "set_show_hidden_files"); pathhb->add_child(show_hidden); diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 87a37acac6..be3df2815e 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -673,12 +673,11 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; @@ -870,12 +869,11 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const da->list_dir_begin(); while (true) { - bool isdir; - String f = da->get_next(&isdir); + String f = da->get_next(); if (f == "") break; - if (isdir) { + if (da->current_is_dir()) { if (f.begins_with(".")) //ignore hidden and . / .. continue; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e4ddf44bc4..70bbd0fd6c 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -504,7 +504,7 @@ bool EditorProperty::use_keying_next() const { PropertyInfo &p = I->get(); if (p.name == property) { - return p.hint == PROPERTY_HINT_SPRITE_FRAME; + return (p.usage & PROPERTY_USAGE_KEYING_INCREMENTS); } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f1944bf63f..3853d18e17 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2615,7 +2615,7 @@ void EditorNode::_exit_editor() { // Dim the editor window while it's quitting to make it clearer that it's busy. // No transition is applied, as the effect needs to be visible immediately - float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount")); + float c = 0.4f; Color dim_color = Color(c, c, c); gui_base->set_modulate(dim_color); @@ -5051,9 +5051,8 @@ void EditorNode::_start_dimming(bool p_dimming) { void EditorNode::_dim_timeout() { _dim_time += _dim_timer->get_wait_time(); - float wait_time = EditorSettings::get_singleton()->get("interface/editor/dim_transition_time"); - - float c = 1.0f - (float)EditorSettings::get_singleton()->get("interface/editor/dim_amount"); + float wait_time = 0.08f; + float c = 0.4f; Color base = _dimming ? Color(1, 1, 1) : Color(c, c, c); Color final = _dimming ? Color(c, c, c) : Color(1, 1, 1); @@ -5557,6 +5556,8 @@ EditorNode::EditorNode() { EDITOR_DEF_RST("interface/scene_tabs/restore_scenes_on_load", false); EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true); EDITOR_DEF_RST("interface/inspector/capitalize_properties", true); + EDITOR_DEF_RST("interface/inspector/default_float_step", 0.001); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::REAL, "interface/inspector/default_float_step", PROPERTY_HINT_EXP_RANGE, "0,1,0")); EDITOR_DEF_RST("interface/inspector/disable_folding", false); EDITOR_DEF_RST("interface/inspector/auto_unfold_foreign_scenes", true); EDITOR_DEF("interface/inspector/horizontal_vector2_editing", false); @@ -6253,6 +6254,13 @@ EditorNode::EditorNode() { bottom_panel_hb_editors = memnew(HBoxContainer); bottom_panel_hb_editors->set_h_size_flags(Control::SIZE_EXPAND_FILL); bottom_panel_hb->add_child(bottom_panel_hb_editors); + + version_label = memnew(Label); + version_label->set_text(VERSION_FULL_CONFIG); + // Fade out the version label to be less prominent, but still readable + version_label->set_self_modulate(Color(1, 1, 1, 0.6)); + bottom_panel_hb->add_child(version_label); + bottom_panel_raise = memnew(ToolButton); bottom_panel_raise->set_icon(gui_base->get_icon("ExpandBottomDock", "EditorIcons")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 9aee19e6c1..bd7bb58f41 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -431,6 +431,7 @@ private: HBoxContainer *bottom_panel_hb; HBoxContainer *bottom_panel_hb_editors; VBoxContainer *bottom_panel_vb; + Label *version_label; ToolButton *bottom_panel_raise; void _bottom_panel_raise_toggled(bool); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index d54f72382c..3300228921 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2904,6 +2904,8 @@ void EditorInspectorDefaultPlugin::parse_begin(Object *p_object) { bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage) { + float default_float_step = EDITOR_GET("interface/inspector/default_float_step"); + switch (p_type) { // atomic types @@ -3010,7 +3012,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } else { EditorPropertyFloat *editor = memnew(EditorPropertyFloat); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; bool exp_range = false; bool greater = true, lesser = true; @@ -3107,7 +3109,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ case Variant::VECTOR2: { EditorPropertyVector2 *editor = memnew(EditorPropertyVector2); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3125,7 +3127,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; // 5 case Variant::RECT2: { EditorPropertyRect2 *editor = memnew(EditorPropertyRect2); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3142,7 +3144,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::VECTOR3: { EditorPropertyVector3 *editor = memnew(EditorPropertyVector3); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3160,7 +3162,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::TRANSFORM2D: { EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3178,7 +3180,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::PLANE: { EditorPropertyPlane *editor = memnew(EditorPropertyPlane); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3195,7 +3197,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::QUAT: { EditorPropertyQuat *editor = memnew(EditorPropertyQuat); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3212,7 +3214,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; // 10 case Variant::AABB: { EditorPropertyAABB *editor = memnew(EditorPropertyAABB); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3229,7 +3231,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::BASIS: { EditorPropertyBasis *editor = memnew(EditorPropertyBasis); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { @@ -3246,7 +3248,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; case Variant::TRANSFORM: { EditorPropertyTransform *editor = memnew(EditorPropertyTransform); - double min = -65535, max = 65535, step = 0.001; + double min = -65535, max = 65535, step = default_float_step; bool hide_slider = true; if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index b4c1fc3463..948a86924b 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -336,10 +336,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("interface/editor/code_font", ""); hints["interface/editor/code_font"] = PropertyInfo(Variant::STRING, "interface/editor/code_font", PROPERTY_HINT_GLOBAL_FILE, "*.ttf,*.otf", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/dim_editor_on_dialog_popup", true); - _initial_set("interface/editor/dim_amount", 0.6f); - hints["interface/editor/dim_amount"] = PropertyInfo(Variant::REAL, "interface/editor/dim_amount", PROPERTY_HINT_RANGE, "0,1,0.01", PROPERTY_USAGE_DEFAULT); - _initial_set("interface/editor/dim_transition_time", 0.08f); - hints["interface/editor/dim_transition_time"] = PropertyInfo(Variant::REAL, "interface/editor/dim_transition_time", PROPERTY_HINT_RANGE, "0,1,0.001", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/low_processor_mode_sleep_usec", 6900); // ~144 FPS hints["interface/editor/low_processor_mode_sleep_usec"] = PropertyInfo(Variant::REAL, "interface/editor/low_processor_mode_sleep_usec", PROPERTY_HINT_RANGE, "1,100000,1", PROPERTY_USAGE_DEFAULT); _initial_set("interface/editor/unfocused_low_processor_mode_sleep_usec", 50000); // 20 FPS diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index dcb106899e..9966394025 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -38,9 +38,9 @@ String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const { } String EditorSpinSlider::get_text_value() const { - int zeros = Math::step_decimals(get_step()); - return String::num(get_value(), zeros); + return String::num(get_value(), Math::range_step_decimals(get_step())); } + void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) { if (read_only) diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index bd61e6182c..ecfad4d146 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -52,18 +52,16 @@ void ExportTemplateManager::_update_template_list() { DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); Error err = d->change_dir(EditorSettings::get_singleton()->get_templates_dir()); - d->list_dir_begin(); Set<String> templates; - + d->list_dir_begin(); if (err == OK) { - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (isdir && !c.begins_with(".")) { + if (d->current_is_dir() && !c.begins_with(".")) { templates.insert(c); } - c = d->get_next(&isdir); + c = d->get_next(); } } d->list_dir_end(); @@ -154,18 +152,14 @@ void ExportTemplateManager::_uninstall_template_confirm() { ERR_FAIL_COND(err != OK); Vector<String> files; - d->list_dir_begin(); - - bool isdir; - String c = d->get_next(&isdir); + String c = d->get_next(); while (c != String()) { - if (!isdir) { + if (!d->current_is_dir()) { files.push_back(c); } - c = d->get_next(&isdir); + c = d->get_next(); } - d->list_dir_end(); for (int i = 0; i < files.size(); i++) { diff --git a/editor/icons/icon_point_mesh.svg b/editor/icons/icon_point_mesh.svg new file mode 100644 index 0000000000..8da7759daf --- /dev/null +++ b/editor/icons/icon_point_mesh.svg @@ -0,0 +1,7 @@ +<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"> +<g fill="#ffd684" stroke="#000" stroke-dasharray="null" stroke-linecap="null" stroke-linejoin="null" stroke-opacity="0" stroke-width="0"> +<ellipse cx="3.7237" cy="3.0268" rx="2.0114" ry="1.9956"/> +<ellipse cx="11.717" cy="6.1734" rx="2.0114" ry="1.9956"/> +<ellipse cx="6.5219" cy="12.477" rx="2.0114" ry="1.9956"/> +</g> +</svg> diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index d999f3189e..9cf889c5b0 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2088,16 +2088,18 @@ bool ScriptEditor::edit(const RES &p_resource, int p_line, int p_col, bool p_gra } ERR_FAIL_COND_V(!se, false); - bool highlighter_set = false; - for (int i = 0; i < syntax_highlighters_func_count; i++) { - SyntaxHighlighter *highlighter = syntax_highlighters_funcs[i](); - se->add_syntax_highlighter(highlighter); - - if (script != NULL && !highlighter_set) { - List<String> languages = highlighter->get_supported_languages(); - if (languages.find(script->get_language()->get_name())) { - se->set_syntax_highlighter(highlighter); - highlighter_set = true; + if (p_resource->get_class_name() != StringName("VisualScript")) { + bool highlighter_set = false; + for (int i = 0; i < syntax_highlighters_func_count; i++) { + SyntaxHighlighter *highlighter = syntax_highlighters_funcs[i](); + se->add_syntax_highlighter(highlighter); + + if (script != NULL && !highlighter_set) { + List<String> languages = highlighter->get_supported_languages(); + if (languages.find(script->get_language()->get_name())) { + se->set_syntax_highlighter(highlighter); + highlighter_set = true; + } } } } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 438621115b..07303da2ff 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1819,6 +1819,15 @@ ScriptTextEditor::ScriptTextEditor() { code_editor->get_text_edit()->set_drag_forwarding(this); } +ScriptTextEditor::~ScriptTextEditor() { + for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { + if (E->get() != NULL) { + memdelete(E->get()); + } + } + highlighters.clear(); +} + static ScriptEditorBase *create_editor(const RES &p_resource) { if (Object::cast_to<Script>(*p_resource)) { diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h index 9a2a514a6e..4dbade472c 100644 --- a/editor/plugins/script_text_editor.h +++ b/editor/plugins/script_text_editor.h @@ -231,6 +231,7 @@ public: virtual void validate(); ScriptTextEditor(); + ~ScriptTextEditor(); }; #endif // SCRIPT_TEXT_EDITOR_H diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 52fadf1e71..630f3ba9e1 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -1291,6 +1291,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 ray_pos = _get_ray_pos(m->get_position()); Vector3 ray = _get_ray(m->get_position()); + float snap = EDITOR_GET("interface/inspector/default_float_step"); + int snap_step_decimals = Math::range_step_decimals(snap); switch (_edit.mode) { @@ -1372,18 +1374,14 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_scale_snap() / 100; - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Scaling: ") + motion_snapped); - - } else { - set_message(TTR("Scaling: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + // This might not be necessary anymore after issue #288 is solved (in 4.0?). + set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1502,17 +1500,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_translate_snap(); - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Translating: ") + motion_snapped); - } else { - set_message(TTR("Translating: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1601,20 +1595,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center)); if (_edit.snap || spatial_editor->is_snap_enabled()) { - - float snap = spatial_editor->get_rotate_snap(); - - if (snap) { - angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 - angle -= Math::fmod(angle, snap); - set_message(vformat(TTR("Rotating %s degrees."), rtos(angle))); - angle = Math::deg2rad(angle); - } else - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); - - } else { - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); + snap = spatial_editor->get_rotate_snap(); } + angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 + angle -= Math::fmod(angle, snap); + set_message(vformat(TTR("Rotating %s degrees."), String::num(angle, snap_step_decimals))); + angle = Math::deg2rad(angle); List<Node *> &selection = editor_selection->get_selected_node_list(); diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index fae88f4eb7..34d8e6aff5 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -695,5 +695,14 @@ TextEditor::TextEditor() { code_editor->get_text_edit()->set_drag_forwarding(this); } +TextEditor::~TextEditor() { + for (const Map<String, SyntaxHighlighter *>::Element *E = highlighters.front(); E; E = E->next()) { + if (E->get() != NULL) { + memdelete(E->get()); + } + } + highlighters.clear(); +} + void TextEditor::validate() { } diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h index ae0c0bcf93..3a330576ae 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -154,6 +154,7 @@ public: static void register_editor(); TextEditor(); + ~TextEditor(); }; #endif // TEXT_EDITOR_H diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 48a587d4db..feb2cdd071 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1730,7 +1730,7 @@ void ProjectManager::_dim_window() { // Dim the project manager window while it's quitting to make it clearer that it's busy. // No transition is applied, as the effect needs to be visible immediately - float c = 1.0f - float(EDITOR_GET("interface/editor/dim_amount")); + float c = 0.4f; Color dim_color = Color(c, c, c); gui_base->set_modulate(dim_color); } diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index 0c280b16b2..a749509ce4 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1009,7 +1009,10 @@ void ScriptEditorDebugger::_performance_draw() { Ref<Font> graph_font = get_font("font", "TextEdit"); if (which.empty()) { - perf_draw->draw_string(graph_font, Point2(0, graph_font->get_ascent()), TTR("Pick one or more items from the list to display the graph."), get_color("font_color", "Label"), perf_draw->get_size().x); + String text = TTR("Pick one or more items from the list to display the graph."); + + perf_draw->draw_string(graph_font, Point2i(MAX(0, perf_draw->get_size().x - graph_font->get_string_size(text).x), perf_draw->get_size().y + graph_font->get_ascent()) / 2, text, get_color("font_color", "Label"), perf_draw->get_size().x); + return; } |