diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/connections_dialog.h | 7 | ||||
-rw-r--r-- | editor/debugger/editor_performance_profiler.cpp | 5 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 5 | ||||
-rw-r--r-- | editor/editor_node.cpp | 1 | ||||
-rw-r--r-- | editor/editor_property_name_processor.cpp | 5 | ||||
-rw-r--r-- | editor/project_manager.h | 60 | ||||
-rwxr-xr-x | editor/translations/extract.py | 9 |
7 files changed, 55 insertions, 37 deletions
diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index a075ff0c55..58c584b8b2 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -93,8 +93,11 @@ public: if (unbinds > 0) { return Callable(target, method).unbind(unbinds); } else if (!binds.is_empty()) { - const Variant *args = binds.ptr(); - return Callable(target, method).bind(&args, binds.size()); + const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * binds.size()); + for (int i = 0; i < binds.size(); i++) { + argptrs[i] = &binds[i]; + } + return Callable(target, method).bind(argptrs, binds.size()); } else { return Callable(target, method); } diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 56d1e7cee9..c821561ca6 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -30,6 +30,7 @@ #include "editor_performance_profiler.h" +#include "editor/editor_property_name_processor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "main/performance.h" @@ -386,8 +387,8 @@ EditorPerformanceProfiler::EditorPerformanceProfiler() { monitor_draw->add_child(info_message); for (int i = 0; i < Performance::MONITOR_MAX; i++) { - String base = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)).get_slicec('/', 0).capitalize(); - String name = Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)).get_slicec('/', 1).capitalize(); + String base = EditorPropertyNameProcessor::get_singleton()->process_name(Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)).get_slicec('/', 0), EditorPropertyNameProcessor::STYLE_CAPITALIZED); + String name = EditorPropertyNameProcessor::get_singleton()->process_name(Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)).get_slicec('/', 1), EditorPropertyNameProcessor::STYLE_CAPITALIZED); monitors.insert(Performance::get_singleton()->get_monitor_name(Performance::Monitor(i)), Monitor(name, base, i, Performance::get_singleton()->get_monitor_type(Performance::Monitor(i)), nullptr)); } diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 92345f024c..1e8753acc0 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -44,6 +44,7 @@ #include "editor/editor_file_dialog.h" #include "editor/editor_log.h" #include "editor/editor_node.h" +#include "editor/editor_property_name_processor.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/plugins/canvas_item_editor_plugin.h" @@ -647,7 +648,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da const ServersDebugger::ServerInfo &srv = frame.servers[i]; EditorProfiler::Metric::Category c; const String name = srv.name; - c.name = name.capitalize(); + c.name = EditorPropertyNameProcessor::get_singleton()->process_name(name, EditorPropertyNameProcessor::STYLE_CAPITALIZED); c.items.resize(srv.functions.size()); c.total_time = 0; c.signature = "categ::" + name; @@ -659,7 +660,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da item.self = srv.functions[j].time; item.total = item.self; item.signature = "categ::" + name + "::" + item.name; - item.name = item.name.capitalize(); + item.name = EditorPropertyNameProcessor::get_singleton()->process_name(item.name, EditorPropertyNameProcessor::STYLE_CAPITALIZED); c.total_time += item.total; c.items.write[j] = item; } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d386642ca3..25e3bc8d6a 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5839,6 +5839,7 @@ EditorNode::EditorNode() { EditorPropertyNameProcessor *epnp = memnew(EditorPropertyNameProcessor); add_child(epnp); + PortableCompressedTexture2D::set_keep_all_compressed_buffers(true); Input::get_singleton()->set_use_accumulated_input(true); Resource::_get_local_scene_func = _resource_get_edited_scene; diff --git a/editor/editor_property_name_processor.cpp b/editor/editor_property_name_processor.cpp index af4ae3e576..5e6c35806c 100644 --- a/editor/editor_property_name_processor.cpp +++ b/editor/editor_property_name_processor.cpp @@ -123,6 +123,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["dof"] = "DoF"; capitalize_string_remaps["dpi"] = "DPI"; capitalize_string_remaps["dtls"] = "DTLS"; + capitalize_string_remaps["erp"] = "ERP"; capitalize_string_remaps["etc"] = "ETC"; capitalize_string_remaps["etc2"] = "ETC2"; capitalize_string_remaps["fbx"] = "FBX"; @@ -140,10 +141,12 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["gles3"] = "GLES3"; capitalize_string_remaps["gpu"] = "GPU"; capitalize_string_remaps["gui"] = "GUI"; + capitalize_string_remaps["guid"] = "GUID"; capitalize_string_remaps["hdr"] = "HDR"; capitalize_string_remaps["hidpi"] = "hiDPI"; capitalize_string_remaps["hipass"] = "High-pass"; capitalize_string_remaps["hsv"] = "HSV"; + capitalize_string_remaps["html"] = "HTML"; capitalize_string_remaps["http"] = "HTTP"; capitalize_string_remaps["id"] = "ID"; capitalize_string_remaps["igd"] = "IGD"; @@ -157,6 +160,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["iphone"] = "iPhone"; capitalize_string_remaps["ipv6"] = "IPv6"; capitalize_string_remaps["ir"] = "IR"; + capitalize_string_remaps["itunes"] = "iTunes"; capitalize_string_remaps["jit"] = "JIT"; capitalize_string_remaps["k1"] = "K1"; capitalize_string_remaps["k2"] = "K2"; @@ -205,6 +209,7 @@ EditorPropertyNameProcessor::EditorPropertyNameProcessor() { capitalize_string_remaps["url"] = "URL"; capitalize_string_remaps["urls"] = "URLs"; capitalize_string_remaps["us"] = String::utf8("(µs)"); // Unit. + capitalize_string_remaps["usb"] = "USB"; capitalize_string_remaps["usec"] = String::utf8("(µsec)"); // Unit. capitalize_string_remaps["uuid"] = "UUID"; capitalize_string_remaps["uv"] = "UV"; diff --git a/editor/project_manager.h b/editor/project_manager.h index 2965dc7d2e..4f053793fd 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -55,46 +55,46 @@ class ProjectManager : public Control { static ProjectManager *singleton; - TabContainer *tabs; + TabContainer *tabs = nullptr; - ProjectList *_project_list; + ProjectList *_project_list = nullptr; - LineEdit *search_box; - Label *loading_label; - OptionButton *filter_option; + LineEdit *search_box = nullptr; + Label *loading_label = nullptr; + OptionButton *filter_option = nullptr; - Button *run_btn; - Button *open_btn; - Button *rename_btn; - Button *erase_btn; - Button *erase_missing_btn; - Button *about_btn; + Button *run_btn = nullptr; + Button *open_btn = nullptr; + Button *rename_btn = nullptr; + Button *erase_btn = nullptr; + Button *erase_missing_btn = nullptr; + Button *about_btn = nullptr; - EditorAssetLibrary *asset_library; + EditorAssetLibrary *asset_library = nullptr; - EditorFileDialog *scan_dir; - ConfirmationDialog *language_restart_ask; + EditorFileDialog *scan_dir = nullptr; + ConfirmationDialog *language_restart_ask = nullptr; - ConfirmationDialog *erase_ask; - Label *erase_ask_label; - CheckBox *delete_project_contents; + ConfirmationDialog *erase_ask = nullptr; + Label *erase_ask_label = nullptr; + CheckBox *delete_project_contents = nullptr; - ConfirmationDialog *erase_missing_ask; - ConfirmationDialog *multi_open_ask; - ConfirmationDialog *multi_run_ask; - ConfirmationDialog *multi_scan_ask; - ConfirmationDialog *ask_update_settings; - ConfirmationDialog *open_templates; - EditorAbout *about; + ConfirmationDialog *erase_missing_ask = nullptr; + ConfirmationDialog *multi_open_ask = nullptr; + ConfirmationDialog *multi_run_ask = nullptr; + ConfirmationDialog *multi_scan_ask = nullptr; + ConfirmationDialog *ask_update_settings = nullptr; + ConfirmationDialog *open_templates = nullptr; + EditorAbout *about = nullptr; - HBoxContainer *settings_hb; + HBoxContainer *settings_hb = nullptr; - AcceptDialog *run_error_diag; - AcceptDialog *dialog_error; - ProjectDialog *npdialog; + AcceptDialog *run_error_diag = nullptr; + AcceptDialog *dialog_error = nullptr; + ProjectDialog *npdialog = nullptr; - OptionButton *language_btn; - LinkButton *version_btn; + OptionButton *language_btn = nullptr; + LinkButton *version_btn = nullptr; void _open_asset_library(); void _scan_projects(); diff --git a/editor/translations/extract.py b/editor/translations/extract.py index 4a7e87e271..cb918c0092 100755 --- a/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -113,15 +113,20 @@ message_patterns = { r'RTRN\("(?P<message>([^"\\]|\\.)*)", "(?P<plural_message>([^"\\]|\\.)*)",[^,)]+?(, "(?P<context>([^"\\]|\\.)*)")?\)' ): ExtractType.TEXT, re.compile(r'_initial_set\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, - re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?\("(?P<message>[^".]+?)",'): ExtractType.PROPERTY_PATH, + re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?(_BASIC)?\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, + re.compile(r'GLOBAL_DEF_BASIC\(vformat\("(?P<message>layer_names/\w+)/layer_%d"'): ExtractType.PROPERTY_PATH, re.compile(r'EDITOR_DEF(_RST)?\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, re.compile( + r'EDITOR_SETTING(_USAGE)?\(Variant::[_A-Z0-9]+, [_A-Z0-9]+, "(?P<message>[^"]+?)",' + ): ExtractType.PROPERTY_PATH, + re.compile( r'(ADD_PROPERTYI?|ImportOption|ExportOption)\(PropertyInfo\(Variant::[_A-Z0-9]+, "(?P<message>[^"]+?)"[,)]' ): ExtractType.PROPERTY_PATH, re.compile( r"(?!#define )LIMPL_PROPERTY(_RANGE)?\(Variant::[_A-Z0-9]+, (?P<message>[^,]+?)," ): ExtractType.PROPERTY_PATH, re.compile(r'ADD_GROUP\("(?P<message>[^"]+?)", "(?P<prefix>[^"]*?)"\)'): ExtractType.GROUP, + re.compile(r'#define WRTC_\w+ "(?P<message>[^"]+?)"'): ExtractType.PROPERTY_PATH, } @@ -231,6 +236,8 @@ def process_file(f, fname): msg = msg[len(current_group) :] else: current_group = "" + if "." in msg: # Strip feature tag. + msg = msg.split(".", 1)[0] for part in msg.split("/"): _add_message(_process_editor_string(part), msg_plural, msgctx, location, translator_comment) elif extract_type == ExtractType.GROUP: |