summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/SCsub4
-rw-r--r--editor/animation_bezier_editor.cpp9
-rw-r--r--editor/code_editor.cpp2
-rw-r--r--editor/connections_dialog.cpp5
-rw-r--r--editor/create_dialog.cpp50
-rw-r--r--editor/dependency_editor.cpp31
-rw-r--r--editor/editor_about.cpp1
-rw-r--r--editor/editor_audio_buses.cpp5
-rw-r--r--editor/editor_builders.py26
-rw-r--r--editor/editor_data.cpp45
-rw-r--r--editor/editor_data.h11
-rw-r--r--editor/editor_file_system.cpp19
-rw-r--r--editor/editor_help.cpp76
-rw-r--r--editor/editor_initialize_ssl.cpp48
-rw-r--r--editor/editor_initialize_ssl.h36
-rw-r--r--editor/editor_inspector.cpp7
-rw-r--r--editor/editor_node.cpp108
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_path.cpp14
-rw-r--r--editor/editor_plugin_settings.cpp2
-rw-r--r--editor/editor_properties.cpp36
-rw-r--r--editor/editor_properties_array_dict.cpp179
-rw-r--r--editor/editor_settings.cpp5
-rw-r--r--editor/editor_spin_slider.cpp2
-rw-r--r--editor/editor_sub_scene.cpp5
-rw-r--r--editor/find_in_files.cpp2
-rw-r--r--editor/groups_editor.cpp7
-rw-r--r--editor/icons/README.md2
-rw-r--r--editor/icons/icon_GUI_checked.svg4
-rw-r--r--editor/icons/icon_GUI_radio_checked.svg7
-rw-r--r--editor/icons/icon_GUI_radio_unchecked.svg6
-rw-r--r--editor/icons/icon_GUI_unchecked.svg4
-rw-r--r--editor/icons/icon_g_l_e_s_2.svg69
-rw-r--r--editor/icons/icon_g_l_e_s_3.svg67
-rw-r--r--editor/import/resource_importer_layered_texture.cpp2
-rw-r--r--editor/import/resource_importer_texture.cpp2
-rw-r--r--editor/inspector_dock.cpp14
-rw-r--r--editor/plugins/abstract_polygon_2d_editor.cpp8
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp10
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp67
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h10
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp5
-rw-r--r--editor/plugins/resource_preloader_editor_plugin.cpp3
-rw-r--r--editor/plugins/root_motion_editor_plugin.cpp19
-rw-r--r--editor/plugins/script_editor_plugin.cpp44
-rw-r--r--editor/plugins/script_text_editor.cpp6
-rw-r--r--editor/plugins/shader_editor_plugin.cpp2
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp25
-rw-r--r--editor/plugins/spatial_editor_plugin.h1
-rw-r--r--editor/plugins/text_editor.cpp12
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp11
-rw-r--r--editor/project_export.cpp9
-rw-r--r--editor/project_manager.cpp3
-rw-r--r--editor/project_settings_editor.cpp4
-rw-r--r--editor/property_editor.cpp153
-rw-r--r--editor/property_editor.h3
-rw-r--r--editor/property_selector.cpp9
-rw-r--r--editor/scene_tree_dock.cpp51
-rw-r--r--editor/scene_tree_editor.cpp6
-rw-r--r--editor/script_create_dialog.cpp2
-rw-r--r--editor/script_editor_debugger.cpp96
-rw-r--r--editor/script_editor_debugger.h3
-rw-r--r--editor/settings_config_dialog.cpp6
-rwxr-xr-xeditor/translations/extract.py2
66 files changed, 593 insertions, 895 deletions
diff --git a/editor/SCsub b/editor/SCsub
index 6a4b06a97a..82b982eef2 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -61,10 +61,6 @@ if env['tools']:
env.Depends("#editor/doc_data_compressed.gen.h", docs)
env.CommandNoCache("#editor/doc_data_compressed.gen.h", docs, run_in_subprocess(editor_builders.make_doc_header))
- # Certificates
- env.Depends("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt")
- env.CommandNoCache("#editor/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", run_in_subprocess(editor_builders.make_certs_header))
-
import glob
path = env.Dir('.').abspath
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 04977dbb47..f0dc3ce305 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -30,6 +30,8 @@
#include "animation_bezier_editor.h"
+#include "editor/editor_node.h"
+
float AnimationBezierTrackEdit::_bezier_h_to_pixel(float p_h) {
float h = p_h;
h = (h - v_scroll) / v_zoom;
@@ -288,12 +290,7 @@ void AnimationBezierTrackEdit::_notification(int p_what) {
int h = font->get_height();
if (node) {
- Ref<Texture> icon;
- if (has_icon(node->get_class(), "EditorIcons")) {
- icon = get_icon(node->get_class(), "EditorIcons");
- } else {
- icon = get_icon("Node", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(node, "Node");
h = MAX(h, icon->get_height());
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 80bc73bc12..33d36e5e9c 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -374,7 +374,7 @@ void FindReplaceBar::_hide_bar() {
void FindReplaceBar::_show_search() {
show();
- search_text->grab_focus();
+ search_text->call_deferred("grab_focus");
if (text_edit->is_selection_active() && !selection_only->is_pressed()) {
search_text->set_text(text_edit->get_selection_text());
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 18c4dd85a1..a1337268ba 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -432,6 +432,9 @@ void ConnectionsDock::_make_or_edit_connection() {
if (add_script_function) {
// pick up args here before "it" is deleted by update_tree
script_function_args = it->get_metadata(0).operator Dictionary()["args"];
+ for (int i = 0; i < cToMake.binds.size(); i++) {
+ script_function_args.append("extra_arg_" + itos(i));
+ }
}
if (connect_dialog->is_editing()) {
@@ -497,7 +500,7 @@ void ConnectionsDock::_disconnect(TreeItem &item) {
}
/*
-Break all conections of currently selected signal.
+Break all connections of currently selected signal.
Can undo-redo as a single action.
*/
void ConnectionsDock::_disconnect_all() {
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index 8bef94d8a8..eb11aea9cc 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -55,12 +55,12 @@ void CreateDialog::popup_create(bool p_dont_clear, bool p_replace_mode) {
while (!f->eof_reached()) {
String l = f->get_line().strip_edges();
+ String name = l.split(" ")[0];
- if (l != String()) {
-
+ if (ClassDB::class_exists(name) || ScriptServer::is_global_class(name)) {
TreeItem *ti = recent->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, _get_editor_icon(l));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
}
}
@@ -151,41 +151,6 @@ void CreateDialog::_sbox_input(const Ref<InputEvent> &p_ie) {
}
}
-Ref<Texture> CreateDialog::_get_editor_icon(const String &p_type) const {
-
- if (has_icon(p_type, "EditorIcons")) {
- return get_icon(p_type, "EditorIcons");
- }
-
- if (ScriptServer::is_global_class(p_type)) {
- String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_type);
- RES icon;
- if (FileAccess::exists(icon_path)) {
- icon = ResourceLoader::load(icon_path);
- }
- if (!icon.is_valid()) {
- icon = get_icon(ScriptServer::get_global_class_base(p_type), "EditorIcons");
- }
- return icon;
- }
-
- const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
- for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
- const Vector<EditorData::CustomType> &ct = E->value();
- for (int i = 0; i < ct.size(); ++i) {
- if (ct[i].name == p_type) {
- if (ct[i].icon.is_valid()) {
- return ct[i].icon;
- } else {
- return get_icon("Object", "EditorIcons");
- }
- }
- }
- }
-
- return get_icon("Object", "EditorIcons");
-}
-
void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p_types, TreeItem *p_root, TreeItem **to_select) {
if (p_types.has(p_type))
@@ -246,7 +211,10 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
to_select_type = to_select_type.split(" ")[0];
bool current_item_is_preferred;
if (cpp_type) {
- current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type;
+ String cpp_to_select_type = to_select_type;
+ if (ScriptServer::is_global_class(to_select_type))
+ cpp_to_select_type = ScriptServer::get_global_class_base(to_select_type);
+ current_item_is_preferred = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(cpp_to_select_type, preferred_search_result_type);
} else {
current_item_is_preferred = ed.script_class_is_parent(p_type, preferred_search_result_type) && !ed.script_class_is_parent(to_select_type, preferred_search_result_type) && search_box->get_text() != to_select_type;
}
@@ -274,7 +242,7 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p
const String &description = EditorHelp::get_doc_data()->class_list[p_type].brief_description;
item->set_tooltip(0, description);
- item->set_icon(0, _get_editor_icon(p_type));
+ item->set_icon(0, EditorNode::get_singleton()->get_class_icon(p_type, base_type));
p_types[p_type] = item;
}
@@ -578,7 +546,7 @@ void CreateDialog::_update_favorite_list() {
continue;
TreeItem *ti = favorites->create_item(root);
ti->set_text(0, l);
- ti->set_icon(0, _get_editor_icon(l));
+ ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
}
emit_signal("favorites_updated");
}
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 9f04d40763..037543f45c 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -198,12 +198,7 @@ void DependencyEditor::_update_list() {
}
String name = path.get_file();
- Ref<Texture> icon;
- if (has_icon(type, "EditorIcons")) {
- icon = get_icon(type, "EditorIcons");
- } else {
- icon = get_icon("Object", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
item->set_text(0, name);
item->set_icon(0, icon);
item->set_metadata(0, type);
@@ -346,13 +341,7 @@ void DependencyEditorOwners::_fill_owners(EditorFileSystemDirectory *efsd) {
if (!found)
continue;
- Ref<Texture> icon;
- String type = efsd->get_file_type(i);
- if (!has_icon(type, "EditorIcons")) {
- icon = get_icon("Object", "EditorIcons");
- } else {
- icon = get_icon(type, "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(efsd->get_file_type(i));
owners->add_item(efsd->get_file_path(i), icon);
}
@@ -460,7 +449,7 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
}
//List this file under this dependency
- Ref<Texture> icon = has_icon(rd.file_type, "EditorIcons") ? get_icon(rd.file_type, "EditorIcons") : get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(rd.file_type);
TreeItem *file_item = owners->create_item(tree_items[rd.dependency]);
file_item->set_text(0, rd.file);
file_item->set_icon(0, icon);
@@ -579,12 +568,7 @@ void DependencyErrorDialog::show(const String &p_for_file, const Vector<String>
if (report[i].get_slice_count("::") > 0)
type = report[i].get_slice("::", 1);
- Ref<Texture> icon;
- if (!has_icon(type, "EditorIcons")) {
- icon = get_icon("Object", "EditorIcons");
- } else {
- icon = get_icon(type, "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
TreeItem *ti = files->create_item(root);
ti->set_text(0, dep);
@@ -687,12 +671,7 @@ bool OrphanResourcesDialog::_fill_owners(EditorFileSystemDirectory *efsd, HashMa
String type = efsd->get_file_type(i);
- Ref<Texture> icon;
- if (has_icon(type, "EditorIcons")) {
- icon = get_icon(type, "EditorIcons");
- } else {
- icon = get_icon("Object", "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(type);
ti->set_icon(0, icon);
int ds = efsd->get_file_deps(i).size();
ti->set_text(1, itos(ds));
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index e4602f0f94..cdf0e4b829 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -113,7 +113,6 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St
EditorAbout::EditorAbout() {
set_title(TTR("Thanks from the Godot community!"));
- get_ok()->set_text(TTR("OK"));
set_hide_on_ok(true);
set_resizable(true);
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 96110b61ab..6cd81626c7 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -765,10 +765,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
if (!ClassDB::can_instance(E->get()))
continue;
- Ref<Texture> icon;
- if (has_icon(E->get(), "EditorIcons")) {
- icon = get_icon(E->get(), "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(E->get());
String name = E->get().operator String().replace("AudioEffect", "");
effect_options->add_item(name);
effect_options->set_item_metadata(effect_options->get_item_count() - 1, E->get());
diff --git a/editor/editor_builders.py b/editor/editor_builders.py
index fa037980c2..9e9fe752b4 100644
--- a/editor/editor_builders.py
+++ b/editor/editor_builders.py
@@ -9,32 +9,6 @@ from platform_methods import subprocess_main
from compat import encode_utf8, byte_to_str, open_utf8, escape_string
-def make_certs_header(target, source, env):
-
- src = source[0]
- dst = target[0]
- f = open(src, "rb")
- g = open_utf8(dst, "w")
- buf = f.read()
- decomp_size = len(buf)
- import zlib
- buf = zlib.compress(buf)
-
- g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
- g.write("#ifndef _CERTS_RAW_H\n")
- g.write("#define _CERTS_RAW_H\n")
- g.write("static const int _certs_compressed_size = " + str(len(buf)) + ";\n")
- g.write("static const int _certs_uncompressed_size = " + str(decomp_size) + ";\n")
- g.write("static const unsigned char _certs_compressed[] = {\n")
- for i in range(len(buf)):
- g.write("\t" + byte_to_str(buf[i]) + ",\n")
- g.write("};\n")
- g.write("#endif")
-
- g.close()
- f.close()
-
-
def make_doc_header(target, source, env):
dst = target[0]
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 6187c6b318..9420452da1 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -869,7 +869,7 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i
return true;
}
-StringName EditorData::script_class_get_base(const String &p_class) {
+StringName EditorData::script_class_get_base(const String &p_class) const {
if (!ScriptServer::is_global_class(p_class))
return StringName();
@@ -895,24 +895,48 @@ Object *EditorData::script_class_instance(const String &p_class) {
RES script = ResourceLoader::load(ScriptServer::get_global_class_path(p_class));
if (script.is_valid())
obj->set_script(script.get_ref_ptr());
-
- RES icon = ResourceLoader::load(script_class_get_icon_path(p_class));
- if (icon.is_valid())
- obj->set_meta("_editor_icon", icon);
-
return obj;
}
}
return NULL;
}
+void EditorData::script_class_set_icon_path(const String &p_class, const String &p_icon_path) {
+ _script_class_icon_paths[p_class] = p_icon_path;
+}
+
+String EditorData::script_class_get_icon_path(const String &p_class) const {
+ if (!ScriptServer::is_global_class(p_class))
+ return String();
+
+ String current = p_class;
+ String ret = _script_class_icon_paths[current];
+ while (ret.empty()) {
+ current = script_class_get_base(current);
+ if (!ScriptServer::is_global_class(current))
+ return String();
+ ret = _script_class_icon_paths.has(current) ? _script_class_icon_paths[current] : String();
+ }
+
+ return ret;
+}
+
+StringName EditorData::script_class_get_name(const String &p_path) const {
+ return _script_class_file_to_path.has(p_path) ? _script_class_file_to_path[p_path] : StringName();
+}
+
+void EditorData::script_class_set_name(const String &p_path, const StringName &p_class) {
+ _script_class_file_to_path[p_path] = p_class;
+}
+
void EditorData::script_class_save_icon_paths() {
List<StringName> keys;
_script_class_icon_paths.get_key_list(&keys);
Dictionary d;
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
- d[E->get()] = _script_class_icon_paths[E->get()];
+ if (ScriptServer::is_global_class(E->get()))
+ d[E->get()] = _script_class_icon_paths[E->get()];
}
ProjectSettings::get_singleton()->set("_global_script_class_icons", d);
@@ -927,8 +951,11 @@ void EditorData::script_class_load_icon_paths() {
d.get_key_list(&keys);
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
- String key = E->get().operator String();
- _script_class_icon_paths[key] = d[key];
+ String name = E->get().operator String();
+ _script_class_icon_paths[name] = d[name];
+
+ String path = ScriptServer::get_global_class_path(name);
+ script_class_set_name(path, name);
}
}
diff --git a/editor/editor_data.h b/editor/editor_data.h
index 9f5d3e2a15..87a76ee5ba 100644
--- a/editor/editor_data.h
+++ b/editor/editor_data.h
@@ -147,6 +147,7 @@ private:
bool _find_updated_instances(Node *p_root, Node *p_node, Set<String> &checked_paths);
HashMap<StringName, String> _script_class_icon_paths;
+ HashMap<String, StringName> _script_class_file_to_path;
public:
EditorPlugin *get_editor(Object *p_object);
@@ -214,10 +215,14 @@ public:
void notify_resource_saved(const Ref<Resource> &p_resource);
bool script_class_is_parent(const String &p_class, const String &p_inherits);
- StringName script_class_get_base(const String &p_class);
+ StringName script_class_get_base(const String &p_class) const;
Object *script_class_instance(const String &p_class);
- String script_class_get_icon_path(const String &p_class) const { return _script_class_icon_paths.has(p_class) ? _script_class_icon_paths[p_class] : String(); }
- void script_class_set_icon_path(const String &p_class, const String &p_icon_path) { _script_class_icon_paths[p_class] = p_icon_path; }
+
+ StringName script_class_get_name(const String &p_path) const;
+ void script_class_set_name(const String &p_path, const StringName &p_class);
+
+ String script_class_get_icon_path(const String &p_class) const;
+ void script_class_set_icon_path(const String &p_class, const String &p_icon_path);
void script_class_clear_icon_paths() { _script_class_icon_paths.clear(); }
void script_class_save_icon_paths();
void script_class_load_icon_paths();
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 351ca6f435..ee20d95f25 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -389,7 +389,7 @@ bool EditorFileSystem::_test_for_reimport(const String &p_path, bool p_only_impo
memdelete(f);
- // Read the md5's from a separate file (so the import parameters aren't dependant on the file version
+ // Read the md5's from a separate file (so the import parameters aren't dependent on the file version
String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(p_path);
FileAccess *md5s = FileAccess::open(base_path + ".md5", FileAccess::READ, &err);
if (!md5s) { // No md5's stored for this resource
@@ -1358,6 +1358,7 @@ void EditorFileSystem::_scan_script_classes(EditorFileSystemDirectory *p_dir) {
}
ScriptServer::add_global_class(files[i]->script_class_name, files[i]->script_class_extends, lang, p_dir->get_file_path(i));
EditorNode::get_editor_data().script_class_set_icon_path(files[i]->script_class_name, files[i]->script_class_icon_path);
+ EditorNode::get_editor_data().script_class_set_name(files[i]->file, files[i]->script_class_name);
}
for (int i = 0; i < p_dir->get_subdir_count(); i++) {
_scan_script_classes(p_dir->get_subdir(i));
@@ -1377,7 +1378,6 @@ void EditorFileSystem::update_script_classes() {
ScriptServer::save_global_classes();
EditorNode::get_editor_data().script_class_save_icon_paths();
- emit_signal("script_classes_updated");
}
void EditorFileSystem::_queue_update_script_classes() {
@@ -1479,12 +1479,16 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
cf.instance();
Error err = cf->load(p_file + ".import");
if (err == OK) {
- List<String> sk;
- cf->get_section_keys("params", &sk);
- for (List<String>::Element *E = sk.front(); E; E = E->next()) {
- params[E->get()] = cf->get_value("params", E->get());
+ if (cf->has_section("params")) {
+ List<String> sk;
+ cf->get_section_keys("params", &sk);
+ for (List<String>::Element *E = sk.front(); E; E = E->next()) {
+ params[E->get()] = cf->get_value("params", E->get());
+ }
+ }
+ if (cf->has_section("remap")) {
+ importer_name = cf->get_value("remap", "importer");
}
- importer_name = cf->get_value("remap", "importer");
}
} else {
@@ -1716,7 +1720,6 @@ void EditorFileSystem::_bind_methods() {
ADD_SIGNAL(MethodInfo("filesystem_changed"));
ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist")));
ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::POOL_STRING_ARRAY, "resources")));
- ADD_SIGNAL(MethodInfo("script_classes_updated"));
}
void EditorFileSystem::_update_extensions() {
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 8d371714cf..60040f641b 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -88,10 +88,8 @@ void EditorHelpSearch::IncrementalSearch::phase1(Map<String, DocData::ClassDoc>:
TreeItem *item = search_options->create_item(root);
item->set_metadata(0, "class_name:" + E->key());
item->set_text(0, E->key() + " (Class)");
- if (search->has_icon(E->key(), "EditorIcons"))
- item->set_icon(0, search->get_icon(E->key(), "EditorIcons"));
- else
- item->set_icon(0, def_icon);
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(E->key(), "Node");
+ item->set_icon(0, icon);
}
}
@@ -99,11 +97,7 @@ void EditorHelpSearch::IncrementalSearch::phase2(Map<String, DocData::ClassDoc>:
DocData::ClassDoc &c = E->get();
- Ref<Texture> cicon;
- if (search->has_icon(E->key(), "EditorIcons"))
- cicon = search->get_icon(E->key(), "EditorIcons");
- else
- cicon = def_icon;
+ Ref<Texture> cicon = EditorNode::get_singleton()->get_class_icon(E->key(), "Node");
for (int i = 0; i < c.methods.size(); i++) {
if ((term.begins_with(".") && c.methods[i].name.begins_with(term.right(1))) || (term.ends_with("(") && c.methods[i].name.ends_with(term.left(term.length() - 1).strip_edges())) || (term.begins_with(".") && term.ends_with("(") && c.methods[i].name == term.substr(1, term.length() - 2).strip_edges()) || c.methods[i].name.findn(term) != -1) {
@@ -343,10 +337,8 @@ void EditorHelpIndex::add_type(const String &p_type, HashMap<String, TreeItem *>
item->set_tooltip(0, EditorHelp::get_doc_data()->class_list[p_type].brief_description);
item->set_text(0, p_type);
- if (has_icon(p_type, "EditorIcons")) {
-
- item->set_icon(0, get_icon(p_type, "EditorIcons"));
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(p_type);
+ item->set_icon(0, icon);
p_types[p_type] = item;
}
@@ -760,6 +752,8 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
}
void EditorHelp::_update_doc() {
+ if (!doc->class_list.has(edited_class))
+ return;
scroll_locked = true;
@@ -776,6 +770,7 @@ void EditorHelp::_update_doc() {
Ref<Font> doc_code_font = get_font("doc_source", "EditorFonts");
String link_color_text = title_color.to_html(false);
+ // Class name
section_line.push_back(Pair<String, int>(TTR("Top"), 0));
class_desc->push_font(doc_title_font);
class_desc->push_color(title_color);
@@ -787,18 +782,18 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->add_newline();
+ // Inheritance tree
+
+ // Ascendents
if (cd.inherits != "") {
class_desc->push_color(title_color);
- class_desc->push_font(doc_title_font);
+ class_desc->push_font(doc_font);
class_desc->add_text(TTR("Inherits:") + " ");
class_desc->pop();
- class_desc->pop();
String inherits = cd.inherits;
- class_desc->push_font(doc_font);
-
while (inherits != "") {
_add_type(inherits);
@@ -813,6 +808,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Descendents
if (ClassDB::class_exists(cd.name)) {
bool found = false;
@@ -824,13 +820,10 @@ void EditorHelp::_update_doc() {
if (!found) {
class_desc->push_color(title_color);
- class_desc->push_font(doc_title_font);
+ class_desc->push_font(doc_font);
class_desc->add_text(TTR("Inherited by:") + " ");
class_desc->pop();
- class_desc->pop();
-
found = true;
- class_desc->push_font(doc_font);
}
if (prev) {
@@ -853,6 +846,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
class_desc->add_newline();
+ // Brief description
if (cd.brief_description != "") {
class_desc->push_color(title_color);
@@ -874,15 +868,16 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Properties overview
Set<String> skip_methods;
bool property_descr = false;
if (cd.properties.size()) {
- section_line.push_back(Pair<String, int>(TTR("Members"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Members:"));
+ class_desc->add_text(TTR("Properties:"));
class_desc->pop();
class_desc->pop();
@@ -940,6 +935,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Methods overview
bool method_descr = false;
bool sort_methods = EditorSettings::get_singleton()->get("text_editor/help/sort_functions_alphabetically");
@@ -956,10 +952,10 @@ void EditorHelp::_update_doc() {
if (sort_methods)
methods.sort();
- section_line.push_back(Pair<String, int>(TTR("Public Methods"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Public Methods:"));
+ class_desc->add_text(TTR("Methods:"));
class_desc->pop();
class_desc->pop();
@@ -1024,22 +1020,20 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Theme properties
if (cd.theme_properties.size()) {
- section_line.push_back(Pair<String, int>(TTR("GUI Theme Items"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Theme Properties"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("GUI Theme Items:"));
+ class_desc->add_text(TTR("Theme Properties:"));
class_desc->pop();
class_desc->pop();
- // class_desc->add_newline();
class_desc->push_indent(1);
class_desc->push_table(2);
class_desc->set_table_column_expand(1, 1);
- //class_desc->add_newline();
-
for (int i = 0; i < cd.theme_properties.size(); i++) {
theme_property_line[cd.theme_properties[i].name] = class_desc->get_line_count() - 2; //gets overridden if description
@@ -1076,6 +1070,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Signals
if (cd.signals.size()) {
if (sort_methods) {
@@ -1144,6 +1139,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Constants and enums
if (cd.constants.size()) {
Map<String, Vector<DocData::ConstantDoc> > enums;
@@ -1163,6 +1159,7 @@ void EditorHelp::_update_doc() {
}
}
+ // Enums
if (enums.size()) {
section_line.push_back(Pair<String, int>(TTR("Enumerations"), class_desc->get_line_count() - 2));
@@ -1245,6 +1242,7 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Constants
if (constants.size()) {
section_line.push_back(Pair<String, int>(TTR("Constants"), class_desc->get_line_count() - 2));
@@ -1303,13 +1301,14 @@ void EditorHelp::_update_doc() {
}
}
+ // Class description
if (cd.description != "") {
- section_line.push_back(Pair<String, int>(TTR("Description"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Class Description"), class_desc->get_line_count() - 2));
description_line = class_desc->get_line_count() - 2;
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Description:"));
+ class_desc->add_text(TTR("Class Description:"));
class_desc->pop();
class_desc->pop();
@@ -1326,8 +1325,8 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
+ // Online tutorials
{
-
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
class_desc->add_text(TTR("Online Tutorials:"));
@@ -1365,12 +1364,14 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
class_desc->add_newline();
}
+
+ // Property descriptions
if (property_descr) {
- section_line.push_back(Pair<String, int>(TTR("Properties"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Property Description:"));
+ class_desc->add_text(TTR("Property Descriptions:"));
class_desc->pop();
class_desc->pop();
@@ -1458,12 +1459,13 @@ void EditorHelp::_update_doc() {
}
}
+ // Method descriptions
if (method_descr) {
- section_line.push_back(Pair<String, int>(TTR("Methods"), class_desc->get_line_count() - 2));
+ section_line.push_back(Pair<String, int>(TTR("Method Descriptions"), class_desc->get_line_count() - 2));
class_desc->push_color(title_color);
class_desc->push_font(doc_title_font);
- class_desc->add_text(TTR("Method Description:"));
+ class_desc->add_text(TTR("Method Descriptions:"));
class_desc->pop();
class_desc->pop();
diff --git a/editor/editor_initialize_ssl.cpp b/editor/editor_initialize_ssl.cpp
deleted file mode 100644
index 9f7537cc9a..0000000000
--- a/editor/editor_initialize_ssl.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*************************************************************************/
-/* editor_initialize_ssl.cpp */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2018 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 "editor_initialize_ssl.h"
-
-#include "certs_compressed.gen.h"
-#include "core/io/compression.h"
-#include "core/io/stream_peer_ssl.h"
-
-void editor_initialize_certificates() {
-
- PoolByteArray data;
- data.resize(_certs_uncompressed_size + 1);
- {
- PoolByteArray::Write w = data.write();
- Compression::decompress(w.ptr(), _certs_uncompressed_size, _certs_compressed, _certs_compressed_size, Compression::MODE_DEFLATE);
- w[_certs_uncompressed_size] = 0; //make sure it ends at zero
- }
-
- StreamPeerSSL::load_certs_from_memory(data);
-}
diff --git a/editor/editor_initialize_ssl.h b/editor/editor_initialize_ssl.h
deleted file mode 100644
index 71d16b8c53..0000000000
--- a/editor/editor_initialize_ssl.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*************************************************************************/
-/* editor_initialize_ssl.h */
-/*************************************************************************/
-/* This file is part of: */
-/* GODOT ENGINE */
-/* https://godotengine.org */
-/*************************************************************************/
-/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2018 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 EDITOR_INITIALIZE_SSL_H
-#define EDITOR_INITIALIZE_SSL_H
-
-void editor_initialize_certificates();
-
-#endif // EDITOR_INITIALIZE_SSL_H
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 929028c499..36c3102840 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1423,10 +1423,7 @@ void EditorInspector::update_tree() {
category_vbox = NULL; //reset
String type = p.name;
- if (has_icon(type, "EditorIcons"))
- category->icon = get_icon(type, "EditorIcons");
- else
- category->icon = get_icon("Object", "EditorIcons");
+ category->icon = EditorNode::get_singleton()->get_class_icon(type, "Object");
category->label = type;
category->bg_color = get_color("prop_category", "Editor");
@@ -1742,7 +1739,7 @@ void EditorInspector::edit(Object *p_object) {
if (object) {
update_scroll_request = 0; //reset
if (scroll_cache.has(object->get_instance_id())) { //if exists, set something else
- update_scroll_request = scroll_cache[object->get_instance_id()]; //done this way because wait until full size is accomodated
+ update_scroll_request = scroll_cache[object->get_instance_id()]; //done this way because wait until full size is accommodated
}
object->add_change_receptor(this);
update_tree();
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 7359cf598a..0ba1ef3b18 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -54,7 +54,6 @@
#include "editor/editor_audio_buses.h"
#include "editor/editor_file_system.h"
#include "editor/editor_help.h"
-#include "editor/editor_initialize_ssl.h"
#include "editor/editor_properties.h"
#include "editor/editor_settings.h"
#include "editor/editor_themes.h"
@@ -141,12 +140,7 @@ void EditorNode::_update_scene_tabs() {
String type = editor_data.get_scene_type(i);
Ref<Texture> icon;
if (type != String()) {
-
- if (!gui_base->has_icon(type, "EditorIcons")) {
- type = "Node";
- }
-
- icon = gui_base->get_icon(type, "EditorIcons");
+ icon = get_class_icon(type, "Node");
}
int current = editor_data.get_edited_scene();
@@ -3126,6 +3120,86 @@ void EditorNode::stop_child_process() {
_menu_option_confirm(RUN_STOP, false);
}
+Ref<Texture> EditorNode::get_object_icon(const Object *p_object, const String &p_fallback) const {
+ ERR_FAIL_COND_V(!p_object || !gui_base, NULL);
+
+ Ref<Script> script = p_object->get_script();
+ if (script.is_null() && p_object->is_class("Script")) {
+ script = p_object;
+ }
+
+ StringName name;
+ String icon_path;
+ if (script.is_valid()) {
+ name = EditorNode::get_editor_data().script_class_get_name(script->get_path());
+ icon_path = EditorNode::get_editor_data().script_class_get_icon_path(name);
+ name = script->get_instance_base_type();
+ }
+
+ if (gui_base->has_icon(p_object->get_class(), "EditorIcons"))
+ return gui_base->get_icon(p_object->get_class(), "EditorIcons");
+
+ if (icon_path.length())
+ return ResourceLoader::load(icon_path);
+
+ if (p_object->has_meta("_editor_icon"))
+ return p_object->get_meta("_editor_icon");
+
+ if (name != StringName()) {
+ const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
+ for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
+ const Vector<EditorData::CustomType> &ct = E->value();
+ for (int i = 0; i < ct.size(); ++i) {
+ if (ct[i].name == name && ct[i].icon.is_valid()) {
+ return ct[i].icon;
+ }
+ }
+ }
+ }
+
+ if (p_fallback.length())
+ return gui_base->get_icon(p_fallback, "EditorIcons");
+
+ return NULL;
+}
+
+Ref<Texture> EditorNode::get_class_icon(const String &p_class, const String &p_fallback) const {
+ ERR_FAIL_COND_V(p_class.empty(), NULL);
+
+ if (gui_base->has_icon(p_class, "EditorIcons")) {
+ return gui_base->get_icon(p_class, "EditorIcons");
+ }
+
+ if (ScriptServer::is_global_class(p_class)) {
+ String icon_path = EditorNode::get_editor_data().script_class_get_icon_path(p_class);
+ RES icon;
+ if (FileAccess::exists(icon_path)) {
+ icon = ResourceLoader::load(icon_path);
+ }
+ if (!icon.is_valid()) {
+ icon = gui_base->get_icon(ScriptServer::get_global_class_base(p_class), "EditorIcons");
+ }
+ return icon;
+ }
+
+ const Map<String, Vector<EditorData::CustomType> > &p_map = EditorNode::get_editor_data().get_custom_types();
+ for (const Map<String, Vector<EditorData::CustomType> >::Element *E = p_map.front(); E; E = E->next()) {
+ const Vector<EditorData::CustomType> &ct = E->value();
+ for (int i = 0; i < ct.size(); ++i) {
+ if (ct[i].name == p_class) {
+ if (ct[i].icon.is_valid()) {
+ return ct[i].icon;
+ }
+ }
+ }
+ }
+
+ if (p_fallback.length())
+ return gui_base->get_icon(p_fallback, "EditorIcons");
+
+ return NULL;
+}
+
void EditorNode::progress_add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
singleton->progress_dialog->add_task(p_task, p_label, p_steps, p_can_cancel);
@@ -3589,7 +3663,7 @@ void EditorNode::_update_dock_slots_visibility() {
void EditorNode::_dock_tab_changed(int p_tab) {
- // update visibility but dont set current tab
+ // update visibility but don't set current tab
VSplitContainer *splits[DOCK_SLOT_MAX / 2] = {
left_l_vsplit,
left_r_vsplit,
@@ -4607,11 +4681,10 @@ EditorNode::EditorNode() {
Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor
- EditorHelp::generate_doc(); //before any editor classes are crated
+ EditorHelp::generate_doc(); //before any editor classes are created
SceneState::set_disable_placeholders(true);
ResourceLoader::clear_translation_remaps(); //no remaps using during editor
ResourceLoader::clear_path_remaps();
- editor_initialize_certificates(); //for asset sharing
InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton());
@@ -5358,22 +5431,20 @@ EditorNode::EditorNode() {
play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5));
#endif
+ // Toggle for video driver
video_driver = memnew(OptionButton);
video_driver->set_flat(true);
video_driver->set_focus_mode(Control::FOCUS_NONE);
video_driver->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
+ video_driver->connect("item_selected", this, "_video_driver_selected");
+ menu_hb->add_child(video_driver);
+
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
- menu_hb->add_child(video_driver);
video_driver_current = 0;
for (int i = 0; i < video_drivers.get_slice_count(","); i++) {
String driver = video_drivers.get_slice(",", i);
- if (gui_base->has_icon(driver, "EditorIcons")) {
- video_driver->add_icon_item(gui_base->get_icon(driver, "EditorIcons"), "");
- } else {
- video_driver->add_item(driver);
- }
-
+ video_driver->add_item(driver);
video_driver->set_item_metadata(i, driver);
if (current_video_driver == driver) {
@@ -5382,7 +5453,6 @@ EditorNode::EditorNode() {
}
}
- video_driver->connect("item_selected", this, "_video_driver_selected");
video_restart_dialog = memnew(ConfirmationDialog);
video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor."));
video_restart_dialog->get_ok()->set_text(TTR("Save & Restart"));
@@ -5788,7 +5858,7 @@ EditorNode::EditorNode() {
#else
ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F1);
ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F2);
- ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack neded for script editor F3 search to work :) Assign like this or don't use F3
+ ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack needed for script editor F3 search to work :) Assign like this or don't use F3
ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F4);
#endif
ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library"));
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 5a17ab6ca0..7409c64a64 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -706,6 +706,8 @@ public:
void stop_child_process();
Ref<Theme> get_editor_theme() const { return theme; }
+ Ref<Texture> get_object_icon(const Object *p_object, const String &p_fallback = "Object") const;
+ Ref<Texture> get_class_icon(const String &p_class, const String &p_fallback = "Object") const;
void show_accept(const String &p_text, const String &p_title);
void show_warning(const String &p_text, const String &p_title = "Warning!");
diff --git a/editor/editor_path.cpp b/editor/editor_path.cpp
index 9506a0e951..0eff1fd7dd 100644
--- a/editor/editor_path.cpp
+++ b/editor/editor_path.cpp
@@ -54,12 +54,7 @@ void EditorPath::_add_children_to_popup(Object *p_obj, int p_depth) {
if (!obj)
continue;
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
int index = popup->get_item_count();
popup->add_icon_item(icon, E->get().name.capitalize(), objects.size());
@@ -122,12 +117,7 @@ void EditorPath::_notification(int p_what) {
String type = obj->get_class();
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
icon->draw(ci, Point2i(ofs, (size.height - icon->get_height()) / 2));
diff --git a/editor/editor_plugin_settings.cpp b/editor/editor_plugin_settings.cpp
index ef0b61e882..30027c0c34 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -117,7 +117,7 @@ void EditorPluginSettings::update_plugins() {
TreeItem *item = plugin_list->create_item(root);
item->set_text(0, name);
- item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script);
+ item->set_tooltip(0, "Name: " + name + "\nPath: " + path + "\nMain Script: " + script + "\nDescription: " + description);
item->set_metadata(0, d);
item->set_text(1, version);
item->set_metadata(1, script);
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 069b9147ce..3439133809 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -846,18 +846,11 @@ void EditorPropertyObjectID::update_property() {
if (type == "")
type = "Object";
- String icon_type = type;
- if (has_icon(icon_type, "EditorIcons")) {
- type = icon_type;
- } else {
- type = "Object";
- }
-
ObjectID id = get_edited_object()->get(get_edited_property());
if (id != 0) {
edit->set_text(type + " ID: " + itos(id));
edit->set_disabled(false);
- edit->set_icon(get_icon(icon_type, "EditorIcons"));
+ edit->set_icon(EditorNode::get_singleton()->get_class_icon(type));
} else {
edit->set_text(TTR("[Empty]"));
edit->set_disabled(true);
@@ -1858,14 +1851,7 @@ void EditorPropertyNodePath::update_property() {
ERR_FAIL_COND(!target_node);
assign->set_text(target_node->get_name());
-
- Ref<Texture> icon;
- if (has_icon(target_node->get_class(), "EditorIcons"))
- icon = get_icon(target_node->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
}
void EditorPropertyNodePath::setup(const NodePath &p_base_hint, Vector<StringName> p_valid_types) {
@@ -1905,7 +1891,7 @@ EditorPropertyNodePath::EditorPropertyNodePath() {
clear->connect("pressed", this, "_node_clear");
hbc->add_child(clear);
- scene_tree = NULL; //do not allocate unnecesarily
+ scene_tree = NULL; //do not allocate unnecessarily
}
////////////// RESOURCE //////////////////////
@@ -2363,13 +2349,7 @@ void EditorPropertyResource::update_property() {
assign->set_text(TTR("[empty]"));
} else {
- Ref<Texture> icon;
- if (has_icon(res->get_class(), "EditorIcons"))
- icon = get_icon(res->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(res.operator->(), "Node"));
if (res->get_name() != String()) {
assign->set_text(res->get_name());
@@ -2670,7 +2650,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
case PROPERTY_HINT_LAYERS_3D_PHYSICS:
lt = EditorPropertyLayers::LAYER_PHYSICS_3D;
break;
- default: {} //compiler could be smarter here and realize this cant happen
+ default: {} //compiler could be smarter here and realize this can't happen
}
EditorPropertyLayers *editor = memnew(EditorPropertyLayers);
editor->setup(lt);
@@ -2687,7 +2667,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool greater = true, lesser = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- greater = false; //if using ranged, asume false by default
+ greater = false; //if using ranged, assume false by default
lesser = false;
min = p_hint_text.get_slice(",", 0).to_int();
max = p_hint_text.get_slice(",", 1).to_int();
@@ -2735,7 +2715,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool greater = true, lesser = true;
if ((p_hint == PROPERTY_HINT_RANGE || p_hint == PROPERTY_HINT_EXP_RANGE) && p_hint_text.get_slice_count(",") >= 2) {
- greater = false; //if using ranged, asume false by default
+ greater = false; //if using ranged, assume false by default
lesser = false;
min = p_hint_text.get_slice(",", 0).to_double();
max = p_hint_text.get_slice(",", 1).to_double();
@@ -3068,7 +3048,7 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
default: {}
}
- return false; //can be overriden, although it will most likely be last anyway
+ return false; //can be overridden, although it will most likely be last anyway
}
void EditorInspectorDefaultPlugin::parse_end() {
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index 9982a31b7b..808a8ac2f8 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -336,16 +336,16 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -357,63 +357,63 @@ void EditorPropertyArray::update_property() {
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -431,8 +431,9 @@ void EditorPropertyArray::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -798,16 +799,16 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::INT: {
- EditorPropertyInteger *ed = memnew(EditorPropertyInteger);
- ed->setup(-100000, 100000, true, true);
- prop = ed;
+ EditorPropertyInteger *editor = memnew(EditorPropertyInteger);
+ editor->setup(-100000, 100000, true, true);
+ prop = editor;
} break;
case Variant::REAL: {
- EditorPropertyFloat *ed = memnew(EditorPropertyFloat);
- ed->setup(-100000, 100000, 0.001, true, false, true, true);
- prop = ed;
+ EditorPropertyFloat *editor = memnew(EditorPropertyFloat);
+ editor->setup(-100000, 100000, 0.001, true, false, true, true);
+ prop = editor;
} break;
case Variant::STRING: {
@@ -815,67 +816,66 @@ void EditorPropertyDictionary::update_property() {
} break;
- // math types
-
+ // math types
case Variant::VECTOR2: {
- EditorPropertyVector2 *ed = memnew(EditorPropertyVector2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector2 *editor = memnew(EditorPropertyVector2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::RECT2: {
- EditorPropertyRect2 *ed = memnew(EditorPropertyRect2);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyRect2 *editor = memnew(EditorPropertyRect2);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::VECTOR3: {
- EditorPropertyVector3 *ed = memnew(EditorPropertyVector3);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyVector3 *editor = memnew(EditorPropertyVector3);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM2D: {
- EditorPropertyTransform2D *ed = memnew(EditorPropertyTransform2D);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform2D *editor = memnew(EditorPropertyTransform2D);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::PLANE: {
- EditorPropertyPlane *ed = memnew(EditorPropertyPlane);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyPlane *editor = memnew(EditorPropertyPlane);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::QUAT: {
- EditorPropertyQuat *ed = memnew(EditorPropertyQuat);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyQuat *editor = memnew(EditorPropertyQuat);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::AABB: {
- EditorPropertyAABB *ed = memnew(EditorPropertyAABB);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyAABB *editor = memnew(EditorPropertyAABB);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::BASIS: {
- EditorPropertyBasis *ed = memnew(EditorPropertyBasis);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyBasis *editor = memnew(EditorPropertyBasis);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
case Variant::TRANSFORM: {
- EditorPropertyTransform *ed = memnew(EditorPropertyTransform);
- ed->setup(-100000, 100000, 0.001, true);
- prop = ed;
+ EditorPropertyTransform *editor = memnew(EditorPropertyTransform);
+ editor->setup(-100000, 100000, 0.001, true);
+ prop = editor;
} break;
@@ -893,8 +893,9 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::OBJECT: {
-
- prop = memnew(EditorPropertyResource);
+ EditorPropertyResource *editor = memnew(EditorPropertyResource);
+ editor->setup("Resource");
+ prop = editor;
} break;
case Variant::DICTIONARY: {
@@ -902,39 +903,53 @@ void EditorPropertyDictionary::update_property() {
} break;
case Variant::ARRAY: {
-
- prop = memnew(EditorPropertyArray);
-
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::ARRAY);
+ prop = editor;
} break;
// arrays
case Variant::POOL_BYTE_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_BYTE_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_INT_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_INT_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_REAL_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_REAL_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_STRING_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_STRING_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR2_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR2_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_VECTOR3_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_VECTOR3_ARRAY);
+ prop = editor;
} break;
case Variant::POOL_COLOR_ARRAY: {
- prop = memnew(EditorPropertyArray);
+ EditorPropertyArray *editor = memnew(EditorPropertyArray);
+ editor->setup(Variant::POOL_COLOR_ARRAY);
+ prop = editor;
} break;
default: {}
}
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 5d3c6dd087..3e959731fc 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -30,6 +30,7 @@
#include "editor_settings.h"
+#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"
#include "core/io/config_file.h"
#include "core/io/file_access_memory.h"
@@ -947,6 +948,10 @@ void EditorSettings::setup_network() {
_initial_set("network/debug/remote_port", port);
add_property_hint(PropertyInfo(Variant::INT, "network/debug/remote_port", PROPERTY_HINT_RANGE, "1,65535,1"));
+
+ // Editor SSL certificates override
+ _initial_set("network/ssl/editor_ssl_certificates", _SYSTEM_CERTS_PATH);
+ add_property_hint(PropertyInfo(Variant::STRING, "network/ssl/editor_ssl_certificates", PROPERTY_HINT_GLOBAL_FILE, "*.crt,*.pem"));
}
void EditorSettings::save() {
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index b5353a071c..b6e4375ce9 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -274,7 +274,7 @@ void EditorSpinSlider::_notification(int p_what) {
update();
}
if (p_what == NOTIFICATION_FOCUS_ENTER) {
- /* Sorry, I dont like this, it makes navigating the different fields with arrows more difficult.
+ /* Sorry, I don't like this, it makes navigating the different fields with arrows more difficult.
* Just press enter to edit.
* if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT) && !value_input_just_closed) {
_focus_entered();
diff --git a/editor/editor_sub_scene.cpp b/editor/editor_sub_scene.cpp
index 056ee59860..7036a0ddaa 100644
--- a/editor/editor_sub_scene.cpp
+++ b/editor/editor_sub_scene.cpp
@@ -30,6 +30,7 @@
#include "editor_sub_scene.h"
+#include "editor/editor_node.h"
#include "scene/gui/margin_container.h"
#include "scene/resources/packed_scene.h"
@@ -84,9 +85,7 @@ void EditorSubScene::_fill_tree(Node *p_node, TreeItem *p_parent) {
it->set_text(0, p_node->get_name());
it->set_editable(0, false);
it->set_selectable(0, true);
- if (has_icon(p_node->get_class(), "EditorIcons")) {
- it->set_icon(0, get_icon(p_node->get_class(), "EditorIcons"));
- }
+ it->set_icon(0, EditorNode::get_singleton()->get_object_icon(p_node, "Node"));
for (int i = 0; i < p_node->get_child_count(); i++) {
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 9ede8a05bc..11d0b67bd6 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -864,7 +864,7 @@ void FindInFilesPanel::apply_replaces_in_file(String fpath, const Vector<Result>
// If the file is already open, I assume the editor will reload it.
// If there are unsaved changes, the user will be asked on focus,
- // however that means either loosing changes or loosing replaces.
+ // however that means either losing changes or losing replaces.
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
ERR_FAIL_COND(f == NULL);
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index 0efd14e932..cb9703342f 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -90,12 +90,7 @@ void GroupDialog::_load_nodes(Node *p_current) {
node->set_metadata(0, path);
node->set_tooltip(0, path);
- Ref<Texture> icon;
- if (p_current->has_meta("_editor_icon")) {
- icon = p_current->get_meta("_editor_icon");
- } else {
- icon = get_icon((has_icon(p_current->get_class(), "EditorIcons") ? p_current->get_class() : String("Object")), "EditorIcons");
- }
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(p_current, "Node");
node->set_icon(0, icon);
if (!_can_edit(p_current, selected_group)) {
diff --git a/editor/icons/README.md b/editor/icons/README.md
index 3a2aba5b07..5f652e47ab 100644
--- a/editor/icons/README.md
+++ b/editor/icons/README.md
@@ -9,4 +9,4 @@ There you can find the optimizer script.
If you add a new icon, please make a pull request to this repo:
https://github.com/godotengine/godot-design/
-and store the the optimized SVG version here.
+and store the optimized SVG version here.
diff --git a/editor/icons/icon_GUI_checked.svg b/editor/icons/icon_GUI_checked.svg
index e5fa67ebf5..8d00eca8d3 100644
--- a/editor/icons/icon_GUI_checked.svg
+++ b/editor/icons/icon_GUI_checked.svg
@@ -1,3 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<path d="m4 2c-1.1046 0-2 0.89543-2 2v8c0 1.1046 0.89543 2 2 2h8c1.1046 0 2-0.89543 2-2v-8c0-1.1046-0.89543-2-2-2h-8zm7.293 2.293l1.4141 1.4141-6.707 6.707-2.707-2.707 1.4141-1.4141 1.293 1.293 5.293-5.293z" fill="#e0e0e0" fill-opacity=".78431"/>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m3.3333333 1c-1.2887 0-2.3333333 1.0446683-2.3333333 2.3333333v9.3333337c0 1.2887 1.0446683 2.333333 2.3333333 2.333333h9.3333337c1.2887 0 2.333333-1.044668 2.333333-2.333333v-9.3333337c0-1.2887-1.044668-2.3333333-2.333333-2.3333333z" fill-opacity=".188235" stroke-width="1.166667"/><path d="m11.500773 3.7343508-5.6117507 5.6117502-1.7045017-1.6814543-1.4992276 1.4992276 3.2037293 3.1806817 7.1109777-7.1109775z" stroke-width="1.060227"/></g></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_radio_checked.svg b/editor/icons/icon_GUI_radio_checked.svg
index 6a65d49eeb..447b57f8ae 100644
--- a/editor/icons/icon_GUI_radio_checked.svg
+++ b/editor/icons/icon_GUI_radio_checked.svg
@@ -1,6 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<circle cx="8" cy="1044.4" r="5" fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".78431" stroke-width="2"/>
-<circle cx="8" cy="1044.4" r="3" fill="#e0e0e0" fill-opacity=".78431"/>
-</g>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="m15 8a7 7 0 0 1 -7 7 7 7 0 0 1 -7-7 7 7 0 0 1 7-7 7 7 0 0 1 7 7" fill-opacity=".188235" stroke-width="2.333333"/><path d="m12 8a4 4 0 0 1 -4 4 4 4 0 0 1 -4-4 4 4 0 0 1 4-4 4 4 0 0 1 4 4" stroke-width="1.333333"/></g></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_radio_unchecked.svg b/editor/icons/icon_GUI_radio_unchecked.svg
index 6e52a8af77..1e8117bd10 100644
--- a/editor/icons/icon_GUI_radio_unchecked.svg
+++ b/editor/icons/icon_GUI_radio_unchecked.svg
@@ -1,5 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<circle cx="8" cy="1044.4" r="5" fill="none" stroke="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-opacity=".78431" stroke-width="2"/>
-</g>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m15 8a7 7 0 0 1 -7 7 7 7 0 0 1 -7-7 7 7 0 0 1 7-7 7 7 0 0 1 7 7" fill="#e0e0e0" fill-opacity=".188235" stroke-width="2.333333"/></svg> \ No newline at end of file
diff --git a/editor/icons/icon_GUI_unchecked.svg b/editor/icons/icon_GUI_unchecked.svg
index 59df40954f..9575422df3 100644
--- a/editor/icons/icon_GUI_unchecked.svg
+++ b/editor/icons/icon_GUI_unchecked.svg
@@ -1,3 +1 @@
-<svg width="16" height="16" version="1.1" viewBox="0 0 16 15.999999" xmlns="http://www.w3.org/2000/svg">
-<path d="m4 2a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2v-8a2 2 0 0 0 -2 -2h-8zm0.80078 2h6.3984a0.8 0.8 0 0 1 0.80078 0.80078v6.3984a0.8 0.8 0 0 1 -0.80078 0.80078h-6.3984a0.8 0.8 0 0 1 -0.80078 -0.80078v-6.3984a0.8 0.8 0 0 1 0.80078 -0.80078z" fill="#e0e0e0" fill-opacity=".78431"/>
-</svg>
+<svg height="16" viewBox="0 0 16 15.999999" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m3.3333333 1c-1.2887 0-2.3333333 1.0446683-2.3333333 2.3333333v9.3333337c0 1.2887 1.0446683 2.333333 2.3333333 2.333333h9.3333337c1.2887 0 2.333333-1.044668 2.333333-2.333333v-9.3333337c0-1.2887-1.044668-2.3333333-2.333333-2.3333333z" fill="#e0e0e0" fill-opacity=".188235" stroke-width="1.166667"/></svg> \ No newline at end of file
diff --git a/editor/icons/icon_g_l_e_s_2.svg b/editor/icons/icon_g_l_e_s_2.svg
deleted file mode 100644
index efc4f01e4f..0000000000
--- a/editor/icons/icon_g_l_e_s_2.svg
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="svg2"
- width="48"
- height="16"
- viewBox="0 0 47.999999 16"
- sodipodi:docname="icon_g_l_e_s_2.svg"
- inkscape:version="0.92.3 (2405546, 2018-03-11)">
- <metadata
- id="metadata8">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs6" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1484"
- inkscape:window-height="697"
- id="namedview4"
- showgrid="false"
- inkscape:zoom="13.520979"
- inkscape:cx="20.549976"
- inkscape:cy="7.9399684"
- inkscape:window-x="67"
- inkscape:window-y="27"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg2" />
- <path
- inkscape:connector-curvature="0"
- id="path835"
- d="m 19.839879,15.499154 c -0.0652,-0.0268 -0.141743,-0.1098 -0.170113,-0.184417 -0.03304,-0.08688 -0.05158,-0.95731 -0.05158,-5.912028 V 3.1830459 l 0.108486,-0.1379162 c 0.150269,-0.1910365 0.41814,-0.1907342 0.568677,6.436e-4 l 0.10899,0.1385579 -0.01358,6.2990785 c -0.01194,6.8660953 -0.0921,5.3381383 -0.0921,5.9327083 -0.106573,0.104434 -0.315006,0.142158 -0.458762,0.08303 z M 5.3808767,14.575188 C 4.5309456,14.518738 3.6260357,14.196602 2.9750499,13.718734 2.5767564,13.42636 2.0035795,12.787236 1.747789,12.350269 1.2385669,11.480363 1.0170768,10.580508 1.0213778,9.399057 1.0293972,7.2009406 1.9726797,5.5285643 3.6891526,4.6693537 4.7813316,4.1226444 6.2246017,4.0371807 7.4330177,4.4476602 8.1309525,4.6847376 8.4685433,4.8972607 9.0207129,5.4471587 9.4063328,5.8311907 9.5338898,6.0004852 9.7108978,6.3631718 9.8335428,6.6144683 9.9681328,6.9987435 10.020175,7.2461971 10.145759,7.8433551 10.170431,7.8289765 9.0218356,7.828057 8.5307356,7.8276009 8.0769363,7.8134035 8.0133918,7.7963663 7.9392662,7.7764919 7.8757344,7.6970176 7.8361313,7.5746239 7.5012661,6.5397183 6.6297764,6.0267536 5.4889128,6.193037 4.244092,6.3744711 3.4980921,7.3344965 3.343357,8.9541432 3.2260083,10.182472 3.5434132,11.329338 4.1781352,11.97041 c 0.46237,0.466997 0.9869175,0.673904 1.7084683,0.673904 1.2025378,0 1.9439704,-0.533034 2.1862936,-1.57178 0.055989,-0.240028 0.059178,-0.324448 0.012859,-0.341503 -0.033838,-0.01246 -0.5090516,-0.02871 -1.0560342,-0.03612 L 6.0352096,10.681458 V 9.8178001 8.9541431 l 1.9890278,-0.014575 c 1.0939663,-0.00802 2.0422396,-0.00163 2.1072756,0.014201 l 0.118246,0.028779 -0.01356,2.6814549 -0.01356,2.681455 -0.7170922,0.01455 c -0.8295927,0.01682 -0.7753286,0.05076 -0.8815155,-0.55106 -0.036825,-0.208719 -0.077853,-0.379487 -0.091164,-0.379487 -0.013311,0 -0.16916,0.135437 -0.3463303,0.300972 -0.3894417,0.363866 -0.8188673,0.600316 -1.3418506,0.738852 -0.4725114,0.125166 -0.8081647,0.149449 -1.4638111,0.10591 z M 32.49721,14.469781 c -0.928547,-0.194854 -1.630354,-0.56605 -2.174913,-1.150343 -0.515384,-0.552992 -0.832054,-1.344249 -0.800629,-2.000518 l 0.01549,-0.323408 1.060826,-0.01418 1.060825,-0.01418 0.05146,0.135352 c 0.0283,0.07444 0.0517,0.198593 0.05197,0.275887 8.54e-4,0.230559 0.229434,0.649361 0.479979,0.879354 0.347226,0.318744 0.735307,0.44853 1.431019,0.478576 1.267096,0.05472 2.007349,-0.393206 1.947849,-1.178652 -0.0456,-0.601928 -0.471503,-0.860841 -2.12876,-1.294103 C 32.881626,10.103917 32.242852,9.9264243 32.07283,9.8691486 30.95902,9.4939337 30.283515,8.9537559 29.97948,8.195172 29.836139,7.8375288 29.784025,7.0484225 29.874852,6.6109088 30.100606,5.5234588 31.071976,4.6456053 32.416011,4.314394 33.01697,4.1662997 34.128873,4.156633 34.77144,4.293917 c 1.67335,0.3575071 2.584333,1.270761 2.774448,2.7813655 0.0543,0.4314615 0.0347,0.4394334 -1.080484,0.4394334 -0.521251,0 -0.9851,-0.023133 -1.038665,-0.051802 C 35.367672,7.4313026 35.307808,7.3078793 35.273143,7.1462409 35.195527,6.7843357 35.099156,6.6147944 34.849667,6.4012402 34.543832,6.1394568 34.14764,6.029069 33.515213,6.0294329 c -0.428465,2.111e-4 -0.570793,0.021517 -0.784491,0.1172346 -0.47592,0.2131691 -0.654939,0.4628549 -0.654939,0.9134748 0,0.5904894 0.225799,0.7059322 2.58195,1.3200619 1.350552,0.3520209 1.903346,0.598685 2.415601,1.0778741 0.591219,0.5530567 0.852295,1.2543747 0.796412,2.1393787 -0.07929,1.255762 -0.891416,2.255747 -2.192274,2.699402 -0.885807,0.302103 -2.21918,0.374602 -3.180262,0.172924 z M 11.476954,14.306572 c -0.0138,-0.03619 -0.019,-2.268126 -0.01158,-4.9598581 l 0.0135,-4.8940567 1.066335,-0.01419 c 0.742348,-0.00988 1.088249,0.00399 1.138458,0.045665 0.06009,0.049873 0.07211,0.7135739 0.07211,3.9791612 v 3.9193056 h 2.293081 c 1.756352,0 2.314103,0.01538 2.382892,0.06567 0.07993,0.05845 0.08822,0.166396 0.07543,0.981428 l -0.01437,0.915757 -3.495384,0.01345 c -2.768549,0.0107 -3.500605,-1.69e-4 -3.520473,-0.05234 z m 10.193414,0.0026 c -0.04842,-0.04842 -0.06297,-1.193838 -0.06236,-4.9074882 4.61e-4,-2.6643823 0.01959,-4.8739347 0.04256,-4.9101166 0.03301,-0.05201 0.813774,-0.062971 3.728627,-0.052342 l 3.686862,0.013441 V 5.3948518 6.337024 l -2.5648,0.026171 -2.5648,0.026172 v 0.9421438 0.9421716 l 2.313597,0.026171 c 1.548367,0.017515 2.332217,0.044804 2.36989,0.082507 0.03673,0.036745 0.05127,0.3461819 0.04183,0.889829 l -0.01446,0.8334926 -2.355428,0.02617 -2.355429,0.02617 v 1.0992 1.099199 l 2.617143,0.0274 c 1.439428,0.01507 2.623562,0.03274 2.63141,0.03926 0.0078,0.0065 0.0078,0.441727 0,0.967118 l -0.01427,0.955257 -3.718613,0.01343 c -2.848812,0.01027 -3.733388,-0.0013 -3.781773,-0.04973 z m 17.753791,-0.378679 c -0.04061,-0.105824 0.0759,-0.828141 0.198829,-1.232689 0.288088,-0.948035 0.88431,-1.590368 2.319422,-2.498804 1.100465,-0.6965999 1.86374,-1.2293374 2.17747,-1.5198007 0.515251,-0.477031 0.731074,-1.0868265 0.620161,-1.7522036 -0.126353,-0.7579473 -0.607483,-1.1395723 -1.436711,-1.1395723 -0.930964,0 -1.401324,0.4507271 -1.481617,1.4197789 l -0.03634,0.4383927 h -1.099202 -1.099196 l -0.01524,-0.3725124 c -0.03408,-0.8332648 0.288934,-1.6827799 0.855164,-2.2490093 0.399774,-0.3997734 1.09283,-0.7574546 1.70958,-0.8822975 0.580047,-0.1174131 1.71432,-0.1077309 2.332892,0.019914 1.258364,0.2596698 2.203978,1.0560413 2.520675,2.1228587 0.104477,0.3519131 0.117355,0.4871812 0.09657,1.0144101 -0.01959,0.4962935 -0.04847,0.667451 -0.157022,0.9292002 -0.313508,0.7560998 -0.900391,1.3802206 -1.888823,2.0086882 -1.507571,0.958543 -1.915442,1.243322 -2.230808,1.557578 -0.26352,0.262604 -0.32016,0.345357 -0.261709,0.382352 0.04123,0.0261 1.061246,0.04757 2.280484,0.04802 1.96272,7.11e-4 2.209393,0.0099 2.237659,0.0836 0.01749,0.04554 0.03178,0.408703 0.03178,0.807033 0,0.398331 -0.0143,0.761495 -0.03178,0.807033 -0.0286,0.07445 -0.414152,0.0828 -3.822672,0.0828 -3.236429,0 -3.795092,-0.01093 -3.819578,-0.07475 z"
- style="fill:#5586a4;fill-opacity:1;stroke-width:0.05234285"
- sodipodi:nodetypes="ccscccccccccsscsscccccscccsccsccccccccccssscccccccccccccccscsccsccccsssscscccccccscscscccccccscccccccscccccccscccccccccccscccccsssccccccccscscc" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path819"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path817"
- inkscape:connector-curvature="0" />
-</svg>
diff --git a/editor/icons/icon_g_l_e_s_3.svg b/editor/icons/icon_g_l_e_s_3.svg
deleted file mode 100644
index dfa3c26b38..0000000000
--- a/editor/icons/icon_g_l_e_s_3.svg
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="svg2"
- width="48"
- height="16"
- viewBox="0 0 47.999999 16"
- sodipodi:docname="icon_g_l_e_s_3.svg"
- inkscape:version="0.92.3 (2405546, 2018-03-11)">
- <metadata
- id="metadata8">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs6" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1484"
- inkscape:window-height="697"
- id="namedview4"
- showgrid="false"
- inkscape:zoom="13.520979"
- inkscape:cx="20.549976"
- inkscape:cy="7.9399684"
- inkscape:window-x="67"
- inkscape:window-y="27"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg2" />
- <path
- style="fill:#6aa455;fill-opacity:1;stroke-width:0.05234285"
- d="M 20.011719 2.9023438 C 19.90715 2.9022255 19.801697 2.9494036 19.726562 3.0449219 L 19.619141 3.1835938 L 19.619141 9.4023438 C 19.619141 14.357062 19.636882 15.227573 19.669922 15.314453 C 19.698292 15.38907 19.774644 15.4732 19.839844 15.5 C 19.9836 15.559128 20.192255 15.52045 20.298828 15.416016 C 20.298828 14.821446 20.378685 16.35047 20.390625 9.484375 L 20.404297 3.1835938 L 20.294922 3.0449219 C 20.219653 2.949233 20.116287 2.902462 20.011719 2.9023438 z M 33.578125 4.1972656 C 33.144709 4.2010336 32.716495 4.240406 32.416016 4.3144531 C 31.071981 4.6456644 30.100754 5.5238781 29.875 6.6113281 C 29.784173 7.0488418 29.835175 7.8376693 29.978516 8.1953125 C 30.282551 8.9538964 30.958456 9.4939257 32.072266 9.8691406 C 32.242288 9.9264163 32.881487 10.104023 33.492188 10.263672 C 35.149445 10.696934 35.575494 10.956666 35.621094 11.558594 C 35.680594 12.34404 34.940924 12.791048 33.673828 12.736328 C 32.978116 12.706282 32.589413 12.576557 32.242188 12.257812 C 31.991643 12.02782 31.762573 11.609465 31.761719 11.378906 C 31.761449 11.301612 31.739238 11.176002 31.710938 11.101562 L 31.658203 10.966797 L 30.597656 10.980469 L 29.537109 10.996094 L 29.521484 11.318359 C 29.490059 11.974628 29.806882 12.767321 30.322266 13.320312 C 30.866825 13.904606 31.5695 14.275849 32.498047 14.470703 C 33.459129 14.672381 34.791927 14.598978 35.677734 14.296875 C 36.978592 13.85322 37.789851 12.853418 37.869141 11.597656 C 37.925024 10.712652 37.665438 10.012041 37.074219 9.4589844 C 36.561964 8.9797953 36.008755 8.7328803 34.658203 8.3808594 C 32.302052 7.7667297 32.076172 7.6510363 32.076172 7.0605469 C 32.076172 6.609927 32.254549 6.3596535 32.730469 6.1464844 C 32.944167 6.0507668 33.08716 6.029508 33.515625 6.0292969 C 34.148052 6.028933 34.543774 6.1386072 34.849609 6.4003906 C 35.099098 6.6139448 35.195822 6.7845792 35.273438 7.1464844 C 35.308103 7.3081228 35.366714 7.4312793 35.425781 7.4628906 C 35.479346 7.4915596 35.943593 7.515625 36.464844 7.515625 C 37.580028 7.515625 37.599222 7.5076334 37.544922 7.0761719 C 37.354807 5.5655674 36.444834 4.6504759 34.771484 4.2929688 C 34.450201 4.2243268 34.011541 4.1934977 33.578125 4.1972656 z M 5.5175781 4.1992188 C 4.8691862 4.2376134 4.2355426 4.3965672 3.6894531 4.6699219 C 1.9729802 5.5291325 1.0295038 7.2003211 1.0214844 9.3984375 C 1.0171834 10.579889 1.2388248 11.479703 1.7480469 12.349609 C 2.0038374 12.786576 2.5763159 13.426376 2.9746094 13.71875 C 3.6255952 14.196618 4.5309283 14.517769 5.3808594 14.574219 C 6.0365058 14.617758 6.3712386 14.593916 6.84375 14.46875 C 7.3667333 14.330214 7.7980583 14.094335 8.1875 13.730469 C 8.3646703 13.564934 8.5198921 13.429688 8.5332031 13.429688 C 8.5465141 13.429688 8.588175 13.599875 8.625 13.808594 C 8.7311869 14.410414 8.6762667 14.376195 9.5058594 14.359375 L 10.222656 14.345703 L 10.236328 11.664062 L 10.25 8.9824219 L 10.130859 8.953125 C 10.065823 8.937294 9.1174038 8.9314331 8.0234375 8.9394531 L 6.0351562 8.9550781 L 6.0351562 9.8183594 L 6.0351562 10.681641 L 7.0292969 10.695312 C 7.5762795 10.702722 8.0520995 10.718009 8.0859375 10.730469 C 8.1322565 10.747524 8.1282546 10.832238 8.0722656 11.072266 C 7.8299424 12.111012 7.0892565 12.644531 5.8867188 12.644531 C 5.1651679 12.644531 4.6401044 12.4377 4.1777344 11.970703 C 3.5430124 11.329631 3.2264013 10.183407 3.34375 8.9550781 C 3.4984851 7.3354314 4.2434605 6.3747935 5.4882812 6.1933594 C 6.6291449 6.027076 7.5010723 6.5393131 7.8359375 7.5742188 C 7.8755406 7.6966124 7.9395463 7.7770006 8.0136719 7.796875 C 8.0772164 7.8139122 8.5303844 7.8276689 9.0214844 7.828125 C 10.17008 7.8290445 10.145115 7.8432518 10.019531 7.2460938 C 9.967489 6.9986401 9.8335825 6.6145778 9.7109375 6.3632812 C 9.5339295 6.0005947 9.4071043 5.8312976 9.0214844 5.4472656 C 8.4693148 4.8973676 8.1315285 4.684343 7.4335938 4.4472656 C 6.8293858 4.2420259 6.16597 4.1608241 5.5175781 4.1992188 z M 42.03125 4.2617188 L 41.537109 4.4335938 C 40.933232 4.6433398 40.657695 4.8014669 40.300781 5.1386719 C 39.969225 5.4519119 39.761404 5.8046136 39.621094 6.2910156 C 39.502474 6.7023596 39.433137 7.3494687 39.498047 7.4492188 C 39.531044 7.4999487 39.783863 7.5127831 40.576172 7.5019531 L 41.611328 7.4863281 L 41.691406 7.0703125 C 41.808812 6.4678105 41.927622 6.2685471 42.265625 6.0957031 C 42.510424 5.9705181 42.604184 5.953125 43.019531 5.953125 C 43.426321 5.953125 43.533311 5.9721266 43.765625 6.0878906 C 44.253715 6.3311276 44.455638 6.904517 44.273438 7.53125 C 44.105442 8.109131 43.697334 8.363965 42.791016 8.453125 C 42.521874 8.479605 42.288464 8.51424 42.271484 8.53125 C 42.225224 8.577174 42.232777 9.7874244 42.279297 9.8339844 C 42.301291 9.8559744 42.598053 9.8907794 42.939453 9.9121094 C 43.836652 9.9681724 44.239534 10.166191 44.525391 10.691406 C 44.916028 11.409137 44.561069 12.318315 43.787109 12.582031 C 43.476088 12.688024 42.767292 12.688624 42.470703 12.583984 C 42.00204 12.418633 41.795632 12.174325 41.642578 11.597656 L 41.560547 11.285156 L 40.46875 11.285156 L 39.376953 11.285156 L 39.361328 11.527344 C 39.352678 11.660649 39.384791 11.918152 39.431641 12.099609 C 39.739925 13.294376 40.783209 14.156157 42.212891 14.396484 C 42.284425 14.408514 42.682741 14.422181 43.097656 14.425781 C 44.074936 14.434074 44.653306 14.320796 45.308594 13.996094 C 46.07786 13.61492 46.610204 13.058412 46.847656 12.382812 C 47.087412 11.700564 47.08166 10.999125 46.833984 10.333984 C 46.695621 9.962377 46.130198 9.3782416 45.6875 9.1503906 C 45.523031 9.0657476 45.386773 8.9810006 45.386719 8.9628906 C 45.386654 8.9447846 45.539488 8.8195027 45.724609 8.6835938 C 46.129744 8.3861558 46.390215 8.064434 46.53125 7.6875 C 46.963216 6.532963 46.370297 5.2063894 45.166016 4.6308594 C 44.482944 4.3044164 44.23589 4.2611938 43.072266 4.2617188 L 42.03125 4.2617188 z M 12.544922 4.4375 L 11.478516 4.453125 L 11.464844 9.3476562 C 11.457424 12.039388 11.462763 14.270451 11.476562 14.306641 C 11.49643 14.358812 12.229498 14.370075 14.998047 14.359375 L 18.492188 14.345703 L 18.507812 13.429688 C 18.520602 12.614656 18.511571 12.507669 18.431641 12.449219 C 18.362852 12.398929 17.80518 12.382812 16.048828 12.382812 L 13.755859 12.382812 L 13.755859 8.4628906 C 13.755859 5.1973033 13.743684 4.534248 13.683594 4.484375 C 13.633385 4.4427 13.28727 4.42762 12.544922 4.4375 z M 25.378906 4.4394531 C 22.464053 4.4288241 21.683401 4.4401775 21.650391 4.4921875 C 21.627421 4.5283694 21.607883 6.7379615 21.607422 9.4023438 C 21.606812 13.115994 21.621502 14.260174 21.669922 14.308594 C 21.718307 14.357024 22.60236 14.369645 25.451172 14.359375 L 29.169922 14.345703 L 29.185547 13.390625 C 29.193347 12.865234 29.193347 12.430328 29.185547 12.423828 C 29.177699 12.417308 27.992162 12.399836 26.552734 12.384766 L 23.935547 12.355469 L 23.935547 11.257812 L 23.935547 10.158203 L 26.291016 10.132812 L 28.646484 10.105469 L 28.662109 9.2714844 C 28.671549 8.7278373 28.655871 8.4195575 28.619141 8.3828125 C 28.581468 8.3451095 27.798367 8.3182962 26.25 8.3007812 L 23.935547 8.2734375 L 23.935547 7.3320312 L 23.935547 6.3886719 L 26.501953 6.3632812 L 29.066406 6.3378906 L 29.066406 5.3945312 L 29.066406 4.453125 L 25.378906 4.4394531 z "
- id="path3424" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path819"
- inkscape:connector-curvature="0" />
- <path
- style="fill:#000000;stroke-width:1.06666672"
- d=""
- id="path817"
- inkscape:connector-curvature="0" />
-</svg>
diff --git a/editor/import/resource_importer_layered_texture.cpp b/editor/import/resource_importer_layered_texture.cpp
index a0ed27c72c..afda07c1c2 100644
--- a/editor/import/resource_importer_layered_texture.cpp
+++ b/editor/import/resource_importer_layered_texture.cpp
@@ -304,7 +304,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
}
if (!ok_on_pc) {
- EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correcly on PC.");
+ EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correctly on PC.");
}
} else {
//import normally
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index acca1725d7..5eb1a42f9f 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -499,7 +499,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
}
if (!ok_on_pc) {
- EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correcly on PC.");
+ EditorNode::add_io_error("Warning, no suitable PC VRAM compression enabled in Project Settings. This texture will not display correctly on PC.");
}
} else {
//import normally
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 9145a66510..81a798f0b6 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -104,6 +104,7 @@ void InspectorDock::_menu_option(int p_option) {
res = duplicates[res];
current->set(E->get().name, res);
+ editor->get_inspector()->update_property(E->get().name);
}
}
}
@@ -158,7 +159,6 @@ void InspectorDock::_resource_file_selected(String p_file) {
RES res = ResourceLoader::load(p_file);
if (res.is_null()) {
- warning_dialog->get_ok()->set_text(TTR("OK"));
warning_dialog->set_text(TTR("Failed to load resource."));
return;
};
@@ -231,11 +231,10 @@ void InspectorDock::_prepare_history() {
already.insert(id);
- Ref<Texture> icon = get_icon("Object", "EditorIcons");
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj, "");
+ if (icon.is_null()) {
icon = base_icon;
+ }
String text;
if (Object::cast_to<Resource>(obj)) {
@@ -320,7 +319,6 @@ void InspectorDock::_transform_keyed(Object *sp, const String &p_sub, const Tran
}
void InspectorDock::_warning_pressed() {
- warning_dialog->get_ok()->set_text(TTR("Ok"));
warning_dialog->popup_centered_minsize();
}
@@ -405,8 +403,8 @@ void InspectorDock::update(Object *p_object) {
PopupMenu *p = object_menu->get_popup();
p->clear();
- p->add_shortcut(ED_SHORTCUT("property_editor/expand_all", TTR("Expand all properties")), EXPAND_ALL);
- p->add_shortcut(ED_SHORTCUT("property_editor/collapse_all", TTR("Collapse all properties")), COLLAPSE_ALL);
+ p->add_shortcut(ED_SHORTCUT("property_editor/expand_all", TTR("Expand All Properties")), EXPAND_ALL);
+ p->add_shortcut(ED_SHORTCUT("property_editor/collapse_all", TTR("Collapse All Properties")), COLLAPSE_ALL);
p->add_separator();
if (is_resource) {
p->add_item(TTR("Save"), RESOURCE_SAVE);
diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp
index 2d341cdd93..b51ff8b320 100644
--- a/editor/plugins/abstract_polygon_2d_editor.cpp
+++ b/editor/plugins/abstract_polygon_2d_editor.cpp
@@ -275,6 +275,10 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
return (mb.is_valid() && mb->get_button_index() == 1);
}
+ CanvasItemEditor::Tool tool = CanvasItemEditor::get_singleton()->get_current_tool();
+ if (tool != CanvasItemEditor::TOOL_SELECT)
+ return false;
+
if (mb.is_valid()) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * _get_node()->get_global_transform();
@@ -283,10 +287,10 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cpoint = _get_node()->get_global_transform().affine_inverse().xform(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));
if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) {
-
if (mb->get_button_index() == BUTTON_LEFT) {
-
if (mb->is_pressed()) {
+ if (mb->get_control() || mb->get_shift() || mb->get_alt())
+ return false;
const PosVertex insert = closest_edge_point(gpoint);
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 4d27a5cea4..19d5243776 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -241,7 +241,7 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
mb->get_popup()->connect("index_pressed", this, "_anim_selected", varray(options, E->get()), CONNECT_DEFERRED);
}
- /* should be no longer necesary, as the boolean works
+ /* should be no longer necessary, as the boolean works
Ref<AnimationNodeOneShot> oneshot = agnode;
if (oneshot.is_valid()) {
@@ -542,11 +542,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
if (base->has_node(accum)) {
Node *node = base->get_node(accum);
- if (has_icon(node->get_class(), "EditorIcons")) {
- ti->set_icon(0, get_icon(node->get_class(), "EditorIcons"));
- } else {
- ti->set_icon(0, get_icon("Node", "EditorIcons"));
- }
+ ti->set_icon(0, EditorNode::get_singleton()->get_object_icon(node, "Node"));
}
} else {
@@ -559,7 +555,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
node = base->get_node(accum);
}
if (!node)
- continue; //no node, cant edit
+ continue; //no node, can't edit
if (path.get_subname_count()) {
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index bd7b58f65a..bf7603bd86 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1515,7 +1515,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
void AnimationPlayerEditor::_start_onion_skinning() {
- // FIXME: Using "idle_frame" makes onion layers update one frame behing the current
+ // FIXME: Using "idle_frame" makes onion layers update one frame behind the current
if (!get_tree()->is_connected("idle_frame", this, "call_deferred")) {
get_tree()->connect("idle_frame", this, "call_deferred", varray("_prepare_onion_layers_1"));
}
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index d00c06bd12..e83773257b 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -663,7 +663,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() {
transition_lines.clear();
- //draw conecting line for potential new transition
+ //draw connecting line for potential new transition
if (connecting) {
Vector2 from = (state_machine->get_node_position(connecting_from) * EDSCALE) - state_machine->get_graph_offset() * EDSCALE;
Vector2 to;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 7fe9f429b0..61433bbeec 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -443,8 +443,12 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
- if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ if (canvas_item) {
+ if (!canvas_item->is_set_as_toplevel()) {
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ } else {
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, canvas_item->get_transform(), p_canvas_xform);
+ }
} else {
CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
_find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
@@ -610,8 +614,12 @@ void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_n
if (!lock_children || !editable) {
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
- if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ if (canvas_item) {
+ if (!canvas_item->is_set_as_toplevel()) {
+ _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ } else {
+ _find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, canvas_item->get_transform(), p_canvas_xform);
+ }
} else {
CanvasLayer *canvas_layer = Object::cast_to<CanvasLayer>(p_node);
_find_canvas_items_in_rect(p_rect, p_node->get_child(i), r_items, Transform2D(), canvas_layer ? canvas_layer->get_transform() : p_canvas_xform);
@@ -1905,11 +1913,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
for (int i = 0; i < selection_results.size(); i++) {
CanvasItem *item = selection_results[i].item;
- Ref<Texture> icon;
- if (item->has_meta("_editor_icon"))
- icon = item->get_meta("_editor_icon");
- else
- icon = get_icon(has_icon(item->get_class(), "EditorIcons") ? item->get_class() : String("Object"), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(item, "Node");
String node_path = "/" + root_name + "/" + root_path.rel_path_to(item->get_path());
selection_menu->add_item(item->get_name());
@@ -2046,10 +2050,7 @@ bool CanvasItemEditor::_gui_input_hover(const Ref<InputEvent> &p_event) {
_HoverResult hover_result;
hover_result.position = canvas_item->get_global_transform_with_canvas().get_origin();
- if (has_icon(canvas_item->get_class(), "EditorIcons"))
- hover_result.icon = get_icon(canvas_item->get_class(), "EditorIcons");
- else
- hover_result.icon = get_icon("Object", "EditorIcons");
+ hover_result.icon = EditorNode::get_singleton()->get_object_icon(canvas_item);
hover_result.name = canvas_item->get_name();
hovering_results_tmp.push_back(hover_result);
@@ -2898,7 +2899,7 @@ void CanvasItemEditor::_draw_hover() {
Size2 item_size = Size2(node_icon->get_size().x + 4 + node_name_size.x, MAX(node_icon->get_size().y, node_name_size.y - 3));
Point2 pos = transform.xform(hovering_results[i].position) - Point2(0, item_size.y) + (Point2(node_icon->get_size().x, -node_icon->get_size().y) / 4);
- // Rectify the position to avoid overlaping items
+ // Rectify the position to avoid overlapping items
for (List<Rect2>::Element *E = previous_rects.front(); E; E = E->next()) {
if (E->get().intersects(Rect2(pos, item_size))) {
pos.y = E->get().get_position().y - item_size.y;
@@ -2945,13 +2946,13 @@ void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p
float offset = 0;
Ref<Texture> lock = get_icon("LockViewport", "EditorIcons");
- if (p_node->has_meta("_edit_lock_")) {
+ if (p_node->has_meta("_edit_lock_") && show_edit_locks) {
lock->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
offset += lock->get_size().x;
}
Ref<Texture> group = get_icon("GroupViewport", "EditorIcons");
- if (canvas_item->has_meta("_edit_group_")) {
+ if (canvas_item->has_meta("_edit_group_") && show_edit_locks) {
group->draw(viewport_canvas_item, (transform * canvas_xform * parent_xform).xform(Point2(0, 0)) + Point2(offset, 0));
//offset += group->get_size().x;
}
@@ -3550,6 +3551,12 @@ void CanvasItemEditor::_popup_callback(int p_op) {
view_menu->get_popup()->set_item_checked(idx, show_viewport);
viewport->update();
} break;
+ case SHOW_EDIT_LOCKS: {
+ show_edit_locks = !show_edit_locks;
+ int idx = view_menu->get_popup()->get_item_index(SHOW_EDIT_LOCKS);
+ view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
+ viewport->update();
+ } break;
case SNAP_USE_NODE_PARENT: {
snap_node_parent = !snap_node_parent;
int idx = smartsnap_config_popup->get_item_index(SNAP_USE_NODE_PARENT);
@@ -4153,6 +4160,7 @@ Dictionary CanvasItemEditor::get_state() const {
state["show_rulers"] = show_rulers;
state["show_guides"] = show_guides;
state["show_helpers"] = show_helpers;
+ state["show_edit_locks"] = show_edit_locks;
state["snap_rotation"] = snap_rotation;
state["snap_relative"] = snap_relative;
state["snap_pixel"] = snap_pixel;
@@ -4272,6 +4280,12 @@ void CanvasItemEditor::set_state(const Dictionary &p_state) {
view_menu->get_popup()->set_item_checked(idx, show_helpers);
}
+ if (state.has("show_edit_locks")) {
+ show_edit_locks = state["show_edit_locks"];
+ int idx = view_menu->get_popup()->get_item_index(SHOW_EDIT_LOCKS);
+ view_menu->get_popup()->set_item_checked(idx, show_edit_locks);
+ }
+
if (state.has("snap_rotation")) {
snap_rotation = state["snap_rotation"];
int idx = snap_config_menu->get_popup()->get_item_index(SNAP_USE_ROTATION);
@@ -4397,7 +4411,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
zoom_plus = memnew(ToolButton);
zoom_hb->add_child(zoom_plus);
zoom_plus->connect("pressed", this, "_button_zoom_plus");
- zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom in"), KEY_MASK_CMD | KEY_PLUS));
+ zoom_plus->set_shortcut(ED_SHORTCUT("canvas_item_editor/zoom_plus", TTR("Zoom in"), KEY_MASK_CMD | KEY_EQUAL)); // Usually direct access key for PLUS
zoom_plus->set_focus_mode(FOCUS_NONE);
updating_scroll = false;
@@ -4419,13 +4433,6 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
move_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/move_mode", TTR("Move Mode"), KEY_W));
move_button->set_tooltip(TTR("Move Mode"));
- scale_button = memnew(ToolButton);
- hb->add_child(scale_button);
- scale_button->set_toggle_mode(true);
- scale_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE));
- scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), KEY_S));
- scale_button->set_tooltip(TTR("Scale Mode"));
-
rotate_button = memnew(ToolButton);
hb->add_child(rotate_button);
rotate_button->set_toggle_mode(true);
@@ -4433,6 +4440,13 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
rotate_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/rotate_mode", TTR("Rotate Mode"), KEY_E));
rotate_button->set_tooltip(TTR("Rotate Mode"));
+ scale_button = memnew(ToolButton);
+ hb->add_child(scale_button);
+ scale_button->set_toggle_mode(true);
+ scale_button->connect("pressed", this, "_button_tool_select", make_binds(TOOL_SCALE));
+ scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), KEY_S));
+ scale_button->set_tooltip(TTR("Scale Mode"));
+
hb->add_child(memnew(VSeparator));
list_select_button = memnew(ToolButton);
@@ -4542,6 +4556,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_guides", TTR("Show Guides"), KEY_Y), SHOW_GUIDES);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_origin", TTR("Show Origin")), SHOW_ORIGIN);
p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_viewport", TTR("Show Viewport")), SHOW_VIEWPORT);
+ p->add_check_shortcut(ED_SHORTCUT("canvas_item_editor/show_edit_locks", TTR("Show Group And Lock Icons")), SHOW_EDIT_LOCKS);
+
p->add_separator();
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/center_selection", TTR("Center Selection"), KEY_F), VIEW_CENTER_TO_SELECTION);
p->add_shortcut(ED_SHORTCUT("canvas_item_editor/frame_selection", TTR("Frame Selection"), KEY_MASK_SHIFT | KEY_F), VIEW_FRAME_TO_SELECTION);
@@ -4632,6 +4648,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
show_helpers = false;
show_rulers = true;
show_guides = true;
+ show_edit_locks = true;
zoom = 1;
view_offset = Point2(-150 - RULER_WIDTH, -95 - RULER_WIDTH);
previous_update_view_offset = view_offset; // Moves the view a little bit to the left so that (0,0) is visible. The values a relative to a 16/10 screen
@@ -4924,7 +4941,6 @@ void CanvasItemEditorViewport::_perform_drop_data() {
// Without root dropping multiple files is not allowed
if (!target_node && selected_files.size() > 1) {
- accept->get_ok()->set_text(TTR("Ok"));
accept->set_text(TTR("Cannot instantiate multiple nodes without root."));
accept->popup_centered_minsize();
return;
@@ -4986,7 +5002,6 @@ void CanvasItemEditorViewport::_perform_drop_data() {
files_str += error_files[i].get_file().get_basename() + ",";
}
files_str = files_str.substr(0, files_str.length() - 1);
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error instancing scene from %s"), files_str.c_str()));
accept->popup_centered_minsize();
}
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 61d77581d3..61631dee7d 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -71,8 +71,7 @@ class CanvasItemEditor : public VBoxContainer {
GDCLASS(CanvasItemEditor, VBoxContainer);
- EditorNode *editor;
-
+public:
enum Tool {
TOOL_SELECT,
TOOL_LIST_SELECT,
@@ -84,6 +83,9 @@ class CanvasItemEditor : public VBoxContainer {
TOOL_MAX
};
+private:
+ EditorNode *editor;
+
enum MenuOption {
SNAP_USE,
SNAP_USE_NODE_PARENT,
@@ -103,6 +105,7 @@ class CanvasItemEditor : public VBoxContainer {
SHOW_GUIDES,
SHOW_ORIGIN,
SHOW_VIEWPORT,
+ SHOW_EDIT_LOCKS,
LOCK_SELECTED,
UNLOCK_SELECTED,
GROUP_SELECTED,
@@ -223,6 +226,7 @@ class CanvasItemEditor : public VBoxContainer {
bool show_origin;
bool show_viewport;
bool show_helpers;
+ bool show_edit_locks;
float zoom;
Point2 view_offset;
Point2 previous_update_view_offset;
@@ -535,6 +539,8 @@ public:
Control *get_viewport_control() { return viewport; }
+ Tool get_current_tool() { return tool; }
+
void set_undo_redo(UndoRedo *p_undo_redo) { undo_redo = p_undo_redo; }
void edit(CanvasItem *p_canvas_item);
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index 7b5de9c009..186e66f980 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -317,10 +317,7 @@ void ItemListEditor::edit(Node *p_item_list) {
item_plugins[i]->set_object(p_item_list);
property_editor->edit(item_plugins[i]);
- if (has_icon(item_list->get_class(), "EditorIcons"))
- toolbar_button->set_icon(get_icon(item_list->get_class(), "EditorIcons"));
- else
- toolbar_button->set_icon(Ref<Texture>());
+ toolbar_button->set_icon(EditorNode::get_singleton()->get_object_icon(item_list, ""));
selected_idx = i;
return;
diff --git a/editor/plugins/resource_preloader_editor_plugin.cpp b/editor/plugins/resource_preloader_editor_plugin.cpp
index da6aa48f9c..dd327d0a2c 100644
--- a/editor/plugins/resource_preloader_editor_plugin.cpp
+++ b/editor/plugins/resource_preloader_editor_plugin.cpp
@@ -238,8 +238,7 @@ void ResourcePreloaderEditor::_update_library() {
ti->set_text(2, type);
ti->set_selectable(2, false);
- if (has_icon(type, "EditorIcons"))
- ti->set_icon(2, get_icon(type, "EditorIcons"));
+ ti->set_icon(2, EditorNode::get_singleton()->get_class_icon(type, ""));
}
//player->add_resource("default",resource);
diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp
index aac58507f2..b3adf19a64 100644
--- a/editor/plugins/root_motion_editor_plugin.cpp
+++ b/editor/plugins/root_motion_editor_plugin.cpp
@@ -109,11 +109,7 @@ void EditorPropertyRootMotion::_node_assign() {
if (base->has_node(accum)) {
Node *node = base->get_node(accum);
- if (has_icon(node->get_class(), "EditorIcons")) {
- ti->set_icon(0, get_icon(node->get_class(), "EditorIcons"));
- } else {
- ti->set_icon(0, get_icon("Node", "EditorIcons"));
- }
+ ti->set_icon(0, EditorNode::get_singleton()->get_object_icon(node, "Node"));
}
} else {
@@ -126,7 +122,7 @@ void EditorPropertyRootMotion::_node_assign() {
node = base->get_node(accum);
}
if (!node)
- continue; //no node, cant edit
+ continue; //no node, can't edit
if (path.get_subname_count()) {
@@ -235,14 +231,7 @@ void EditorPropertyRootMotion::update_property() {
ERR_FAIL_COND(!target_node);
assign->set_text(target_node->get_name());
-
- Ref<Texture> icon;
- if (has_icon(target_node->get_class(), "EditorIcons"))
- icon = get_icon(target_node->get_class(), "EditorIcons");
- else
- icon = get_icon("Node", "EditorIcons");
-
- assign->set_icon(icon);
+ assign->set_icon(EditorNode::get_singleton()->get_object_icon(target_node, "Node"));
}
void EditorPropertyRootMotion::setup(const NodePath &p_base_hint) {
@@ -314,7 +303,7 @@ bool EditorInspectorRootMotionPlugin::parse_property(Object *p_object, Variant::
return true;
}
- return false; //can be overriden, although it will most likely be last anyway
+ return false; //can be overridden, although it will most likely be last anyway
}
void EditorInspectorRootMotionPlugin::parse_end() {
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index f25ca4786e..c8e7bfb74b 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -59,25 +59,10 @@ void ScriptEditorBase::_bind_methods() {
ADD_SIGNAL(MethodInfo("search_in_files_requested", PropertyInfo(Variant::STRING, "text")));
}
-static bool _can_open_in_editor(Script *p_script) {
-
+static bool _is_built_in_script(Script *p_script) {
String path = p_script->get_path();
- if (path.find("::") != -1) {
- //refuse handling this if it can't be edited
-
- bool valid = false;
- for (int i = 0; i < EditorNode::get_singleton()->get_editor_data().get_edited_scene_count(); i++) {
- if (path.begins_with(EditorNode::get_singleton()->get_editor_data().get_scene_path(i))) {
- valid = true;
- break;
- }
- }
-
- return valid;
- }
-
- return true;
+ return path.find("::") != -1;
}
class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache {
@@ -812,7 +797,7 @@ bool ScriptEditor::_test_script_times_on_disk(RES p_for_script) {
if (se) {
RES edited_res = se->get_edited_resource();
- if (edited_res.is_valid() && p_for_script != edited_res)
+ if (p_for_script.is_valid() && edited_res.is_valid() && p_for_script != edited_res)
continue;
if (edited_res->get_path() == "" || edited_res->get_path().find("local://") != -1 || edited_res->get_path().find("::") != -1)
@@ -2736,7 +2721,7 @@ void ScriptEditor::set_scene_root_script(Ref<Script> p_script) {
if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor")))
return;
- if (open_dominant && p_script.is_valid() && _can_open_in_editor(p_script.ptr())) {
+ if (open_dominant && p_script.is_valid()) {
edit(p_script);
}
}
@@ -3148,7 +3133,6 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
error_dialog = memnew(AcceptDialog);
add_child(error_dialog);
- error_dialog->get_ok()->set_text(TTR("OK"));
debugger = memnew(ScriptEditorDebugger(editor));
debugger->connect("goto_script_line", this, "_goto_script_line");
@@ -3232,7 +3216,17 @@ ScriptEditor::~ScriptEditor() {
void ScriptEditorPlugin::edit(Object *p_object) {
if (Object::cast_to<Script>(p_object)) {
- script_editor->edit(Object::cast_to<Script>(p_object));
+
+ Script *p_script = Object::cast_to<Script>(p_object);
+ String scene_path = p_script->get_path().get_slice("::", 0);
+
+ if (_is_built_in_script(p_script) && !EditorNode::get_singleton()->is_scene_open(scene_path)) {
+ EditorNode::get_singleton()->load_scene(scene_path);
+
+ script_editor->call_deferred("edit", p_script);
+ } else {
+ script_editor->edit(p_script);
+ }
}
if (Object::cast_to<TextFile>(p_object)) {
@@ -3247,13 +3241,7 @@ bool ScriptEditorPlugin::handles(Object *p_object) const {
}
if (Object::cast_to<Script>(p_object)) {
-
- bool valid = _can_open_in_editor(Object::cast_to<Script>(p_object));
-
- if (!valid) { //user tried to open it by clicking
- EditorNode::get_singleton()->show_warning(TTR("Built-in scripts can only be edited when the scene they belong to is loaded"));
- }
- return valid;
+ return true;
}
return p_object->is_class("Script");
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 82c2e07940..d4ddaf274f 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -317,6 +317,7 @@ void ScriptTextEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY:
_load_theme_settings();
+ _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("script_text_editor", "syntax_highlighter", 0));
break;
}
}
@@ -1058,6 +1059,7 @@ void ScriptTextEditor::_change_syntax_highlighter(int p_idx) {
}
// highlighter_menu->set_item_checked(p_idx, true);
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
+ EditorSettings::get_singleton()->set_project_metadata("script_text_editor", "syntax_highlighter", p_idx);
}
void ScriptTextEditor::_bind_methods() {
@@ -1256,7 +1258,7 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
int to_column = tx->get_selection_to_column();
if (row < from_line || row > to_line || (row == from_line && col < from_column) || (row == to_line && col > to_column)) {
- // Right click is outside the seleted text
+ // Right click is outside the selected text
tx->deselect();
}
}
@@ -1556,7 +1558,7 @@ void ScriptTextEditor::register_editor() {
#endif
ED_SHORTCUT("script_text_editor/trim_trailing_whitespace", TTR("Trim Trailing Whitespace"), KEY_MASK_CMD | KEY_MASK_ALT | KEY_T);
ED_SHORTCUT("script_text_editor/convert_indent_to_spaces", TTR("Convert Indent To Spaces"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Y);
- ED_SHORTCUT("script_text_editor/convert_indent_to_tabs", TTR("Convert Indent To Tabs"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_X);
+ ED_SHORTCUT("script_text_editor/convert_indent_to_tabs", TTR("Convert Indent To Tabs"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_I);
ED_SHORTCUT("script_text_editor/auto_indent", TTR("Auto Indent"), KEY_MASK_CMD | KEY_I);
#ifdef OSX_ENABLED
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 5ee40dc90a..51e58b712e 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -480,7 +480,7 @@ void ShaderEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
int to_column = tx->get_selection_to_column();
if (row < from_line || row > to_line || (row == from_line && col < from_column) || (row == to_line && col > to_column)) {
- // Right click is outside the seleted text
+ // Right click is outside the selected text
tx->deselect();
}
}
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index e86424ee51..fed4362405 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -847,11 +847,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
Spatial *spat = selection_results[i].item;
- Ref<Texture> icon;
- if (spat->has_meta("_editor_icon"))
- icon = spat->get_meta("_editor_icon");
- else
- icon = get_icon(has_icon(spat->get_class(), "EditorIcons") ? spat->get_class() : String("Object"), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(spat, "Node");
String node_path = "/" + root_name + "/" + root_path.rel_path_to(spat->get_path());
@@ -3271,7 +3267,6 @@ void SpatialEditorViewport::_perform_drop_data() {
files_str += error_files[i].get_file().get_basename() + ",";
}
files_str = files_str.substr(0, files_str.length() - 1);
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error instancing scene from %s"), files_str.c_str()));
accept->popup_centered_minsize();
}
@@ -3352,7 +3347,6 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p
if (root_node) {
list.push_back(root_node);
} else {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("No parent to instance a child at."));
accept->popup_centered_minsize();
_remove_preview();
@@ -3360,7 +3354,6 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p
}
}
if (list.size() != 1) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation requires a single selected node."));
accept->popup_centered_minsize();
_remove_preview();
@@ -4425,6 +4418,8 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
void SpatialEditor::_init_indicators() {
{
+ origin_enabled = true;
+ grid_enabled = true;
indicator_mat.instance();
indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
@@ -4465,10 +4460,6 @@ void SpatialEditor::_init_indicators() {
VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << SpatialEditorViewport::GIZMO_GRID_LAYER);
VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF);
-
- origin_enabled = true;
- grid_enabled = true;
- last_grid_snap = 1;
}
{
@@ -5290,6 +5281,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_SELECT]->connect("pressed", this, "_menu_item_pressed", button_binds);
tool_button[TOOL_MODE_SELECT]->set_tooltip(TTR("Select Mode (Q)") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection"));
+ hbc_menu->add_child(memnew(VSeparator));
+
tool_button[TOOL_MODE_MOVE] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_MODE_MOVE]);
tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true);
@@ -5314,6 +5307,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_SCALE]->connect("pressed", this, "_menu_item_pressed", button_binds);
tool_button[TOOL_MODE_SCALE]->set_tooltip(TTR("Scale Mode (R)"));
+ hbc_menu->add_child(memnew(VSeparator));
+
tool_button[TOOL_MODE_LIST_SELECT] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_MODE_LIST_SELECT]);
tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true);
@@ -5334,8 +5329,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", this, "_menu_item_pressed", button_binds);
tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock the selected object (can be moved)."));
- VSeparator *vs = memnew(VSeparator);
- hbc_menu->add_child(vs);
+ hbc_menu->add_child(memnew(VSeparator));
tool_option_button[TOOL_OPT_LOCAL_COORDS] = memnew(ToolButton);
hbc_menu->add_child(tool_option_button[TOOL_OPT_LOCAL_COORDS]);
@@ -5357,8 +5351,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
sct = ED_GET_SHORTCUT("spatial_editor/snap").ptr()->get_as_text();
tool_option_button[TOOL_OPT_USE_SNAP]->set_tooltip(vformat(TTR("Snap Mode (%s)"), sct));
- vs = memnew(VSeparator);
- hbc_menu->add_child(vs);
+ hbc_menu->add_child(memnew(VSeparator));
// Drag and drop support;
preview_node = memnew(Spatial);
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 0e35ba8517..b7317cd593 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -510,7 +510,6 @@ private:
RID grid[3];
RID grid_instance[3];
bool grid_visible[3]; //currently visible
- float last_grid_snap;
bool grid_enable[3]; //should be always visible if true
bool grid_enabled;
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index 16c25f3074..4ff7046a35 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -30,6 +30,8 @@
#include "text_editor.h"
+#include "editor_node.h"
+
void TextEditor::add_syntax_highlighter(SyntaxHighlighter *p_highlighter) {
highlighters[p_highlighter->get_name()] = p_highlighter;
highlighter_menu->add_radio_check_item(p_highlighter->get_name());
@@ -64,6 +66,7 @@ void TextEditor::_change_syntax_highlighter(int p_idx) {
el = el->next();
}
set_syntax_highlighter(highlighters[highlighter_menu->get_item_text(p_idx)]);
+ EditorSettings::get_singleton()->set_project_metadata("text_editor", "syntax_highlighter", p_idx);
}
void TextEditor::_load_theme_settings() {
@@ -158,10 +161,7 @@ String TextEditor::get_name() {
Ref<Texture> TextEditor::get_icon() {
- if (get_parent_control() && get_parent_control()->has_icon(text_file->get_class(), "EditorIcons")) {
- return get_parent_control()->get_icon(text_file->get_class(), "EditorIcons");
- }
- return Ref<Texture>();
+ return EditorNode::get_singleton()->get_object_icon(text_file.operator->(), "");
}
RES TextEditor::get_edited_resource() const {
@@ -299,7 +299,7 @@ void TextEditor::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_READY:
_load_theme_settings();
- set_syntax_highlighter(NULL);
+ _change_syntax_highlighter(EditorSettings::get_singleton()->get_project_metadata("text_editor", "syntax_highlighter", 0));
break;
}
}
@@ -475,7 +475,7 @@ void TextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
int to_column = tx->get_selection_to_column();
if (row < from_line || row > to_line || (row == from_line && col < from_column) || (row == to_line && col > to_column)) {
- // Right click is outside the seleted text
+ // Right click is outside the selected text
tx->deselect();
}
}
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index cefed193ca..207078d90f 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -629,7 +629,7 @@ void VisualShaderEditor::_duplicate_nodes() {
int id = String(graph->get_child(i)->get_name()).to_int();
Ref<VisualShaderNode> node = visual_shader->get_node(type, id);
Ref<VisualShaderNodeOutput> output = node;
- if (output.is_valid()) //cant duplicate output
+ if (output.is_valid()) //can't duplicate output
continue;
if (node.is_valid()) {
nodes.push_back(id);
@@ -932,7 +932,10 @@ public:
class VisualShaderNodePluginDefaultEditor : public VBoxContainer {
GDCLASS(VisualShaderNodePluginDefaultEditor, VBoxContainer)
public:
- void _property_changed(const String &prop, const Variant &p_value) {
+ void _property_changed(const String &prop, const Variant &p_value, bool p_changing = false) {
+
+ if (p_changing)
+ return;
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
@@ -979,7 +982,7 @@ public:
}
static void _bind_methods() {
- ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed);
+ ClassDB::bind_method("_property_changed", &VisualShaderNodePluginDefaultEditor::_property_changed, DEFVAL(false));
ClassDB::bind_method("_node_changed", &VisualShaderNodePluginDefaultEditor::_node_changed);
ClassDB::bind_method("_refresh_request", &VisualShaderNodePluginDefaultEditor::_refresh_request);
}
@@ -1158,7 +1161,7 @@ bool EditorInspectorShaderModePlugin::parse_property(Object *p_object, Variant::
return true;
}
- return false; //can be overriden, although it will most likely be last anyway
+ return false; //can be overridden, although it will most likely be last anyway
}
void EditorInspectorShaderModePlugin::parse_end() {
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index aba89a87ee..fa6dce1771 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -655,16 +655,9 @@ bool ProjectExportDialog::_fill_tree(EditorFileSystemDirectory *p_dir, TreeItem
file->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
file->set_text(0, p_dir->get_file(i));
- Ref<Texture> tex;
- if (has_icon(type, editor_icons)) {
- tex = get_icon(type, editor_icons);
- } else {
- tex = get_icon("Object", editor_icons);
- }
-
String path = p_dir->get_file_path(i);
- file->set_icon(0, tex);
+ file->set_icon(0, EditorNode::get_singleton()->get_class_icon(type));
file->set_editable(0, true);
file->set_checked(0, current->has_export_file(path));
file->set_metadata(0, path);
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index f494c84efa..91ab5b4dff 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -41,7 +41,6 @@
#include "core/translation.h"
#include "core/version.h"
#include "core/version_hash.gen.h"
-#include "editor_initialize_ssl.h"
#include "editor_scale.h"
#include "editor_settings.h"
#include "editor_themes.h"
@@ -2059,8 +2058,6 @@ void ProjectListFilter::_bind_methods() {
ProjectListFilter::ProjectListFilter() {
- editor_initialize_certificates(); //for asset sharing
-
_current_filter = FILTER_NAME;
filter_option = memnew(OptionButton);
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 1baf606e7b..7a68646f40 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -1840,9 +1840,9 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
input_editor->set_column_title(0, TTR("Action"));
input_editor->set_column_title(1, TTR("Deadzone"));
input_editor->set_column_expand(1, false);
- input_editor->set_column_min_width(1, 80);
+ input_editor->set_column_min_width(1, 80 * EDSCALE);
input_editor->set_column_expand(2, false);
- input_editor->set_column_min_width(2, 50);
+ input_editor->set_column_min_width(2, 50 * EDSCALE);
input_editor->connect("item_edited", this, "_action_edited");
input_editor->connect("item_activated", this, "_action_activated");
input_editor->connect("cell_selected", this, "_action_selected");
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 1c2eedfc9c..508db2e03f 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -34,6 +34,7 @@
#include "core/io/image_loader.h"
#include "core/io/marshalls.h"
#include "core/io/resource_loader.h"
+#include "core/math/expression.h"
#include "core/os/input.h"
#include "core/os/keyboard.h"
#include "core/pair.h"
@@ -1531,21 +1532,24 @@ void CustomPropertyEditor::_modified(String p_string) {
updating = true;
switch (type) {
case Variant::INT: {
-
- if (evaluator)
- v = evaluator->eval(value_editor[0]->get_text());
- else
+ String text = value_editor[0]->get_text();
+ Ref<Expression> expr;
+ expr.instance();
+ Error err = expr->parse(text);
+ if (err != OK) {
v = value_editor[0]->get_text().to_int();
+ return;
+ } else {
+ v = expr->execute(Array(), NULL, false);
+ }
emit_signal("variant_changed");
} break;
case Variant::REAL: {
if (hint != PROPERTY_HINT_EXP_EASING) {
- if (evaluator)
- v = evaluator->eval(value_editor[0]->get_text());
- else
- v = value_editor[0]->get_text().to_double();
+ String text = value_editor[0]->get_text();
+ v = _parse_real_expression(text);
emit_signal("variant_changed");
}
@@ -1558,13 +1562,8 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::VECTOR2: {
Vector2 vec;
- if (evaluator) {
- vec.x = evaluator->eval(value_editor[0]->get_text());
- vec.y = evaluator->eval(value_editor[1]->get_text());
- } else {
- vec.x = value_editor[0]->get_text().to_double();
- vec.y = value_editor[1]->get_text().to_double();
- }
+ vec.x = _parse_real_expression(value_editor[0]->get_text());
+ vec.y = _parse_real_expression(value_editor[1]->get_text());
v = vec;
_emit_changed_whole_or_field();
@@ -1572,17 +1571,11 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::RECT2: {
Rect2 r2;
- if (evaluator) {
- r2.position.x = evaluator->eval(value_editor[0]->get_text());
- r2.position.y = evaluator->eval(value_editor[1]->get_text());
- r2.size.x = evaluator->eval(value_editor[2]->get_text());
- r2.size.y = evaluator->eval(value_editor[3]->get_text());
- } else {
- r2.position.x = value_editor[0]->get_text().to_double();
- r2.position.y = value_editor[1]->get_text().to_double();
- r2.size.x = value_editor[2]->get_text().to_double();
- r2.size.y = value_editor[3]->get_text().to_double();
- }
+
+ r2.position.x = _parse_real_expression(value_editor[0]->get_text());
+ r2.position.y = _parse_real_expression(value_editor[1]->get_text());
+ r2.size.x = _parse_real_expression(value_editor[2]->get_text());
+ r2.size.y = _parse_real_expression(value_editor[3]->get_text());
v = r2;
_emit_changed_whole_or_field();
@@ -1591,15 +1584,9 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::VECTOR3: {
Vector3 vec;
- if (evaluator) {
- vec.x = evaluator->eval(value_editor[0]->get_text());
- vec.y = evaluator->eval(value_editor[1]->get_text());
- vec.z = evaluator->eval(value_editor[2]->get_text());
- } else {
- vec.x = value_editor[0]->get_text().to_double();
- vec.y = value_editor[1]->get_text().to_double();
- vec.z = value_editor[2]->get_text().to_double();
- }
+ vec.x = _parse_real_expression(value_editor[0]->get_text());
+ vec.y = _parse_real_expression(value_editor[1]->get_text());
+ vec.z = _parse_real_expression(value_editor[2]->get_text());
v = vec;
_emit_changed_whole_or_field();
@@ -1607,17 +1594,10 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::PLANE: {
Plane pl;
- if (evaluator) {
- pl.normal.x = evaluator->eval(value_editor[0]->get_text());
- pl.normal.y = evaluator->eval(value_editor[1]->get_text());
- pl.normal.z = evaluator->eval(value_editor[2]->get_text());
- pl.d = evaluator->eval(value_editor[3]->get_text());
- } else {
- pl.normal.x = value_editor[0]->get_text().to_double();
- pl.normal.y = value_editor[1]->get_text().to_double();
- pl.normal.z = value_editor[2]->get_text().to_double();
- pl.d = value_editor[3]->get_text().to_double();
- }
+ pl.normal.x = _parse_real_expression(value_editor[0]->get_text());
+ pl.normal.y = _parse_real_expression(value_editor[1]->get_text());
+ pl.normal.z = _parse_real_expression(value_editor[2]->get_text());
+ pl.d = _parse_real_expression(value_editor[3]->get_text());
v = pl;
_emit_changed_whole_or_field();
@@ -1625,17 +1605,10 @@ void CustomPropertyEditor::_modified(String p_string) {
case Variant::QUAT: {
Quat q;
- if (evaluator) {
- q.x = evaluator->eval(value_editor[0]->get_text());
- q.y = evaluator->eval(value_editor[1]->get_text());
- q.z = evaluator->eval(value_editor[2]->get_text());
- q.w = evaluator->eval(value_editor[3]->get_text());
- } else {
- q.x = value_editor[0]->get_text().to_double();
- q.y = value_editor[1]->get_text().to_double();
- q.z = value_editor[2]->get_text().to_double();
- q.w = value_editor[3]->get_text().to_double();
- }
+ q.x = _parse_real_expression(value_editor[0]->get_text());
+ q.y = _parse_real_expression(value_editor[1]->get_text());
+ q.z = _parse_real_expression(value_editor[2]->get_text());
+ q.w = _parse_real_expression(value_editor[3]->get_text());
v = q;
_emit_changed_whole_or_field();
@@ -1645,21 +1618,12 @@ void CustomPropertyEditor::_modified(String p_string) {
Vector3 pos;
Vector3 size;
- if (evaluator) {
- pos.x = evaluator->eval(value_editor[0]->get_text());
- pos.y = evaluator->eval(value_editor[1]->get_text());
- pos.z = evaluator->eval(value_editor[2]->get_text());
- size.x = evaluator->eval(value_editor[3]->get_text());
- size.y = evaluator->eval(value_editor[4]->get_text());
- size.z = evaluator->eval(value_editor[5]->get_text());
- } else {
- pos.x = value_editor[0]->get_text().to_double();
- pos.y = value_editor[1]->get_text().to_double();
- pos.z = value_editor[2]->get_text().to_double();
- size.x = value_editor[3]->get_text().to_double();
- size.y = value_editor[4]->get_text().to_double();
- size.z = value_editor[5]->get_text().to_double();
- }
+ pos.x = _parse_real_expression(value_editor[0]->get_text());
+ pos.y = _parse_real_expression(value_editor[1]->get_text());
+ pos.z = _parse_real_expression(value_editor[2]->get_text());
+ size.x = _parse_real_expression(value_editor[3]->get_text());
+ size.y = _parse_real_expression(value_editor[4]->get_text());
+ size.z = _parse_real_expression(value_editor[5]->get_text());
v = AABB(pos, size);
_emit_changed_whole_or_field();
@@ -1668,11 +1632,7 @@ void CustomPropertyEditor::_modified(String p_string) {
Transform2D m;
for (int i = 0; i < 6; i++) {
- if (evaluator) {
- m.elements[i / 2][i % 2] = evaluator->eval(value_editor[i]->get_text());
- } else {
- m.elements[i / 2][i % 2] = value_editor[i]->get_text().to_double();
- }
+ m.elements[i / 2][i % 2] = _parse_real_expression(value_editor[i]->get_text());
}
v = m;
@@ -1683,12 +1643,7 @@ void CustomPropertyEditor::_modified(String p_string) {
Basis m;
for (int i = 0; i < 9; i++) {
-
- if (evaluator) {
- m.elements[i / 3][i % 3] = evaluator->eval(value_editor[i]->get_text());
- } else {
- m.elements[i / 3][i % 3] = value_editor[i]->get_text().to_double();
- }
+ m.elements[i / 3][i % 3] = _parse_real_expression(value_editor[i]->get_text());
}
v = m;
@@ -1699,25 +1654,14 @@ void CustomPropertyEditor::_modified(String p_string) {
Basis basis;
for (int i = 0; i < 9; i++) {
-
- if (evaluator) {
- basis.elements[i / 3][i % 3] = evaluator->eval(value_editor[(i / 3) * 4 + i % 3]->get_text());
- } else {
- basis.elements[i / 3][i % 3] = value_editor[(i / 3) * 4 + i % 3]->get_text().to_double();
- }
+ basis.elements[i / 3][i % 3] = _parse_real_expression(value_editor[(i / 3) * 4 + i % 3]->get_text());
}
Vector3 origin;
- if (evaluator) {
- origin.x = evaluator->eval(value_editor[3]->get_text());
- origin.y = evaluator->eval(value_editor[7]->get_text());
- origin.z = evaluator->eval(value_editor[11]->get_text());
- } else {
- origin.x = value_editor[3]->get_text().to_double();
- origin.y = value_editor[7]->get_text().to_double();
- origin.z = value_editor[11]->get_text().to_double();
- }
+ origin.x = _parse_real_expression(value_editor[3]->get_text());
+ origin.y = _parse_real_expression(value_editor[7]->get_text());
+ origin.z = _parse_real_expression(value_editor[11]->get_text());
v = Transform(basis, origin);
_emit_changed_whole_or_field();
@@ -1759,6 +1703,19 @@ void CustomPropertyEditor::_modified(String p_string) {
updating = false;
}
+real_t CustomPropertyEditor::_parse_real_expression(String text) {
+ Ref<Expression> expr;
+ expr.instance();
+ Error err = expr->parse(text);
+ real_t out;
+ if (err != OK) {
+ out = value_editor[0]->get_text().to_double();
+ } else {
+ out = expr->execute(Array(), NULL, false);
+ }
+ return out;
+}
+
void CustomPropertyEditor::_emit_changed_whole_or_field() {
if (!Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
diff --git a/editor/property_editor.h b/editor/property_editor.h
index 7d7ab912ea..ee3a56d857 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -135,6 +135,9 @@ class CustomPropertyEditor : public Popup {
void _text_edit_changed();
void _file_selected(String p_file);
void _modified(String p_string);
+
+ real_t _parse_real_expression(String text);
+
void _range_modified(double p_value);
void _focus_enter();
void _focus_exit();
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index c9eba33f35..9042bdc7c1 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -31,6 +31,7 @@
#include "property_selector.h"
#include "core/os/keyboard.h"
+#include "editor/editor_node.h"
#include "editor_scale.h"
void PropertySelector::_text_changed(const String &p_newtext) {
@@ -161,10 +162,8 @@ void PropertySelector::_update_search() {
Ref<Texture> icon;
if (E->get().name == "Script Variables") {
icon = get_icon("Script", "EditorIcons");
- } else if (has_icon(E->get().name, "EditorIcons")) {
- icon = get_icon(E->get().name, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(E->get().name);
}
category->set_icon(0, icon);
continue;
@@ -241,10 +240,8 @@ void PropertySelector::_update_search() {
if (E->get().name == "*Script Methods") {
icon = get_icon("Script", "EditorIcons");
script_methods = true;
- } else if (has_icon(rep, "EditorIcons")) {
- icon = get_icon(rep, "EditorIcons");
} else {
- icon = get_icon("Object", "EditorIcons");
+ icon = EditorNode::get_singleton()->get_class_icon(rep);
}
category->set_icon(0, icon);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 9461f39aeb..ff6832177e 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -119,7 +119,6 @@ void SceneTreeDock::instance(const String &p_file) {
if (!edited_scene) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("No parent to instance a child at."));
accept->popup_centered_minsize();
return;
@@ -142,7 +141,6 @@ void SceneTreeDock::instance_scenes(const Vector<String> &p_files, Node *p_paren
if (!parent || !edited_scene) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("No parent to instance the scenes at."));
accept->popup_centered_minsize();
return;
@@ -164,7 +162,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
Ref<PackedScene> sdata = ResourceLoader::load(p_files[i]);
if (!sdata.is_valid()) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error loading scene from %s"), p_files[i]));
accept->popup_centered_minsize();
error = true;
@@ -174,7 +171,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
if (!instanced_scene) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_files[i]));
accept->popup_centered_minsize();
error = true;
@@ -185,7 +181,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
if (_cyclical_dependency_exists(edited_scene->get_filename(), instanced_scene)) {
- accept->get_ok()->set_text(TTR("Ok"));
accept->set_text(vformat(TTR("Cannot instance the scene '%s' because the current scene exists within one of its nodes."), p_files[i]));
accept->popup_centered_minsize();
error = true;
@@ -233,7 +228,6 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String> &p_files, Node
void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base) {
Ref<PackedScene> sdata = ResourceLoader::load(p_file);
if (!sdata.is_valid()) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error loading scene from %s"), p_file));
accept->popup_centered_minsize();
return;
@@ -241,7 +235,6 @@ void SceneTreeDock::_replace_with_branch_scene(const String &p_file, Node *base)
Node *instanced_scene = sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE);
if (!instanced_scene) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(vformat(TTR("Error instancing scene from %s"), p_file));
accept->popup_centered_minsize();
return;
@@ -399,11 +392,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
const RefPtr empty;
editor_data->get_undo_redo().add_do_method(E->get(), "set_script", empty);
editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing);
-
- if (E->get()->has_meta("_editor_icon")) {
- editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", E->get()->get_meta("_editor_icon"));
- }
}
}
@@ -421,7 +409,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (scene_tree->get_selected() == edited_scene) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation can't be done on the tree root."));
accept->popup_centered_minsize();
break;
@@ -482,7 +469,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (editor_selection->is_selected(edited_scene)) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation can't be done on the tree root."));
accept->popup_centered_minsize();
break;
@@ -552,7 +538,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (editor_selection->is_selected(edited_scene)) {
current_option = -1;
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation can't be done on the tree root."));
accept->popup_centered_minsize();
break;
@@ -639,7 +624,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
Node *scene = editor_data->get_edited_scene_root();
if (!scene) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation can't be done without a scene."));
accept->popup_centered_minsize();
break;
@@ -648,7 +632,6 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
List<Node *> selection = editor_selection->get_selected_node_list();
if (selection.size() != 1) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation requires a single selected node."));
accept->popup_centered_minsize();
break;
@@ -657,14 +640,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
Node *tocopy = selection.front()->get();
if (tocopy == scene) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Can not perform with the root node."));
accept->popup_centered_minsize();
break;
}
if (tocopy != editor_data->get_edited_scene_root() && tocopy->get_filename() != "") {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation can't be done on instanced scenes."));
accept->popup_centered_minsize();
break;
@@ -849,6 +830,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
editor_data->get_undo_redo().add_undo_method(editor, "set_edited_scene", (Object *)NULL);
editor_data->get_undo_redo().commit_action();
+ editor->edit_node(new_node);
+
} break;
default: {
@@ -1309,7 +1292,6 @@ bool SceneTreeDock::_validate_no_foreign() {
if (E->get() != edited_scene && E->get()->get_owner() != edited_scene) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Can't operate on nodes from a foreign scene!"));
accept->popup_centered_minsize();
return false;
@@ -1317,7 +1299,6 @@ bool SceneTreeDock::_validate_no_foreign() {
if (edited_scene->get_scene_inherited_state().is_valid() && edited_scene->get_scene_inherited_state()->find_node_by_path(edited_scene->get_path_to(E->get())) >= 0) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Can't operate on nodes the current scene inherits from!"));
accept->popup_centered_minsize();
return false;
@@ -1501,19 +1482,6 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) {
Ref<Script> existing = E->get()->get_script();
editor_data->get_undo_redo().add_do_method(E->get(), "set_script", p_script.get_ref_ptr());
editor_data->get_undo_redo().add_undo_method(E->get(), "set_script", existing);
-
- String icon_path;
- String name = p_script->get_language()->get_global_class_name(p_script->get_path(), NULL, &icon_path);
- if (ScriptServer::is_global_class(name)) {
- RES icon = ResourceLoader::load(icon_path);
- editor_data->get_undo_redo().add_do_method(E->get(), "set_meta", "_editor_icon", icon);
- String existing_name = existing.is_valid() ? existing->get_language()->get_global_class_name(existing->get_path()) : String();
- if (existing.is_null() || !ScriptServer::is_global_class(existing_name)) {
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", get_icon(E->get()->get_class(), "EditorIcons"));
- } else {
- editor_data->get_undo_redo().add_undo_method(E->get(), "set_meta", "_editor_icon", editor_data->script_class_get_icon_path(existing_name));
- }
- }
}
editor_data->get_undo_redo().commit_action();
@@ -1810,14 +1778,12 @@ void SceneTreeDock::_new_scene_from(String p_file) {
List<Node *> selection = editor_selection->get_selected_node_list();
if (selection.size() != 1) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("This operation requires a single selected node."));
accept->popup_centered_minsize();
return;
}
if (EditorNode::get_singleton()->is_scene_open(p_file)) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Can't overwrite scene that is still open!"));
accept->popup_centered_minsize();
return;
@@ -1835,7 +1801,6 @@ void SceneTreeDock::_new_scene_from(String p_file) {
memdelete(copy);
if (err != OK) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Couldn't save new scene. Likely dependencies (instances) couldn't be satisfied."));
accept->popup_centered_minsize();
return;
@@ -1847,14 +1812,12 @@ void SceneTreeDock::_new_scene_from(String p_file) {
err = ResourceSaver::save(p_file, sdata, flg);
if (err != OK) {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Error saving scene."));
accept->popup_centered_minsize();
return;
}
_replace_with_branch_scene(p_file, base);
} else {
- accept->get_ok()->set_text(TTR("OK"));
accept->set_text(TTR("Error duplicating scene to save it."));
accept->popup_centered_minsize();
return;
@@ -2029,12 +1992,7 @@ void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) {
if (!obj)
continue;
- Ref<Texture> icon;
-
- if (has_icon(obj->get_class(), "EditorIcons"))
- icon = get_icon(obj->get_class(), "EditorIcons");
- else
- icon = get_icon("Object", "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(obj);
if (menu->get_item_count() == 0) {
menu->add_submenu_item(TTR("Sub-Resources"), "Sub-Resources");
@@ -2264,7 +2222,7 @@ void SceneTreeDock::_update_create_root_dialog() {
String name = l.get_slicec(' ', 0);
if (ScriptServer::is_global_class(name))
name = ScriptServer::get_global_class_base(name);
- button->set_icon(get_icon(name, "EditorIcons"));
+ button->set_icon(EditorNode::get_singleton()->get_class_icon(name));
button->connect("pressed", this, "_favorite_root_selected", make_binds(l));
}
}
@@ -2445,7 +2403,6 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
add_child(create_dialog);
create_dialog->connect("create", this, "_create");
create_dialog->connect("favorites_updated", this, "_update_create_root_dialog");
- EditorFileSystem::get_singleton()->connect("script_classes_updated", create_dialog, "_save_and_update_favorite_list");
rename_dialog = memnew(RenameDialog(scene_tree, &editor_data->get_undo_redo()));
add_child(rename_dialog);
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index a45773003a..07670bb420 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -186,11 +186,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
item->set_collapsed(true);
}
- Ref<Texture> icon;
- if (p_node->has_meta("_editor_icon"))
- icon = p_node->get_meta("_editor_icon");
- else
- icon = get_icon((has_icon(p_node->get_class(), "EditorIcons") ? p_node->get_class() : String("Object")), "EditorIcons");
+ Ref<Texture> icon = EditorNode::get_singleton()->get_object_icon(p_node, "Node");
item->set_icon(0, icon);
item->set_metadata(0, p_node->get_path());
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index be255ba4aa..d8de775d36 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -164,7 +164,6 @@ void ScriptCreateDialog::_create_new() {
if (script_template != "") {
scr = ResourceLoader::load(script_template);
if (scr.is_null()) {
- alert->get_ok()->set_text(TTR("OK"));
alert->set_text(vformat(TTR("Error loading template '%s'"), script_template));
alert->popup_centered();
return;
@@ -201,7 +200,6 @@ void ScriptCreateDialog::_load_exist() {
String path = file_path->get_text();
RES p_script = ResourceLoader::load(path, "Script");
if (p_script.is_null()) {
- alert->get_ok()->set_text(TTR("OK"));
alert->set_text(vformat(TTR("Error loading script from %s"), path));
alert->popup_centered();
return;
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index c07220d42c..cc477314e9 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -428,8 +428,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
ObjectID id = ObjectID(p_data[i + 3]);
it->set_text(0, p_data[i + 1]);
- if (has_icon(p_data[i + 2], "EditorIcons"))
- it->set_icon(0, get_icon(p_data[i + 2], "EditorIcons"));
+ Ref<Texture> icon = EditorNode::get_singleton()->get_class_icon(p_data[i + 2], "");
+ if (icon.is_valid())
+ it->set_icon(0, icon);
it->set_metadata(0, id);
if (id == inspected_object_id) {
@@ -491,17 +492,19 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
pinfo.usage = PropertyUsageFlags(int(prop[4]));
Variant var = prop[5];
- String hint_string = pinfo.hint_string;
- if (hint_string.begins_with("RES:") && hint_string != "RES:") {
- String path = hint_string.substr(4, hint_string.length());
- var = ResourceLoader::load(path);
- }
-
if (is_new_object) {
//don't update.. it's the same, instead refresh
debugObj->prop_list.push_back(pinfo);
}
+ if (var.get_type() == Variant::STRING) {
+ String str = var;
+ var = str.substr(4, str.length());
+
+ if (str.begins_with("PATH"))
+ var = ResourceLoader::load(var);
+ }
+
debugObj->prop_values[pinfo.name] = var;
}
@@ -572,9 +575,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");
@@ -595,9 +596,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");
@@ -618,9 +617,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
PropertyHint h = PROPERTY_HINT_NONE;
String hs = String();
- if (n.begins_with("*")) {
-
- n = n.substr(1, n.length());
+ if (v.get_type() == Variant::OBJECT) {
h = PROPERTY_HINT_OBJECT_ID;
String s = v;
s = s.replace("[", "");
@@ -1717,6 +1714,32 @@ void ScriptEditorDebugger::_error_selected() {
emit_signal("goto_script_line", s, int(meta[1]) - 1);
}
+void ScriptEditorDebugger::_expand_errors_list() {
+
+ TreeItem *root = error_tree->get_root();
+ if (!root)
+ return;
+
+ TreeItem *item = root->get_children();
+ while (item) {
+ item->set_collapsed(false);
+ item = item->get_next();
+ }
+}
+
+void ScriptEditorDebugger::_collapse_errors_list() {
+
+ TreeItem *root = error_tree->get_root();
+ if (!root)
+ return;
+
+ TreeItem *item = root->get_children();
+ while (item) {
+ item->set_collapsed(true);
+ item = item->get_next();
+ }
+}
+
void ScriptEditorDebugger::set_hide_on_stop(bool p_hide) {
hide_on_stop = p_hide;
@@ -1861,6 +1884,8 @@ void ScriptEditorDebugger::_bind_methods() {
ClassDB::bind_method(D_METHOD("_error_selected"), &ScriptEditorDebugger::_error_selected);
ClassDB::bind_method(D_METHOD("_error_activated"), &ScriptEditorDebugger::_error_activated);
+ ClassDB::bind_method(D_METHOD("_expand_errors_list"), &ScriptEditorDebugger::_expand_errors_list);
+ ClassDB::bind_method(D_METHOD("_collapse_errors_list"), &ScriptEditorDebugger::_collapse_errors_list);
ClassDB::bind_method(D_METHOD("_profiler_activate"), &ScriptEditorDebugger::_profiler_activate);
ClassDB::bind_method(D_METHOD("_profiler_seeked"), &ScriptEditorDebugger::_profiler_seeked);
ClassDB::bind_method(D_METHOD("_clear_errors_list"), &ScriptEditorDebugger::_clear_errors_list);
@@ -1999,8 +2024,31 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
}
{ //errors
+ VBoxContainer *errvb = memnew(VBoxContainer);
+ errvb->set_name(TTR("Errors"));
+
HBoxContainer *errhb = memnew(HBoxContainer);
- errhb->set_name(TTR("Errors"));
+ errvb->add_child(errhb);
+
+ Button *expand_all = memnew(Button);
+ expand_all->set_text(TTR("Expand All"));
+ expand_all->connect("pressed", this, "_expand_errors_list");
+ errhb->add_child(expand_all);
+
+ Button *collapse_all = memnew(Button);
+ collapse_all->set_text(TTR("Collapse All"));
+ collapse_all->connect("pressed", this, "_collapse_errors_list");
+ errhb->add_child(collapse_all);
+
+ Control *space = memnew(Control);
+ space->set_h_size_flags(SIZE_EXPAND_FILL);
+ errhb->add_child(space);
+
+ clearbutton = memnew(Button);
+ clearbutton->set_text(TTR("Clear"));
+ clearbutton->set_h_size_flags(0);
+ clearbutton->connect("pressed", this, "_clear_errors_list");
+ errhb->add_child(clearbutton);
error_tree = memnew(Tree);
error_tree->set_columns(2);
@@ -2012,22 +2060,16 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor) {
error_tree->set_select_mode(Tree::SELECT_ROW);
error_tree->set_hide_root(true);
- error_tree->set_h_size_flags(SIZE_EXPAND_FILL);
+ error_tree->set_v_size_flags(SIZE_EXPAND_FILL);
error_tree->set_allow_rmb_select(true);
error_tree->connect("item_rmb_selected", this, "_error_tree_item_rmb_selected");
- errhb->add_child(error_tree);
+ errvb->add_child(error_tree);
item_menu = memnew(PopupMenu);
item_menu->connect("id_pressed", this, "_item_menu_id_pressed");
error_tree->add_child(item_menu);
- clearbutton = memnew(Button);
- clearbutton->set_text(TTR("Clear"));
- clearbutton->set_v_size_flags(0);
- clearbutton->connect("pressed", this, "_clear_errors_list");
- errhb->add_child(clearbutton);
-
- tabs->add_child(errhb);
+ tabs->add_child(errvb);
}
{ // remote scene tree
diff --git a/editor/script_editor_debugger.h b/editor/script_editor_debugger.h
index 017619e56f..cebf6d785e 100644
--- a/editor/script_editor_debugger.h
+++ b/editor/script_editor_debugger.h
@@ -181,6 +181,9 @@ class ScriptEditorDebugger : public Control {
void _error_activated();
void _error_selected();
+ void _expand_errors_list();
+ void _collapse_errors_list();
+
void _profiler_activate(bool p_enable);
void _profiler_seeked();
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 97cdd43fee..fe384da75b 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -56,11 +56,7 @@ void EditorSettingsDialog::_settings_property_edited(const String &p_name) {
String full_name = inspector->get_full_item_path(p_name);
- // Small usability workaround to update the text color settings when the
- // color theme is changed
- if (full_name == "text_editor/theme/color_theme") {
- inspector->get_inspector()->update_tree();
- } else if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast") {
+ if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast") {
EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom"); // set preset to Custom
} else if (full_name.begins_with("text_editor/highlighting")) {
EditorSettings::get_singleton()->set_manually("text_editor/theme/color_theme", "Custom");
diff --git a/editor/translations/extract.py b/editor/translations/extract.py
index 0dee1819dd..ebb032fd6f 100755
--- a/editor/translations/extract.py
+++ b/editor/translations/extract.py
@@ -88,7 +88,7 @@ def process_file(f, fname):
unique_str.append(msg)
unique_loc[msg] = [location]
elif (not location in unique_loc[msg]):
- # Add additional location to previous occurence too
+ # Add additional location to previous occurrence too
msg_pos = main_po.find('\nmsgid "' + msg + '"')
if (msg_pos == -1):
print("Someone apparently thought writing Python was as easy as GDScript. Ping Akien.")