summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/doc/doc_data.cpp2
-rw-r--r--editor/editor_about.cpp13
-rw-r--r--editor/editor_about.h6
-rw-r--r--editor/editor_export.cpp12
-rw-r--r--editor/editor_node.cpp15
-rw-r--r--editor/editor_settings.cpp1
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp3
-rw-r--r--editor/property_editor.cpp39
-rw-r--r--editor/property_editor.h17
-rw-r--r--editor/translations/README.md7
11 files changed, 59 insertions, 58 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 3a72f8e569..0bb059f425 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -235,7 +235,7 @@ void DocData::generate(bool p_basic_types) {
ClassDB::get_property_list(name, &properties, true);
for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
- if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_CATEGORY)
+ if (E->get().usage & PROPERTY_USAGE_GROUP || E->get().usage & PROPERTY_USAGE_CATEGORY || E->get().usage & PROPERTY_USAGE_INTERNAL)
continue;
PropertyDoc prop;
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index da41ea87ce..5f026abb6d 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -44,8 +44,8 @@ void EditorAbout::_notification(int p_what) {
case NOTIFICATION_THEME_CHANGED: {
Ref<Font> font = EditorNode::get_singleton()->get_gui_base()->get_font("source", "EditorFonts");
- _tpl_text->add_font_override("font", font);
- _license_text->add_font_override("font", font);
+ _tpl_text->add_font_override("normal_font", font);
+ _license_text->add_font_override("normal_font", font);
} break;
}
}
@@ -53,7 +53,6 @@ void EditorAbout::_notification(int p_what) {
void EditorAbout::_license_tree_selected() {
TreeItem *selected = _tpl_tree->get_selected();
- _tpl_text->select(0, 0, 0, 0);
_tpl_text->set_text(selected->get_metadata(0));
}
@@ -165,12 +164,10 @@ EditorAbout::EditorAbout() {
// License
- _license_text = memnew(TextEdit);
+ _license_text = memnew(RichTextLabel);
_license_text->set_name(TTR("License"));
_license_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
_license_text->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- _license_text->set_wrap(true);
- _license_text->set_readonly(true);
_license_text->set_text(String::utf8(about_license));
tc->add_child(_license_text);
@@ -239,11 +236,9 @@ EditorAbout::EditorAbout() {
tpl_ti_all->set_metadata(0, long_text);
tpl_hbc->add_child(_tpl_tree);
- _tpl_text = memnew(TextEdit);
+ _tpl_text = memnew(RichTextLabel);
_tpl_text->set_h_size_flags(Control::SIZE_EXPAND_FILL);
_tpl_text->set_v_size_flags(Control::SIZE_EXPAND_FILL);
- _tpl_text->set_wrap(true);
- _tpl_text->set_readonly(true);
tpl_hbc->add_child(_tpl_text);
_tpl_tree->connect("item_selected", this, "_license_tree_selected");
diff --git a/editor/editor_about.h b/editor/editor_about.h
index ce29027f05..fe40ce5f14 100644
--- a/editor/editor_about.h
+++ b/editor/editor_about.h
@@ -33,11 +33,11 @@
#include "scene/gui/control.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/item_list.h"
+#include "scene/gui/rich_text_label.h"
#include "scene/gui/scroll_container.h"
#include "scene/gui/separator.h"
#include "scene/gui/split_container.h"
#include "scene/gui/tab_container.h"
-#include "scene/gui/text_edit.h"
#include "scene/gui/texture_rect.h"
#include "scene/gui/tree.h"
@@ -55,8 +55,8 @@ private:
ScrollContainer *_populate_list(const String &p_name, const List<String> &p_sections, const char **p_src[], const int p_flag_single_column = 0);
Tree *_tpl_tree;
- TextEdit *_license_text;
- TextEdit *_tpl_text;
+ RichTextLabel *_license_text;
+ RichTextLabel *_tpl_text;
TextureRect *_logo;
protected:
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 8c8d9c4c79..fc73964764 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -743,6 +743,18 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
custom_map["path_remap/remapped_paths"] = path_remaps;
}
+ // Store icon and splash images directly, they need to bypass the import system and be loaded as images
+ String icon = ProjectSettings::get_singleton()->get("application/config/icon");
+ String splash = ProjectSettings::get_singleton()->get("application/boot_splash/image");
+ if (icon != String() && FileAccess::exists(icon)) {
+ Vector<uint8_t> array = FileAccess::get_file_as_array(icon);
+ p_func(p_udata, icon, array, idx, total);
+ }
+ if (splash != String() && FileAccess::exists(splash)) {
+ Vector<uint8_t> array = FileAccess::get_file_as_array(splash);
+ p_func(p_udata, splash, array, idx, total);
+ }
+
String config_file = "project.binary";
String engine_cfb = EditorSettings::get_singleton()->get_cache_dir().plus_file("tmp" + config_file);
ProjectSettings::get_singleton()->save_custom(engine_cfb, custom_map, custom_list);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index fbf6c86c35..31ed86d05a 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1394,11 +1394,13 @@ void EditorNode::_property_editor_back() {
}
void EditorNode::_menu_collapseall() {
- property_editor->collapse_all_parent_nodes();
+
+ property_editor->collapse_all_folding();
}
void EditorNode::_menu_expandall() {
- property_editor->expand_all_parent_nodes();
+
+ property_editor->expand_all_folding();
}
void EditorNode::_save_default_environment() {
@@ -1495,7 +1497,7 @@ void EditorNode::_edit_current() {
if (FileAccess::exists(base_path + ".import")) {
editable_warning = TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
} else {
- if (!get_edited_scene() || get_edited_scene()->get_filename() != base_path) {
+ if ((!get_edited_scene() || get_edited_scene()->get_filename() != base_path) && ResourceLoader::get_resource_type(base_path) == "PackedScene") {
editable_warning = TTR("This resource belongs to a scene that was instanced or inherited.\nChanges to it will not be kept when saving the current scene.");
}
}
@@ -1674,7 +1676,6 @@ void EditorNode::_resource_selected(const RES &p_res, const String &p_property)
void EditorNode::_run(bool p_current, const String &p_custom) {
if (editor_run.get_status() == EditorRun::STATUS_PLAY) {
-
play_button->set_pressed(!_playing_edited);
play_scene_button->set_pressed(_playing_edited);
return;
@@ -1806,6 +1807,7 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
play_button->set_pressed(true);
play_button->set_icon(gui_base->get_icon("Reload", "EditorIcons"));
}
+ stop_button->set_disabled(false);
_playing_edited = p_current;
}
@@ -2277,6 +2279,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
play_scene_button->set_icon(gui_base->get_icon("PlayScene", "EditorIcons"));
play_custom_scene_button->set_pressed(false);
play_custom_scene_button->set_icon(gui_base->get_icon("PlayCustom", "EditorIcons"));
+ stop_button->set_disabled(true);
+
if (bool(EDITOR_DEF("run/output/always_close_output_on_stop", true))) {
for (int i = 0; i < bottom_panel_items.size(); i++) {
if (bottom_panel_items[i].control == log) {
@@ -5264,6 +5268,7 @@ EditorNode::EditorNode() {
stop_button->set_icon(gui_base->get_icon("Stop", "EditorIcons"));
stop_button->connect("pressed", this, "_menu_option", make_binds(RUN_STOP));
stop_button->set_tooltip(TTR("Stop the scene."));
+ stop_button->set_disabled(true);
stop_button->set_shortcut(ED_SHORTCUT("editor/stop", TTR("Stop"), KEY_F8));
run_native = memnew(EditorRunNative);
@@ -5441,7 +5446,7 @@ EditorNode::EditorNode() {
property_editor->set_use_doc_hints(true);
property_editor->set_hide_script(false);
property_editor->set_enable_capitalize_paths(bool(EDITOR_DEF("interface/editor/capitalize_properties", true)));
- property_editor->set_use_folding(bool(EDITOR_DEF("interface/editor/expand_all_properties", false)) == false);
+ property_editor->set_use_folding(!bool(EDITOR_DEF("interface/editor/disable_inspector_folding", false)));
property_editor->hide_top_label();
property_editor->register_text_enter(search_box);
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 638b23382d..2f73e459ed 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -416,6 +416,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
hints["editors/3d/freelook/freelook_modifier_speed_factor"] = PropertyInfo(Variant::REAL, "editors/3d/freelook/freelook_modifier_speed_factor", PROPERTY_HINT_RANGE, "0.0, 10.0, 0.1");
_initial_set("editors/3d/freelook/freelook_speed_zoom_link", false);
+ _initial_set("editors/2d/guides_color", Color(0.6, 0.0, 0.8));
_initial_set("editors/2d/bone_width", 5);
_initial_set("editors/2d/bone_color1", Color(1.0, 1.0, 1.0, 0.9));
_initial_set("editors/2d/bone_color2", Color(0.75, 0.75, 0.75, 0.9));
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 184ac5d798..ddcdb5a321 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -2294,7 +2294,7 @@ void CanvasItemEditor::_draw_focus() {
void CanvasItemEditor::_draw_guides() {
- Color guide_color = Color(0.6, 0.0, 0.8);
+ Color guide_color = EditorSettings::get_singleton()->get("editors/2d/guides_color");
Transform2D xform = viewport_scrollable->get_transform() * transform;
// Guides already there
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 60d7e59991..b4d89526b0 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -508,7 +508,8 @@ public:
} else if (current->has_setting("application/config/name")) {
project_name->set_text(current->get("application/config/name"));
}
- project_name->grab_focus();
+
+ project_name->call_deferred("grab_focus");
create_dir->hide();
status_btn->hide();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 6f9454be2c..11c7e07b6a 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -2665,18 +2665,14 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte
item->set_editable(1, false);
item->set_selectable(1, subsection_selectable);
- if (use_folding || folding_behaviour != FB_UNDEFINED) { // Even if you disabled folding (expand all by default), you still can collapse all manually.
+ if (use_folding) { //
if (!obj->editor_is_section_unfolded(p_path)) {
updating_folding = true;
- if (folding_behaviour == FB_COLLAPSEALL)
- item->set_collapsed(true);
- else if (folding_behaviour == FB_EXPANDALL || is_expandall_enabled)
- item->set_collapsed(false);
- else
- item->set_collapsed(true);
+ item->set_collapsed(true);
updating_folding = false;
}
item->set_metadata(0, p_path);
+ foldable_property_cache.push_back(p_path);
}
if (item->get_parent() == root) {
@@ -2725,6 +2721,7 @@ void PropertyEditor::refresh() {
void PropertyEditor::update_tree() {
tree->clear();
+ foldable_property_cache.clear();
if (!obj)
return;
@@ -3733,7 +3730,7 @@ void PropertyEditor::_item_edited() {
_edit_set(name, item->get_text(1), refresh_all);
}
} break;
- // math types
+ // math types
case Variant::VECTOR3: {
@@ -4212,29 +4209,29 @@ void PropertyEditor::set_subsection_selectable(bool p_selectable) {
update_tree();
}
-bool PropertyEditor::is_expand_all_properties_enabled() const {
-
- return (use_folding == false);
-}
-
void PropertyEditor::set_use_folding(bool p_enable) {
use_folding = p_enable;
tree->set_hide_folding(false);
}
-void PropertyEditor::collapse_all_parent_nodes() {
-
- folding_behaviour = FB_COLLAPSEALL;
+void PropertyEditor::collapse_all_folding() {
+ if (!obj)
+ return;
+ for (List<String>::Element *E = foldable_property_cache.front(); E; E = E->next()) {
+ obj->editor_set_section_unfold(E->get(), false);
+ }
update_tree();
- folding_behaviour = FB_UNDEFINED;
}
-void PropertyEditor::expand_all_parent_nodes() {
+void PropertyEditor::expand_all_folding() {
- folding_behaviour = FB_EXPANDALL;
+ if (!obj)
+ return;
+ for (List<String>::Element *E = foldable_property_cache.front(); E; E = E->next()) {
+ obj->editor_set_section_unfold(E->get(), true);
+ }
update_tree();
- folding_behaviour = FB_UNDEFINED;
}
PropertyEditor::PropertyEditor() {
@@ -4309,8 +4306,6 @@ PropertyEditor::PropertyEditor() {
subsection_selectable = false;
property_selectable = false;
show_type_icons = false; // maybe one day will return.
- folding_behaviour = FB_UNDEFINED;
- is_expandall_enabled = bool(EDITOR_DEF("interface/editor/expand_all_properties", true));
}
PropertyEditor::~PropertyEditor() {
diff --git a/editor/property_editor.h b/editor/property_editor.h
index a337a05e46..bcabccc6fd 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -203,18 +203,9 @@ class PropertyEditor : public Control {
bool hide_script;
bool use_folding;
bool property_selectable;
- bool is_expandall_enabled;
-
bool updating_folding;
- enum FOLDING_BEHAVIOUR {
- FB_UNDEFINED,
- FB_COLLAPSEALL,
- FB_EXPANDALL,
- FB_EXPANDALL_FORCE
- };
- FOLDING_BEHAVIOUR folding_behaviour;
-
+ List<String> foldable_property_cache;
HashMap<String, String> pending;
String selected_property;
@@ -314,10 +305,8 @@ public:
void set_use_folding(bool p_enable);
- bool is_expand_all_properties_enabled() const;
-
- void collapse_all_parent_nodes();
- void expand_all_parent_nodes();
+ void collapse_all_folding();
+ void expand_all_folding();
PropertyEditor();
~PropertyEditor();
};
diff --git a/editor/translations/README.md b/editor/translations/README.md
index 351bc9e2d1..f30f4e61fb 100644
--- a/editor/translations/README.md
+++ b/editor/translations/README.md
@@ -16,5 +16,8 @@ Link if you missed it: https://hosted.weblate.org/projects/godot-engine/godot
## Adding new languages
If you want to translate for a language which is not featured yet on Weblate,
-open an issue on this repo to ask that the language is added, or contact
-Akien/@akien-mga directly on IRC (#godotengine channel on Freenode).
+you can add it (when logged in) by clicking the "Start new translation"
+button at the bottom of the page.
+
+Alternatively, you can use this
+[direct link](https://hosted.weblate.org/new-lang/godot-engine/godot/).