diff options
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r-- | tools/editor/editor_node.cpp | 72 |
1 files changed, 21 insertions, 51 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 6c5e75b86f..0f8ddafb20 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -29,8 +29,7 @@ #include "version.h" #include "editor_node.h" #include "print_string.h" -#include "editor_icons.h" -#include "editor_fonts.h" +#include "editor_themes.h" #include "editor_help.h" #include "core/io/resource_saver.h" @@ -206,6 +205,18 @@ void EditorNode::_unhandled_input(const InputEvent& p_event) { case KEY_F6: _menu_option_confirm(RUN_PLAY_SCENE,true); break; //case KEY_F7: _menu_option_confirm(RUN_PAUSE,true); break; case KEY_F8: _menu_option_confirm(RUN_STOP,true); break;*/ + case KEY_TAB: + if (p_event.key.mod.command) { + int current_tab = editor_data.get_edited_scene(); + int tab_offset = 1; + if (p_event.key.mod.shift) + tab_offset = -1; + int next_tab = current_tab + tab_offset; + next_tab = next_tab >= 0 ? next_tab : editor_data.get_edited_scene_count() - 1; + next_tab %= editor_data.get_edited_scene_count(); + _scene_tab_changed(next_tab); + } + break; } } @@ -1159,7 +1170,6 @@ void EditorNode::_dialog_action(String p_file) { } break; case FILE_RUN_SCRIPT: { - print_line("RUN: "+p_file); Ref<Script> scr = ResourceLoader::load(p_file,"Script",true); if (scr.is_null()) { add_io_error("Script Failed to Load:\n"+p_file); @@ -1303,7 +1313,6 @@ void EditorNode::_dialog_action(String p_file) { ret = unzGoToFirstFile(pkg); EditorProgress p("ltask",TTR("Loading Export Templates"),fc); - print_line("BEGIN IMPORT"); fc=0; @@ -1333,7 +1342,6 @@ void EditorNode::_dialog_action(String p_file) { file=file.get_file(); p.step(TTR("Importing:")+" "+file,fc); - print_line("IMPORT "+file); FileAccess *f = FileAccess::open(EditorSettings::get_singleton()->get_settings_path()+"/templates/"+file,FileAccess::WRITE); @@ -2121,7 +2129,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { String existing; if (extensions.size()) { String root_name(get_edited_scene()->get_name()); - existing=root_name+"."+extensions.front()->get().to_lower(); + existing=root_name+".tscn";//+extensions.front()->get().to_lower(); } file->set_current_path(existing); @@ -3555,7 +3563,6 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo load_errors->clear(); String lpath = Globals::get_singleton()->localize_path(p_scene); - print_line("LOCAL PATH: "+lpath+" from "+p_scene); if (!lpath.begins_with("res://")) { current_option=-1; @@ -4202,7 +4209,6 @@ void EditorNode::_dock_select_input(const InputEvent& p_input) { dock_slot[dock_popup_selected]->set_current_tab(0); } - print_line("performing reparent"); dock_slot[nrect]->add_child(dock); dock_popup_selected=nrect; dock_slot[nrect]->set_current_tab(dock_slot[nrect]->get_tab_count()-1); @@ -4615,9 +4621,9 @@ void EditorNode::_update_layouts_menu() { editor_layouts->set_size(Vector2()); editor_layouts->add_shortcut(ED_SHORTCUT("layout/save",TTR("Save Layout")), SETTINGS_LAYOUT_SAVE); - editor_layouts->add_shortcut(ED_SHORTCUT("layout/load",TTR("Load Layout")), SETTINGS_LAYOUT_DELETE); + editor_layouts->add_shortcut(ED_SHORTCUT("layout/delete",TTR("Delete Layout")), SETTINGS_LAYOUT_DELETE); editor_layouts->add_separator(); - editor_layouts->add_shortcut(ED_SHORTCUT("property_editor/reset",TTR("Default")), SETTINGS_LAYOUT_DEFAULT); + editor_layouts->add_shortcut(ED_SHORTCUT("layout/default",TTR("Default")), SETTINGS_LAYOUT_DEFAULT); Ref<ConfigFile> config; config.instance(); @@ -5176,7 +5182,6 @@ EditorNode::EditorNode() { EditorSettings::create(); { int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode"); - print_line("DPI MODE: "+itos(dpi_mode)); if (dpi_mode==0) { editor_set_hidpi( OS::get_singleton()->get_screen_dpi(0) > 150 ); } else if (dpi_mode==2) { @@ -5236,44 +5241,9 @@ EditorNode::EditorNode() { theme_base->add_child(gui_base); gui_base->set_area_as_parent_rect(); - - theme = Ref<Theme>( memnew( Theme ) ); - theme_base->set_theme( theme ); - editor_register_icons(theme); - editor_register_fonts(theme); - - //theme->set_icon("folder","EditorFileDialog",Theme::get_default()->get_icon("folder","EditorFileDialog")); - //theme->set_color("files_disabled","EditorFileDialog",Color(0,0,0,0.7)); - - String global_font = EditorSettings::get_singleton()->get("global/custom_font"); - if (global_font!="") { - Ref<Font> fnt = ResourceLoader::load(global_font); - if (fnt.is_valid()) { - theme->set_default_theme_font(fnt); - } - } - - - - Ref<StyleBoxTexture> focus_sbt=memnew( StyleBoxTexture ); - focus_sbt->set_texture(theme->get_icon("EditorFocus","EditorIcons")); - for(int i=0;i<4;i++) { - focus_sbt->set_margin_size(Margin(i),16); - focus_sbt->set_default_margin(Margin(i),16); - } - focus_sbt->set_draw_center(false); - theme->set_stylebox("EditorFocus","EditorStyles",focus_sbt); - - - String custom_theme = EditorSettings::get_singleton()->get("global/custom_theme"); - if (custom_theme!="") { - Ref<Theme> theme = ResourceLoader::load(custom_theme); - if (theme.is_valid()) { - gui_base->set_theme(theme); - } - } - - + theme_base->set_theme( create_default_theme() ); + theme = create_editor_theme(); + gui_base->set_theme(theme); resource_preview = memnew( EditorResourcePreview ); add_child(resource_preview); @@ -5559,8 +5529,8 @@ EditorNode::EditorNode() { p->add_submenu_item(TTR("Convert To.."),"Export"); pm_export->add_item(TTR("Translatable Strings.."),FILE_DUMP_STRINGS); pm_export->add_separator(); - pm_export->add_item(TTR("MeshLibrary.."),FILE_EXPORT_MESH_LIBRARY); - pm_export->add_item(TTR("TileSet.."),FILE_EXPORT_TILESET); + pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary..")), FILE_EXPORT_MESH_LIBRARY); + pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet..")), FILE_EXPORT_TILESET); pm_export->connect("item_pressed",this,"_menu_option"); p->add_separator(); |