diff options
Diffstat (limited to 'editor/plugins')
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.cpp | 20 | ||||
| -rw-r--r-- | editor/plugins/animation_player_editor_plugin.h | 3 | ||||
| -rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 7 | ||||
| -rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 30 | ||||
| -rw-r--r-- | editor/plugins/curve_editor_plugin.h | 29 | ||||
| -rw-r--r-- | editor/plugins/gradient_texture_editor_plugin.cpp | 33 | ||||
| -rw-r--r-- | editor/plugins/gradient_texture_editor_plugin.h | 29 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 100 | ||||
| -rw-r--r-- | editor/plugins/script_editor_plugin.h | 9 | ||||
| -rw-r--r-- | editor/plugins/script_text_editor.cpp | 1 | ||||
| -rw-r--r-- | editor/plugins/shader_editor_plugin.cpp | 2 |
11 files changed, 242 insertions, 21 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 0be7b202a8..b4398427f8 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -118,16 +118,7 @@ void AnimationPlayerEditor::_notification(int p_what) { blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed"); - nodename->set_icon(get_icon("AnimationPlayer", "EditorIcons")); - - /* - anim_editor_load->set_normal_texture( get_icon("AnimGet","EditorIcons")); - anim_editor_store->set_normal_texture( get_icon("AnimSet","EditorIcons")); - anim_editor_load->set_pressed_texture( get_icon("AnimGet","EditorIcons")); - anim_editor_store->set_pressed_texture( get_icon("AnimSet","EditorIcons")); - anim_editor_load->set_hover_texture( get_icon("AnimGetHl","EditorIcons")); - anim_editor_store->set_hover_texture( get_icon("AnimSetHl","EditorIcons")); -*/ + // nodename->set_icon(get_icon("AnimationPlayer", "EditorIcons")); get_tree()->connect("node_removed", this, "_node_removed"); } @@ -793,7 +784,7 @@ void AnimationPlayerEditor::_update_player() { if (player) nodename->set_text(player->get_name()); else - nodename->set_text("<empty>"); + nodename->set_text(TTR("No player selected")); add_anim->set_disabled(player == NULL); load_anim->set_disabled(player == NULL); @@ -1367,9 +1358,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { //tool_anim->get_popup()->add_item("Edit Anim Resource",TOOL_PASTE_ANIM); hb->add_child(tool_anim); - nodename = memnew(Button); + hb->add_child(memnew(VSeparator)); + nodename_icon = memnew(TextureRect); + nodename_icon->set_stretch_mode(TextureRect::STRETCH_KEEP_CENTERED); + hb->add_child(nodename_icon); + nodename = memnew(Label); hb->add_child(nodename); pin = memnew(ToolButton); + pin->set_tooltip(TTR("Keep this animation selected?")); pin->set_toggle_mode(true); hb->add_child(pin); diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index a042da14df..d80f9dccf2 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -85,7 +85,8 @@ class AnimationPlayerEditor : public VBoxContainer { Button *remove_anim; MenuButton *tool_anim; ToolButton *pin; - Button *nodename; + Label *nodename; + TextureRect *nodename_icon; SpinBox *frame; LineEdit *scale; LineEdit *name; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 1a533dce32..430a5adeb1 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -3123,6 +3123,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { editor_selection->connect("selection_changed", this, "update"); hb = memnew(HBoxContainer); + hb->add_style_override("bg", editor->get_gui_base()->get_stylebox("panel", "PanelContainer")); add_child(hb); hb->set_area_as_parent_rect(); @@ -3299,6 +3300,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_hb->hide(); key_loc_button = memnew(Button("loc")); + key_loc_button = memnew(Button("loc")); + key_loc_button->set_flat(true); key_loc_button->set_toggle_mode(true); key_loc_button->set_pressed(true); key_loc_button->set_focus_mode(FOCUS_NONE); @@ -3307,6 +3310,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_loc_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_POS)); animation_hb->add_child(key_loc_button); key_rot_button = memnew(Button("rot")); + key_rot_button->set_flat(true); key_rot_button->set_toggle_mode(true); key_rot_button->set_pressed(true); key_rot_button->set_focus_mode(FOCUS_NONE); @@ -3315,13 +3319,14 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { key_rot_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_ROT)); animation_hb->add_child(key_rot_button); key_scale_button = memnew(Button("scl")); + key_scale_button->set_flat(true); key_scale_button->set_toggle_mode(true); key_scale_button->set_focus_mode(FOCUS_NONE); key_scale_button->add_color_override("font_color", Color(1, 0.6, 0.6)); key_scale_button->add_color_override("font_color_pressed", Color(0.6, 1, 0.6)); key_scale_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_SCALE)); animation_hb->add_child(key_scale_button); - key_insert_button = memnew(Button); + key_insert_button = memnew(ToolButton); key_insert_button->set_focus_mode(FOCUS_NONE); key_insert_button->connect("pressed", this, "_popup_callback", varray(ANIM_INSERT_KEY)); key_insert_button->set_tooltip(TTR("Insert Keys")); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 52edc75bc0..f3ad5c0fd1 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -1,8 +1,38 @@ +/*************************************************************************/ +/* curve_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "curve_editor_plugin.h" #include "canvas_item_editor_plugin.h" #include "os/keyboard.h" #include "spatial_editor_plugin.h" + void CurveTextureEdit::_gui_input(const InputEvent &p_event) { if (p_event.type == InputEvent::KEY && p_event.key.pressed && p_event.key.scancode == KEY_DELETE && grabbed != -1) { diff --git a/editor/plugins/curve_editor_plugin.h b/editor/plugins/curve_editor_plugin.h index e98cec2727..ebe05539aa 100644 --- a/editor/plugins/curve_editor_plugin.h +++ b/editor/plugins/curve_editor_plugin.h @@ -1,3 +1,32 @@ +/*************************************************************************/ +/* curve_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef CURVE_EDITOR_PLUGIN_H #define CURVE_EDITOR_PLUGIN_H diff --git a/editor/plugins/gradient_texture_editor_plugin.cpp b/editor/plugins/gradient_texture_editor_plugin.cpp index 9551fe19fa..41dd64d931 100644 --- a/editor/plugins/gradient_texture_editor_plugin.cpp +++ b/editor/plugins/gradient_texture_editor_plugin.cpp @@ -1,10 +1,39 @@ +/*************************************************************************/ +/* gradient_texture_editor_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "gradient_texture_editor_plugin.h" #include "canvas_item_editor_plugin.h" -#include "spatial_editor_plugin.h" - #include "os/keyboard.h" #include "scene/resources/default_theme/theme_data.h" +#include "spatial_editor_plugin.h" + #define POINT_WIDTH 8 GradientTextureEdit::GradientTextureEdit() { diff --git a/editor/plugins/gradient_texture_editor_plugin.h b/editor/plugins/gradient_texture_editor_plugin.h index 5af828f17c..cb2f6b4061 100644 --- a/editor/plugins/gradient_texture_editor_plugin.h +++ b/editor/plugins/gradient_texture_editor_plugin.h @@ -1,3 +1,32 @@ +/*************************************************************************/ +/* gradient_texture_editor_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef GRADIENT_TEXTURE_EDITOR_PLUGIN_H #define GRADIENT_TEXTURE_EDITOR_PLUGIN_H diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index cdcc0a0855..a5414325d0 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -411,6 +411,80 @@ void ScriptEditor::_go_to_tab(int p_idx) { _update_selected_editor_menu(); } +void ScriptEditor::_add_recent_script(String p_path) { + + if (p_path.empty()) { + return; + } + + // remove if already stored + int already_recent = previous_scripts.find(p_path); + if (already_recent >= 0) { + previous_scripts.remove(already_recent); + } + + // add to list + previous_scripts.insert(0, p_path); + + _update_recent_scripts(); +} + +void ScriptEditor::_update_recent_scripts() { + + // make sure we don't exceed max size + const int max_history = EDITOR_DEF("text_editor/files/maximum_recent_files", 20); + if (previous_scripts.size() > max_history) { + previous_scripts.resize(max_history); + } + + recent_scripts->clear(); + + recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T)); + recent_scripts->add_separator(); + + const int max_shown = 8; + for (int i = 0; i < previous_scripts.size() && i <= max_shown; i++) { + String path = previous_scripts.get(i); + // just show script name and last dir + recent_scripts->add_item(path.get_slice("/", path.get_slice_count("/") - 2) + "/" + path.get_file()); + } + + recent_scripts->add_separator(); + recent_scripts->add_shortcut(ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files"))); +} + +void ScriptEditor::_open_recent_script(int p_idx) { + + // clear button + if (p_idx == recent_scripts->get_item_count() - 1) { + previous_scripts.clear(); + _update_recent_scripts(); + return; + } + + // take two for the open recent button + if (p_idx > 0) { + p_idx -= 2; + } + + if (p_idx < previous_scripts.size() && p_idx >= 0) { + + String path = previous_scripts.get(p_idx); + // if its not on disk its a help file or deleted + if (FileAccess::exists(path)) { + Ref<Script> script = ResourceLoader::load(path); + if (script.is_valid()) { + edit(script, true); + } + // if it's a path then its most likely a delted file not help + } else if (!path.is_resource_file()) { + _help_class_open(path); + } + previous_scripts.remove(p_idx); + _update_recent_scripts(); + } +} + void ScriptEditor::_close_tab(int p_idx, bool p_save) { int selected = p_idx; @@ -420,12 +494,16 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { Node *tselected = tab_container->get_child(selected); ScriptEditorBase *current = tab_container->get_child(selected)->cast_to<ScriptEditorBase>(); if (current) { + _add_recent_script(current->get_edited_script()->get_path()); if (p_save) { apply_scripts(); } if (current->get_edit_menu()) { memdelete(current->get_edit_menu()); } + } else { + EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>(); + _add_recent_script(help->get_class()); } //remove from history @@ -1296,7 +1374,8 @@ void ScriptEditor::_update_script_colors() { int non_zero_hist_size = (hist_size == 0) ? 1 : hist_size; float v = Math::ease((edit_pass - pass) / float(non_zero_hist_size), 0.4); - script_list->set_item_custom_bg_color(i, hot_color.linear_interpolate(cold_color, v)); + //script_list->set_item_custom_bg_color(i, hot_color.linear_interpolate(cold_color, v)); + script_list->set_item_custom_font_color(i, hot_color.linear_interpolate(cold_color, v)); } } } @@ -1649,7 +1728,7 @@ void ScriptEditor::_editor_settings_changed() { trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/files/trim_trailing_whitespace_on_save"); convert_indent_on_save = EditorSettings::get_singleton()->get("text_editor/indent/convert_indent_on_save"); - use_space_indentation = EditorSettings::get_singleton()->get("text_editor/indent/type") == "Tabs" ? 0 : 1; + use_space_indentation = EditorSettings::get_singleton()->get("text_editor/indent/type"); float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs"); if (autosave_time > 0) { @@ -1977,6 +2056,7 @@ void ScriptEditor::_bind_methods() { ClassDB::bind_method("_close_discard_current_tab", &ScriptEditor::_close_discard_current_tab); ClassDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab); ClassDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs); + ClassDB::bind_method("_open_recent_script", &ScriptEditor::_open_recent_script); ClassDB::bind_method("_editor_play", &ScriptEditor::_editor_play); ClassDB::bind_method("_editor_pause", &ScriptEditor::_editor_pause); ClassDB::bind_method("_editor_stop", &ScriptEditor::_editor_stop); @@ -2032,6 +2112,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_split->set_split_offset(140); tab_container = memnew(TabContainer); + tab_container->add_style_override("panel", p_editor->get_gui_base()->get_stylebox("EditorBG", "EditorStyles")); tab_container->set_tabs_visible(false); script_split->add_child(tab_container); @@ -2046,6 +2127,14 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->set_text(TTR("File")); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/new", TTR("New")), FILE_NEW); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/open", TTR("Open")), FILE_OPEN); + file_menu->get_popup()->add_submenu_item(TTR("Open Recent"), "RecentScripts", FILE_OPEN_RECENT); + + recent_scripts = memnew(PopupMenu); + recent_scripts->set_name("RecentScripts"); + file_menu->get_popup()->add_child(recent_scripts); + recent_scripts->connect("id_pressed", this, "_open_recent_script"); + _update_recent_scripts(); + file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KEY_MASK_ALT | KEY_MASK_CMD | KEY_S), FILE_SAVE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As..")), FILE_SAVE_AS); @@ -2342,8 +2431,8 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/open_scripts/script_temperature_enabled", true); EDITOR_DEF("text_editor/open_scripts/highlight_current_script", true); EDITOR_DEF("text_editor/open_scripts/script_temperature_history_size", 15); - EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color", Color(1, 0, 0, 0.3)); - EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color", Color(0, 0, 1, 0.3)); + EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color", Color::html("ff5446")); + EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color", Color::html("647b93")); EDITOR_DEF("text_editor/open_scripts/current_script_background_color", Color(0.81, 0.81, 0.14, 0.63)); EDITOR_DEF("text_editor/open_scripts/group_help_pages", true); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "text_editor/open_scripts/sort_scripts_by", PROPERTY_HINT_ENUM, "Name,Path")); @@ -2352,6 +2441,9 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { EDITOR_DEF("text_editor/open_scripts/list_script_names_as", 0); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "text_editor/external/exec_path", PROPERTY_HINT_GLOBAL_FILE)); EDITOR_DEF("text_editor/external/exec_flags", ""); + + ED_SHORTCUT("script_editor/open_recent", TTR("Open Recent"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_T); + ED_SHORTCUT("script_editor/clear_recent", TTR("Clear Recent Files")); } ScriptEditorPlugin::~ScriptEditorPlugin() { diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 6a54609167..983847ddaf 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -120,6 +120,7 @@ class ScriptEditor : public VBoxContainer { enum { FILE_NEW, FILE_OPEN, + FILE_OPEN_RECENT, FILE_SAVE, FILE_SAVE_AS, FILE_SAVE_ALL, @@ -169,6 +170,8 @@ class ScriptEditor : public VBoxContainer { Timer *autosave_timer; uint64_t idle; + PopupMenu *recent_scripts; + Button *help_search; Button *site_search; Button *class_search; @@ -207,6 +210,8 @@ class ScriptEditor : public VBoxContainer { Vector<ScriptHistory> history; int history_pos; + Vector<String> previous_scripts; + EditorHelpIndex *help_index; void _tab_changed(int p_which); @@ -224,6 +229,10 @@ class ScriptEditor : public VBoxContainer { bool _test_script_times_on_disk(Ref<Script> p_for_script = Ref<Script>()); + void _add_recent_script(String p_path); + void _update_recent_scripts(); + void _open_recent_script(int p_idx); + void _close_tab(int p_idx, bool p_save = true); void _close_current_tab(); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 84aa4739ea..3bb1c7852b 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1322,6 +1322,7 @@ ScriptTextEditor::ScriptTextEditor() { code_editor = memnew(CodeTextEditor); add_child(code_editor); + code_editor->add_constant_override("separation", 0); code_editor->set_area_as_parent_rect(); code_editor->connect("validate_script", this, "_validate_script"); code_editor->connect("load_theme_settings", this, "_load_theme_settings"); diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index b5edd12b9c..8ae7d55bdd 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -371,7 +371,7 @@ void ShaderEditor::_editor_settings_changed() { shader_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete")); shader_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file")); shader_editor->get_text_edit()->set_indent_size(EditorSettings::get_singleton()->get("text_editor/indent/size")); - shader_editor->get_text_edit()->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type") == "Tabs" ? 0 : 1); + shader_editor->get_text_edit()->set_indent_using_spaces(EditorSettings::get_singleton()->get("text_editor/indent/type")); shader_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs")); shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers")); shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting")); |