summaryrefslogtreecommitdiff
path: root/tools/editor
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor')
-rw-r--r--tools/editor/create_dialog.cpp4
-rw-r--r--tools/editor/editor_file_system.cpp2
-rw-r--r--tools/editor/editor_fonts.cpp16
-rw-r--r--tools/editor/editor_import_export.cpp2
-rw-r--r--tools/editor/editor_node.cpp104
-rw-r--r--tools/editor/editor_node.h11
-rw-r--r--tools/editor/editor_resource_preview.cpp2
-rw-r--r--tools/editor/io_plugins/editor_texture_import_plugin.cpp4
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/mesh_instance_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp2
-rw-r--r--tools/editor/project_export.cpp2
-rw-r--r--tools/editor/script_editor_debugger.cpp10
-rw-r--r--tools/editor/script_editor_debugger.h2
14 files changed, 132 insertions, 33 deletions
diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp
index 8bce415fb8..cd34b5aeb9 100644
--- a/tools/editor/create_dialog.cpp
+++ b/tools/editor/create_dialog.cpp
@@ -36,6 +36,7 @@
#if 1
#include "os/keyboard.h"
+#include "editor_help.h"
void CreateDialog::popup(bool p_dontclear) {
@@ -107,6 +108,9 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty
}
+ const String& description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
+ item->set_tooltip(0,description);
+
if (has_icon(p_type,"EditorIcons")) {
diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp
index 3fd5f7e444..c5c92b5228 100644
--- a/tools/editor/editor_file_system.cpp
+++ b/tools/editor/editor_file_system.cpp
@@ -161,7 +161,7 @@ int EditorFileSystemDirectory::get_source_count(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx,files.size(),0);
if (!files[p_idx]->meta.enabled)
return 0;
-
+ return files[p_idx]->meta.sources.size();
}
String EditorFileSystemDirectory::get_source_file(int p_idx,int p_source) const {
diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp
index ff2267daf1..7ec22a4068 100644
--- a/tools/editor/editor_fonts.cpp
+++ b/tools/editor/editor_fonts.cpp
@@ -66,19 +66,19 @@ static Ref<BitmapFont> make_font(int p_height,int p_ascent, int p_valign, int p_
return font;
}
-
-
-#define MAKE_DROID_SANS(m_name,m_size) \
- Ref<DynamicFont> m_name;\
- m_name.instance();\
- m_name->set_size(m_size);\
- m_name->set_font_data(DroidSans);\
+#define MAKE_FALLBACKS(m_name)\
m_name->add_fallback(DroidSansFallback);\
m_name->add_fallback(DroidSansJapanese);\
m_name->add_fallback(DroidSansArabic);\
m_name->add_fallback(DroidSansHebrew);\
m_name->add_fallback(DroidSansThai);
+#define MAKE_DROID_SANS(m_name,m_size) \
+ Ref<DynamicFont> m_name;\
+ m_name.instance();\
+ m_name->set_size(m_size);\
+ m_name->set_font_data(DroidSans);\
+ MAKE_FALLBACKS(m_name);
void editor_register_fonts(Ref<Theme> p_theme) {
@@ -144,6 +144,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
df_code.instance();
df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))*EDSCALE);
df_code->set_font_data(dfmono);
+ MAKE_FALLBACKS(df_code);
p_theme->set_font("source","EditorFonts",df_code);
@@ -151,6 +152,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
df_doc_code.instance();
df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))*EDSCALE);
df_doc_code->set_font_data(dfmono);
+ MAKE_FALLBACKS(df_doc_code);
p_theme->set_font("doc_source","EditorFonts",df_doc_code);
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index ac7ea514d7..f9b9c0b41c 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -889,7 +889,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func
- Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_atlas");
+ Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
Error err = plugin->import2(dst_file,imd,get_image_compression(),true);
if (err) {
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 40dce6cbaa..98cc198d94 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -192,6 +192,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_F11: {
+ if (p_event.key.mod.shift) {
+ if (p_event.key.mod.control) {
+ set_distraction_free_mode(!get_distraction_free_mode());
+ } else if (distraction_free_mode) {
+ distraction_free_mode = false;
+ _update_top_menu_visibility();
+ } else {
+ set_docks_visible(!get_docks_visible());
+ }
+ }
+ } break;
}
}
@@ -2795,6 +2807,10 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
run_native->set_debug_navigation(!ischecked);
editor_run.set_debug_navigation(!ischecked);
} break;
+ case RUN_RELOAD_SCRIPTS: {
+
+ ScriptEditor::get_singleton()->get_debugger()->reload_scripts();
+ } break;
case SETTINGS_UPDATE_ALWAYS: {
update_menu->get_popup()->set_item_checked(0,true);
@@ -4518,32 +4534,59 @@ void EditorNode::_update_dock_slots_visibility() {
right_hsplit,
};
- for(int i=0;i<DOCK_SLOT_MAX;i++) {
+ if (!docks_visible) {
- if (dock_slot[i]->get_tab_count())
- dock_slot[i]->show();
- else
+ for(int i=0;i<DOCK_SLOT_MAX;i++) {
dock_slot[i]->hide();
+ }
- }
+ for(int i=0;i<DOCK_SLOT_MAX/2;i++) {
+ splits[i]->hide();
+ }
+ right_hsplit->hide();
+ bottom_panel->hide();
+ } else {
+ for(int i=0;i<DOCK_SLOT_MAX;i++) {
- for(int i=0;i<DOCK_SLOT_MAX/2;i++) {
- bool in_use = dock_slot[i*2+0]->get_tab_count() || dock_slot[i*2+1]->get_tab_count();
- if (in_use)
- splits[i]->show();
- else
- splits[i]->hide();
- }
+ if (dock_slot[i]->get_tab_count())
+ dock_slot[i]->show();
+ else
+ dock_slot[i]->hide();
- for(int i=0;i<DOCK_SLOT_MAX;i++) {
+ }
- if (!dock_slot[i]->is_hidden() && dock_slot[i]->get_tab_count()) {
- dock_slot[i]->set_current_tab(0);
+
+ for(int i=0;i<DOCK_SLOT_MAX/2;i++) {
+ bool in_use = dock_slot[i*2+0]->get_tab_count() || dock_slot[i*2+1]->get_tab_count();
+ if (in_use)
+ splits[i]->show();
+ else
+ splits[i]->hide();
+ }
+
+ for(int i=0;i<DOCK_SLOT_MAX;i++) {
+
+ if (!dock_slot[i]->is_hidden() && dock_slot[i]->get_tab_count()) {
+ dock_slot[i]->set_current_tab(0);
+ }
}
+ bottom_panel->show();
+ right_hsplit->show();
}
}
+void EditorNode::_update_top_menu_visibility() {
+ if (distraction_free_mode) {
+ play_cc->hide();
+ menu_hb->hide();
+ scene_tabs->hide();
+ } else {
+ play_cc->show();
+ menu_hb->show();
+ scene_tabs->show();
+ }
+}
void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String& p_section) {
@@ -4909,6 +4952,31 @@ void EditorNode::_bottom_panel_switch(bool p_enable,int p_idx) {
}
}
+void EditorNode::set_docks_visible(bool p_show) {
+ docks_visible = p_show;
+ _update_dock_slots_visibility();
+}
+
+bool EditorNode::get_docks_visible() const {
+ return docks_visible;
+}
+
+void EditorNode::set_distraction_free_mode(bool p_enter) {
+ distraction_free_mode = p_enter;
+
+ if (p_enter) {
+ if (docks_visible) {
+ set_docks_visible(false);
+ }
+ } else {
+ set_docks_visible(true);
+ }
+ _update_top_menu_visibility();
+}
+
+bool EditorNode::get_distraction_free_mode() const {
+ return distraction_free_mode;
+}
void EditorNode::add_control_to_dock(DockSlot p_slot,Control* p_control) {
ERR_FAIL_INDEX(p_slot,DOCK_SLOT_MAX);
@@ -5163,6 +5231,8 @@ EditorNode::EditorNode() {
last_checked_version=0;
changing_scene=false;
_initializing_addons=false;
+ docks_visible = true;
+ distraction_free_mode=false;
FileAccess::set_backup_save(true);
@@ -5628,7 +5698,7 @@ EditorNode::EditorNode() {
//s1->set_size(Point2(10,15));
- CenterContainer *play_cc = memnew( CenterContainer );
+ play_cc = memnew( CenterContainer );
play_cc->set_ignore_mouse(true);
gui_base->add_child( play_cc );
play_cc->set_area_as_parent_rect();
@@ -5717,6 +5787,8 @@ EditorNode::EditorNode() {
p->add_separator();
p->add_check_item(TTR("Visible Collision Shapes"),RUN_DEBUG_COLLISONS);
p->add_check_item(TTR("Visible Navigation"),RUN_DEBUG_NAVIGATION);
+ p->add_separator();
+ p->add_item(TTR("Reload Scripts"),RUN_RELOAD_SCRIPTS);
p->connect("item_pressed",this,"_menu_option");
/*
diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h
index e580931df3..9ad5a08525 100644
--- a/tools/editor/editor_node.h
+++ b/tools/editor/editor_node.h
@@ -174,6 +174,7 @@ private:
RUN_DEBUG_COLLISONS,
RUN_DEBUG_NAVIGATION,
RUN_DEPLOY_REMOTE_DEBUG,
+ RUN_RELOAD_SCRIPTS,
SETTINGS_UPDATE_ALWAYS,
SETTINGS_UPDATE_CHANGES,
SETTINGS_IMPORT,
@@ -237,6 +238,7 @@ private:
//HSplitContainer *editor_hsplit;
//VSplitContainer *editor_vsplit;
+ CenterContainer *play_cc;
HBoxContainer *menu_hb;
Control *viewport;
MenuButton *file_menu;
@@ -350,6 +352,8 @@ private:
ToolButton *dock_tab_move_right;
int dock_popup_selected;
Timer *dock_drag_timer;
+ bool docks_visible;
+ bool distraction_free_mode;
String _tmp_import_path;
@@ -556,7 +560,7 @@ private:
void _save_docks_to_config(Ref<ConfigFile> p_layout, const String& p_section);
void _load_docks_from_config(Ref<ConfigFile> p_layout, const String& p_section);
void _update_dock_slots_visibility();
-
+ void _update_top_menu_visibility();
void _update_layouts_menu();
void _layout_menu_option(int p_idx);
@@ -593,6 +597,11 @@ public:
void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE,false); }
+ void set_docks_visible(bool p_show);
+ bool get_docks_visible() const;
+
+ void set_distraction_free_mode(bool p_enter);
+ bool get_distraction_free_mode() const;
void add_control_to_dock(DockSlot p_slot,Control* p_control);
void remove_control_from_dock(Control* p_control);
diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp
index 13b424c231..05b935f26c 100644
--- a/tools/editor/editor_resource_preview.cpp
+++ b/tools/editor/editor_resource_preview.cpp
@@ -131,7 +131,6 @@ void EditorResourcePreview::_thread() {
//print_line("pop from queue "+item.path);
- uint64_t modtime = FileAccess::get_modified_time(item.path);
int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");
thumbnail_size*=EDSCALE;
@@ -168,6 +167,7 @@ void EditorResourcePreview::_thread() {
texture=_generate_preview(item,cache_base);
} else {
+ uint64_t modtime = FileAccess::get_modified_time(item.path);
int tsize = f->get_line().to_int64();
uint64_t last_modtime = f->get_line().to_int64();
diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
index 21e7ee36bb..31b6333975 100644
--- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -1834,7 +1834,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {
} else if (EditorImportExport::get_singleton()->image_get_export_group(p_path)) {
- Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_2d");
+ Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
@@ -1848,7 +1848,7 @@ EditorTextureImportPlugin::EditorTextureImportPlugin(EditorNode *p_editor) {
String xt = p_path.extension().to_lower();
if (EditorImportExport::get_singleton()->get_image_formats().has(xt)) { //should check for more I guess?
- Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_2d");
+ Ref<EditorImportPlugin> pl = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
if (pl.is_valid()) {
Vector<uint8_t> ce = pl->custom_export(p_path,p_platform);
if (ce.size()) {
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 1b6d94b2cf..0cbc867b47 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3441,7 +3441,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
animation_hb->add_child(key_insert_button);
animation_menu = memnew( MenuButton );
- animation_menu->set_text("Animation");
+ animation_menu->set_text(TTR("Animation"));
animation_hb->add_child(animation_menu);
animation_menu->get_popup()->connect("item_pressed", this,"_popup_callback");
diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/tools/editor/plugins/mesh_instance_editor_plugin.cpp
index 2d7e5b177f..f604e4c57c 100644
--- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp
+++ b/tools/editor/plugins/mesh_instance_editor_plugin.cpp
@@ -222,7 +222,7 @@ MeshInstanceEditor::MeshInstanceEditor() {
options = memnew( MenuButton );
SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
- options->set_text("Mesh");
+ options->set_text(TTR("Mesh"));
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshInstance","EditorIcons"));
options->get_popup()->add_item(TTR("Create Trimesh Static Body"),MENU_OPTION_CREATE_STATIC_TRIMESH_BODY);
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index f32d0448a2..e261b48f67 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -3945,7 +3945,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_LIST_SELECT]->set_flat(true);
button_binds[0]=MENU_TOOL_LIST_SELECT;
tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", this,"_menu_item_pressed",button_binds);
- tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip("Show a list of all objects at the position clicked\n(same as Alt+RMB in selet mode).");
+ tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode)."));
vs = memnew( VSeparator );
hbc_menu->add_child(vs);
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 7f016ead2d..3b02c73189 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -1057,7 +1057,7 @@ void ProjectExportDialog::_group_atlas_preview() {
imd->set_option("atlas",true);
imd->set_option("crop",true);
- Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture_atlas");
+ Ref<EditorTextureImportPlugin> plugin = EditorImportExport::get_singleton()->get_import_plugin_by_name("texture");
Error err = plugin->import2(dst_file,imd,EditorExportPlatform::IMAGE_COMPRESSION_NONE,true);
if (err) {
diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp
index 2f4846d63a..37a90ba7be 100644
--- a/tools/editor/script_editor_debugger.cpp
+++ b/tools/editor/script_editor_debugger.cpp
@@ -1573,6 +1573,16 @@ void ScriptEditorDebugger::set_breakpoint(const String& p_path,int p_line,bool p
}
+void ScriptEditorDebugger::reload_scripts() {
+
+ if (connection.is_valid()) {
+ Array msg;
+ msg.push_back("reload_scripts");
+ ppeer->put_var(msg);
+ }
+}
+
+
void ScriptEditorDebugger::_error_selected(int p_idx) {
error_stack->clear();
diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h
index 128ca16173..c4a7cea1b7 100644
--- a/tools/editor/script_editor_debugger.h
+++ b/tools/editor/script_editor_debugger.h
@@ -217,6 +217,8 @@ public:
void set_tool_button(Button *p_tb) { debugger_button=p_tb; }
+ void reload_scripts();
+
virtual Size2 get_minimum_size() const;
ScriptEditorDebugger(EditorNode *p_editor=NULL);
~ScriptEditorDebugger();