diff options
-rw-r--r-- | core/script_debugger_remote.cpp | 43 | ||||
-rw-r--r-- | core/script_debugger_remote.h | 4 | ||||
-rw-r--r-- | core/undo_redo.cpp | 6 | ||||
-rw-r--r-- | core/variant_op.cpp | 8 | ||||
-rw-r--r-- | doc/classes/EditorInterface.xml | 14 | ||||
-rw-r--r-- | doc/classes/EditorPlugin.xml | 4 | ||||
-rw-r--r-- | editor/editor_node.cpp | 72 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 31 | ||||
-rw-r--r-- | editor/editor_settings.h | 8 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 91 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | main/main.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/doc_classes/GDNativeLibrary.xml | 2 | ||||
-rw-r--r-- | platform/javascript/os_javascript.cpp | 5 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 65 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 12 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 7 |
17 files changed, 219 insertions, 157 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index bbc2125c5a..e3dc8eb53a 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -355,6 +355,13 @@ void ScriptDebuggerRemote::_get_output() { locking = false; } + if (n_messages_dropped > 0) { + Message msg; + msg.message = "Too many messages! " + String::num_int64(n_messages_dropped) + " messages were dropped."; + messages.push_back(msg); + n_messages_dropped = 0; + } + while (messages.size()) { locking = true; packet_peer_stream->put_var("message:" + messages.front()->get().message); @@ -366,6 +373,20 @@ void ScriptDebuggerRemote::_get_output() { locking = false; } + if (n_errors_dropped > 0) { + OutputError oe; + oe.error = "TOO_MANY_ERRORS"; + oe.error_descr = "Too many errors! " + String::num_int64(n_errors_dropped) + " errors were dropped."; + oe.warning = false; + uint64_t time = OS::get_singleton()->get_ticks_msec(); + oe.hr = time / 3600000; + oe.min = (time / 60000) % 60; + oe.sec = (time / 1000) % 60; + oe.msec = time % 1000; + errors.push_back(oe); + n_errors_dropped = 0; + } + while (errors.size()) { locking = true; packet_peer_stream->put_var("error"); @@ -453,7 +474,11 @@ void ScriptDebuggerRemote::_err_handler(void *ud, const char *p_func, const char if (!sdr->locking && sdr->tcp_client->is_connected_to_host()) { - sdr->errors.push_back(oe); + if (sdr->errors.size() >= sdr->max_errors_per_frame) { + sdr->n_errors_dropped++; + } else { + sdr->errors.push_back(oe); + } } sdr->mutex->unlock(); @@ -891,10 +916,14 @@ void ScriptDebuggerRemote::send_message(const String &p_message, const Array &p_ mutex->lock(); if (!locking && tcp_client->is_connected_to_host()) { - Message msg; - msg.message = p_message; - msg.data = p_args; - messages.push_back(msg); + if (messages.size() >= max_messages_per_frame) { + n_messages_dropped++; + } else { + Message msg; + msg.message = p_message; + msg.data = p_args; + messages.push_back(msg); + } } mutex->unlock(); } @@ -1011,7 +1040,11 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() : requested_quit(false), mutex(Mutex::create()), max_cps(GLOBAL_GET("network/limits/debugger_stdout/max_chars_per_second")), + max_messages_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_messages_per_frame")), + max_errors_per_frame(GLOBAL_GET("network/limits/debugger_stdout/max_errors_per_frame")), char_count(0), + n_messages_dropped(0), + n_errors_dropped(0), last_msec(0), msec_count(0), locking(false), diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index 00ed22dc29..924d5de2c4 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -87,7 +87,11 @@ class ScriptDebuggerRemote : public ScriptDebugger { List<String> output_strings; List<Message> messages; + int max_messages_per_frame; + int n_messages_dropped; List<OutputError> errors; + int max_errors_per_frame; + int n_errors_dropped; int max_cps; int char_count; diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index a8eb527b09..a105fba290 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -108,6 +108,7 @@ void UndoRedo::create_action(const String &p_name, MergeMode p_mode) { void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) { VARIANT_ARGPTRS + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; @@ -127,6 +128,7 @@ void UndoRedo::add_do_method(Object *p_object, const String &p_method, VARIANT_A void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT_ARG_DECLARE) { VARIANT_ARGPTRS + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); @@ -149,6 +151,7 @@ void UndoRedo::add_undo_method(Object *p_object, const String &p_method, VARIANT } void UndoRedo::add_do_property(Object *p_object, const String &p_property, const Variant &p_value) { + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; @@ -163,6 +166,7 @@ void UndoRedo::add_do_property(Object *p_object, const String &p_property, const } void UndoRedo::add_undo_property(Object *p_object, const String &p_property, const Variant &p_value) { + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); @@ -182,6 +186,7 @@ void UndoRedo::add_undo_property(Object *p_object, const String &p_property, con } void UndoRedo::add_do_reference(Object *p_object) { + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); Operation do_op; @@ -194,6 +199,7 @@ void UndoRedo::add_do_reference(Object *p_object) { } void UndoRedo::add_undo_reference(Object *p_object) { + ERR_FAIL_COND(p_object == NULL); ERR_FAIL_COND(action_level <= 0); ERR_FAIL_COND((current_action + 1) >= actions.size()); diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 662371b107..e46fac77ee 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -339,7 +339,7 @@ bool Variant::booleanize() const { CASE_TYPE(m_prefix, m_op_name, m_name) { \ if (p_b.type == NIL) \ _RETURN(true) \ - DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, ==, true, true, false) \ + DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, !=, false, true, true) \ } #define DEFAULT_OP_ARRAY_LT(m_prefix, m_op_name, m_name, m_type) \ @@ -539,12 +539,12 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a, if (arr_b->size() != l) _RETURN(true); for (int i = 0; i < l; i++) { - if (((*arr_a)[i] == (*arr_b)[i])) { - _RETURN(false); + if (((*arr_a)[i] != (*arr_b)[i])) { + _RETURN(true); } } - _RETURN(true); + _RETURN(false); } DEFAULT_OP_NUM_NULL(math, OP_NOT_EQUAL, INT, !=, _int); diff --git a/doc/classes/EditorInterface.xml b/doc/classes/EditorInterface.xml index 4bbbac8cf7..db715d2379 100644 --- a/doc/classes/EditorInterface.xml +++ b/doc/classes/EditorInterface.xml @@ -76,6 +76,12 @@ Returns the [ScriptEditor]. </description> </method> + <method name="get_selected_path" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_selection"> <return type="EditorSelection"> </return> @@ -141,6 +147,14 @@ Saves the scene as a file at [code]path[/code]. </description> </method> + <method name="select_file"> + <return type="void"> + </return> + <argument index="0" name="p_file" type="String"> + </argument> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index ada0ee56a8..1505845824 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -136,9 +136,7 @@ <method name="forward_canvas_gui_input" qualifiers="virtual"> <return type="bool"> </return> - <argument index="0" name="canvas_xform" type="Transform2D"> - </argument> - <argument index="1" name="event" type="InputEvent"> + <argument index="0" name="event" type="InputEvent"> </argument> <description> </description> diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 70047bc60c..f480883867 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -393,42 +393,6 @@ void EditorNode::_fs_changed() { E->get()->invalidate(); } - if (export_defer.preset != "") { - Ref<EditorExportPreset> preset; - for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); ++i) { - preset = EditorExport::get_singleton()->get_export_preset(i); - if (preset->get_name() == export_defer.preset) { - break; - } - preset.unref(); - } - if (preset.is_null()) { - String err = "Unknown export preset: " + export_defer.preset; - ERR_PRINT(err.utf8().get_data()); - } else { - Ref<EditorExportPlatform> platform = preset->get_platform(); - if (platform.is_null()) { - String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform."; - ERR_PRINT(err.utf8().get_data()); - } else { - // ensures export_project does not loop infinitely, because notifications may - // come during the export - export_defer.preset = ""; - if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) { - if (export_defer.path.ends_with(".zip")) { - platform->save_zip(preset, export_defer.path); - } else if (export_defer.path.ends_with(".pck")) { - platform->save_pack(preset, export_defer.path); - } - } else { - platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0); - } - } - } - - get_tree()->quit(); - } - { //reload changed resources List<Ref<Resource> > changed; @@ -465,6 +429,42 @@ void EditorNode::_fs_changed() { } _mark_unsaved_scenes(); + + if (export_defer.preset != "" && !EditorFileSystem::get_singleton()->is_scanning()) { + Ref<EditorExportPreset> preset; + for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); ++i) { + preset = EditorExport::get_singleton()->get_export_preset(i); + if (preset->get_name() == export_defer.preset) { + break; + } + preset.unref(); + } + if (preset.is_null()) { + String err = "Unknown export preset: " + export_defer.preset; + ERR_PRINT(err.utf8().get_data()); + } else { + Ref<EditorExportPlatform> platform = preset->get_platform(); + if (platform.is_null()) { + String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform."; + ERR_PRINT(err.utf8().get_data()); + } else { + // ensures export_project does not loop infinitely, because notifications may + // come during the export + export_defer.preset = ""; + if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) { + if (export_defer.path.ends_with(".zip")) { + platform->save_zip(preset, export_defer.path); + } else if (export_defer.path.ends_with(".pck")) { + platform->save_pack(preset, export_defer.path); + } + } else { + platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0); + } + } + } + + get_tree()->quit(); + } } void EditorNode::_resources_reimported(const Vector<String> &p_resources) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index be03e24eee..bcdd232260 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -54,7 +54,18 @@ Ref<EditorSettings> EditorSettings::singleton = NULL; // Properties -bool EditorSettings::_set(const StringName &p_name, const Variant &p_value, bool p_emit_signal) { +bool EditorSettings::_set(const StringName &p_name, const Variant &p_value) { + + _THREAD_SAFE_METHOD_ + + bool changed = _set_only(p_name, p_value); + if (changed) { + emit_signal("settings_changed"); + } + return true; +} + +bool EditorSettings::_set_only(const StringName &p_name, const Variant &p_value) { _THREAD_SAFE_METHOD_ @@ -73,7 +84,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value, bool add_shortcut(name, sc); } - return true; + return false; } bool changed = false; @@ -102,10 +113,7 @@ bool EditorSettings::_set(const StringName &p_name, const Variant &p_value, bool } } - if (changed && p_emit_signal) { - emit_signal("settings_changed"); - } - return true; + return changed; } bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const { @@ -370,6 +378,8 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("text_editor/theme/font", ""); hints["text_editor/theme/font"] = PropertyInfo(Variant::STRING, "text_editor/theme/font", PROPERTY_HINT_GLOBAL_FILE, "*.font,*.tres,*.res"); _initial_set("text_editor/completion/auto_brace_complete", false); + _initial_set("text_editor/completion/put_callhint_tooltip_below_current_line", true); + _initial_set("text_editor/completion/callhint_tooltip_offset", Vector2()); _initial_set("text_editor/files/restore_scripts_on_load", true); _initial_set("text_editor/completion/complete_file_paths", true); _initial_set("text_editor/files/maximum_recent_files", 20); @@ -988,8 +998,7 @@ void EditorSettings::set_initial_value(const StringName &p_setting, const Varian if (!props.has(p_setting)) return; - props[p_setting].initial = p_value; - props[p_setting].has_default_value = true; + _initial_set(p_setting, p_value); } Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default) { @@ -1174,8 +1183,10 @@ void EditorSettings::list_text_editor_themes() { void EditorSettings::load_text_editor_theme() { if (get("text_editor/theme/color_theme") == "Default" || get("text_editor/theme/color_theme") == "Adaptive" || get("text_editor/theme/color_theme") == "Custom") { - _load_default_text_editor_theme(); // sorry for "Settings changed" console spam - return; + if (get("text_editor/theme/color_theme") == "Default") { + _load_default_text_editor_theme(); + } + return; // sorry for "Settings changed" console spam } String theme_path = get_text_editor_themes_dir().plus_file((String)get("text_editor/theme/color_theme") + ".tet"); diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 0a20212ccd..5fc49de0a7 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -111,7 +111,8 @@ private: bool save_changed_setting; bool optimize_save; //do not save stuff that came from config but was not set from engine - bool _set(const StringName &p_name, const Variant &p_value, bool p_emit_signal = true); + bool _set(const StringName &p_name, const Variant &p_value); + bool _set_only(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; void _initial_set(const StringName &p_name, const Variant &p_value); void _get_property_list(List<PropertyInfo> *p_list) const; @@ -146,7 +147,10 @@ public: void raise_order(const String &p_setting); void set_initial_value(const StringName &p_setting, const Variant &p_value); void set_manually(const StringName &p_setting, const Variant &p_value, bool p_emit_signal = false) { - _set(p_setting, p_value, p_emit_signal); + if (p_emit_signal) + _set(p_setting, p_value); + else + _set_only(p_setting, p_value); } bool property_can_revert(const String &p_setting); Variant property_get_revert(const String &p_setting); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index ea114472a8..0ebcef8e5e 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1063,67 +1063,38 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { EditorSettings *setting = EditorSettings::get_singleton(); String text_editor_color_theme = setting->get("text_editor/theme/color_theme"); if (text_editor_color_theme == "Adaptive") { - setting->set_manually("text_editor/highlighting/symbol_color", symbol_color); - setting->set_manually("text_editor/highlighting/keyword_color", keyword_color); - setting->set_manually("text_editor/highlighting/base_type_color", basetype_color); - setting->set_manually("text_editor/highlighting/engine_type_color", type_color); - setting->set_manually("text_editor/highlighting/comment_color", comment_color); - setting->set_manually("text_editor/highlighting/string_color", string_color); - setting->set_manually("text_editor/highlighting/background_color", background_color); - setting->set_manually("text_editor/highlighting/completion_background_color", completion_background_color); - setting->set_manually("text_editor/highlighting/completion_selected_color", completion_selected_color); - setting->set_manually("text_editor/highlighting/completion_existing_color", completion_existing_color); - setting->set_manually("text_editor/highlighting/completion_scroll_color", completion_scroll_color); - setting->set_manually("text_editor/highlighting/completion_font_color", completion_font_color); - setting->set_manually("text_editor/highlighting/text_color", text_color); - setting->set_manually("text_editor/highlighting/line_number_color", line_number_color); - setting->set_manually("text_editor/highlighting/caret_color", caret_color); - setting->set_manually("text_editor/highlighting/caret_background_color", caret_background_color); - setting->set_manually("text_editor/highlighting/text_selected_color", text_selected_color); - setting->set_manually("text_editor/highlighting/selection_color", selection_color); - setting->set_manually("text_editor/highlighting/brace_mismatch_color", brace_mismatch_color); - setting->set_manually("text_editor/highlighting/current_line_color", current_line_color); - setting->set_manually("text_editor/highlighting/line_length_guideline_color", line_length_guideline_color); - setting->set_manually("text_editor/highlighting/word_highlighted_color", word_highlighted_color); - setting->set_manually("text_editor/highlighting/number_color", number_color); - setting->set_manually("text_editor/highlighting/function_color", function_color); - setting->set_manually("text_editor/highlighting/member_variable_color", member_variable_color); - setting->set_manually("text_editor/highlighting/mark_color", mark_color); - setting->set_manually("text_editor/highlighting/breakpoint_color", breakpoint_color); - setting->set_manually("text_editor/highlighting/code_folding_color", code_folding_color); - setting->set_manually("text_editor/highlighting/search_result_color", search_result_color); - setting->set_manually("text_editor/highlighting/search_result_border_color", search_result_border_color); + setting->set_initial_value("text_editor/highlighting/symbol_color", symbol_color); + setting->set_initial_value("text_editor/highlighting/keyword_color", keyword_color); + setting->set_initial_value("text_editor/highlighting/base_type_color", basetype_color); + setting->set_initial_value("text_editor/highlighting/engine_type_color", type_color); + setting->set_initial_value("text_editor/highlighting/comment_color", comment_color); + setting->set_initial_value("text_editor/highlighting/string_color", string_color); + setting->set_initial_value("text_editor/highlighting/background_color", background_color); + setting->set_initial_value("text_editor/highlighting/completion_background_color", completion_background_color); + setting->set_initial_value("text_editor/highlighting/completion_selected_color", completion_selected_color); + setting->set_initial_value("text_editor/highlighting/completion_existing_color", completion_existing_color); + setting->set_initial_value("text_editor/highlighting/completion_scroll_color", completion_scroll_color); + setting->set_initial_value("text_editor/highlighting/completion_font_color", completion_font_color); + setting->set_initial_value("text_editor/highlighting/text_color", text_color); + setting->set_initial_value("text_editor/highlighting/line_number_color", line_number_color); + setting->set_initial_value("text_editor/highlighting/caret_color", caret_color); + setting->set_initial_value("text_editor/highlighting/caret_background_color", caret_background_color); + setting->set_initial_value("text_editor/highlighting/text_selected_color", text_selected_color); + setting->set_initial_value("text_editor/highlighting/selection_color", selection_color); + setting->set_initial_value("text_editor/highlighting/brace_mismatch_color", brace_mismatch_color); + setting->set_initial_value("text_editor/highlighting/current_line_color", current_line_color); + setting->set_initial_value("text_editor/highlighting/line_length_guideline_color", line_length_guideline_color); + setting->set_initial_value("text_editor/highlighting/word_highlighted_color", word_highlighted_color); + setting->set_initial_value("text_editor/highlighting/number_color", number_color); + setting->set_initial_value("text_editor/highlighting/function_color", function_color); + setting->set_initial_value("text_editor/highlighting/member_variable_color", member_variable_color); + setting->set_initial_value("text_editor/highlighting/mark_color", mark_color); + setting->set_initial_value("text_editor/highlighting/breakpoint_color", breakpoint_color); + setting->set_initial_value("text_editor/highlighting/code_folding_color", code_folding_color); + setting->set_initial_value("text_editor/highlighting/search_result_color", search_result_color); + setting->set_initial_value("text_editor/highlighting/search_result_border_color", search_result_border_color); } else if (text_editor_color_theme == "Default") { - setting->set_manually("text_editor/highlighting/symbol_color", Color::html("badfff")); - setting->set_manually("text_editor/highlighting/keyword_color", Color::html("ffffb3")); - setting->set_manually("text_editor/highlighting/base_type_color", Color::html("a4ffd4")); - setting->set_manually("text_editor/highlighting/engine_type_color", Color::html("83d3ff")); - setting->set_manually("text_editor/highlighting/comment_color", Color::html("676767")); - setting->set_manually("text_editor/highlighting/string_color", Color::html("ef6ebe")); - setting->set_manually("text_editor/highlighting/background_color", Color::html("3b000000")); - setting->set_manually("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); - setting->set_manually("text_editor/highlighting/completion_selected_color", Color::html("434244")); - setting->set_manually("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); - setting->set_manually("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); - setting->set_manually("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); - setting->set_manually("text_editor/highlighting/text_color", Color::html("aaaaaa")); - setting->set_manually("text_editor/highlighting/line_number_color", Color::html("66aaaaaa")); - setting->set_manually("text_editor/highlighting/caret_color", Color::html("aaaaaa")); - setting->set_manually("text_editor/highlighting/caret_background_color", Color::html("000000")); - setting->set_manually("text_editor/highlighting/text_selected_color", Color::html("000000")); - setting->set_manually("text_editor/highlighting/selection_color", Color::html("6ca9c2")); - setting->set_manually("text_editor/highlighting/brace_mismatch_color", Color(1, 0.2, 0.2)); - setting->set_manually("text_editor/highlighting/current_line_color", Color(0.3, 0.5, 0.8, 0.15)); - setting->set_manually("text_editor/highlighting/line_length_guideline_color", Color(0.3, 0.5, 0.8, 0.1)); - setting->set_manually("text_editor/highlighting/word_highlighted_color", Color(0.8, 0.9, 0.9, 0.15)); - setting->set_manually("text_editor/highlighting/number_color", Color::html("EB9532")); - setting->set_manually("text_editor/highlighting/function_color", Color::html("66a2ce")); - setting->set_manually("text_editor/highlighting/member_variable_color", Color::html("e64e59")); - setting->set_manually("text_editor/highlighting/mark_color", Color(1.0, 0.4, 0.4, 0.4)); - setting->set_manually("text_editor/highlighting/breakpoint_color", Color(0.8, 0.8, 0.4, 0.2)); - setting->set_manually("text_editor/highlighting/code_folding_color", Color(0.8, 0.8, 0.8, 0.8)); - setting->set_manually("text_editor/highlighting/search_result_color", Color(0.05, 0.25, 0.05, 1)); - setting->set_manually("text_editor/highlighting/search_result_border_color", Color(0.1, 0.45, 0.1, 1)); + setting->load_text_editor_theme(); } return theme; diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp index fa0deb7606..e993c2fd46 100644 --- a/editor/script_editor_debugger.cpp +++ b/editor/script_editor_debugger.cpp @@ -1166,6 +1166,7 @@ void ScriptEditorDebugger::start() { } set_process(true); + breaked = false; } void ScriptEditorDebugger::pause() { @@ -1177,6 +1178,7 @@ void ScriptEditorDebugger::unpause() { void ScriptEditorDebugger::stop() { set_process(false); + breaked = false; server->stop(); diff --git a/main/main.cpp b/main/main.cpp index b51ea3211c..48537dc3a7 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -665,6 +665,8 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph GLOBAL_DEF("memory/limits/multithreaded_server/rid_pool_prealloc", 60); GLOBAL_DEF("network/limits/debugger_stdout/max_chars_per_second", 2048); + GLOBAL_DEF("network/limits/debugger_stdout/max_messages_per_frame", 10); + GLOBAL_DEF("network/limits/debugger_stdout/max_errors_per_frame", 10); if (debug_mode == "remote") { diff --git a/modules/gdnative/doc_classes/GDNativeLibrary.xml b/modules/gdnative/doc_classes/GDNativeLibrary.xml index 647d27929f..14bd0e9654 100644 --- a/modules/gdnative/doc_classes/GDNativeLibrary.xml +++ b/modules/gdnative/doc_classes/GDNativeLibrary.xml @@ -31,6 +31,8 @@ <members> <member name="load_once" type="bool" setter="set_load_once" getter="should_load_once"> </member> + <member name="reloadable" type="bool" setter="set_reloadable" getter="is_reloadable"> + </member> <member name="singleton" type="bool" setter="set_singleton" getter="is_singleton"> </member> <member name="symbol_prefix" type="String" setter="set_symbol_prefix" getter="get_symbol_prefix"> diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index 6d1f75e283..b10ef821dd 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -989,6 +989,7 @@ bool OS_JavaScript::is_userfs_persistent() const { } OS_JavaScript::OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_user_data_dir_func) { + set_cmdline(p_execpath, get_cmdline_args()); main_loop = NULL; gl_extensions = NULL; @@ -1001,6 +1002,10 @@ OS_JavaScript::OS_JavaScript(const char *p_execpath, GetUserDataDirFunc p_get_us idbfs_available = false; time_to_save_sync = -1; + + Vector<Logger *> loggers; + loggers.push_back(memnew(StdLogger)); + _set_logger(memnew(CompositeLogger(loggers))); } OS_JavaScript::~OS_JavaScript() { diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 662bd4d8a9..19f33c814f 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -74,10 +74,7 @@ static NSRect convertRectToBacking(NSRect contentRect) { - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) - return [OS_OSX::singleton->window_view convertRectToBacking:contentRect]; - else - return contentRect; + return [OS_OSX::singleton->window_view convertRectToBacking:contentRect]; } static void get_key_modifier_state(unsigned int p_osx_state, Ref<InputEventWithModifiers> state) { @@ -897,17 +894,12 @@ inline void sendPanEvent(double dx, double dy, int modifierFlags) { - (void)scrollWheel:(NSEvent *)event { double deltaX, deltaY; - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) { - deltaX = [event scrollingDeltaX]; - deltaY = [event scrollingDeltaY]; + deltaX = [event scrollingDeltaX]; + deltaY = [event scrollingDeltaY]; - if ([event hasPreciseScrollingDeltas]) { - deltaX *= 0.03; - deltaY *= 0.03; - } - } else { - deltaX = [event deltaX]; - deltaY = [event deltaY]; + if ([event hasPreciseScrollingDeltas]) { + deltaX *= 0.03; + deltaY *= 0.03; } if ([event phase] != NSEventPhaseNone || [event momentumPhase] != NSEventPhaseNone) { @@ -1034,7 +1026,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a window_size.width = p_desired.width * displayScale; window_size.height = p_desired.height * displayScale; - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && displayScale > 1.0) { + if (displayScale > 1.0) { [window_view setWantsBestResolutionOpenGLSurface:YES]; //if (current_videomode.resizable) [window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; @@ -1046,8 +1038,7 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a [window_object setAcceptsMouseMovedEvents:YES]; [window_object center]; - if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) - [window_object setRestorable:NO]; + [window_object setRestorable:NO]; unsigned int attributeCount = 0; @@ -1207,34 +1198,42 @@ public: switch (p_type) { case ERR_WARNING: - os_log_info(OS_LOG_DEFAULT, - "WARNING: %{public}s: %{public}s\nAt: %{public}s:%i.", - p_function, err_details, p_file, p_line); + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { + os_log_info(OS_LOG_DEFAULT, + "WARNING: %{public}s: %{public}s\nAt: %{public}s:%i.", + p_function, err_details, p_file, p_line); + } logf_error("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n", p_function, err_details); logf_error("\E[0;33m At: %s:%i.\E[0m\n", p_file, p_line); break; case ERR_SCRIPT: - os_log_error(OS_LOG_DEFAULT, - "SCRIPT ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", - p_function, err_details, p_file, p_line); + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { + os_log_error(OS_LOG_DEFAULT, + "SCRIPT ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", + p_function, err_details, p_file, p_line); + } logf_error("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m%s\n", p_function, err_details); logf_error("\E[0;35m At: %s:%i.\E[0m\n", p_file, p_line); break; case ERR_SHADER: - os_log_error(OS_LOG_DEFAULT, - "SHADER ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", - p_function, err_details, p_file, p_line); + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { + os_log_error(OS_LOG_DEFAULT, + "SHADER ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", + p_function, err_details, p_file, p_line); + } logf_error("\E[1;36mSHADER ERROR: %s: \E[0m\E[1m%s\n", p_function, err_details); logf_error("\E[0;36m At: %s:%i.\E[0m\n", p_file, p_line); break; case ERR_ERROR: default: - os_log_error(OS_LOG_DEFAULT, - "ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", - p_function, err_details, p_file, p_line); + if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { + os_log_error(OS_LOG_DEFAULT, + "ERROR: %{public}s: %{public}s\nAt: %{public}s:%i.", + p_function, err_details, p_file, p_line); + } logf_error("\E[1;31mERROR: %s: \E[0m\E[1m%s\n", p_function, err_details); logf_error("\E[0;31m At: %s:%i.\E[0m\n", p_file, p_line); break; @@ -1807,10 +1806,14 @@ void OS_OSX::set_window_size(const Size2 p_size) { CGFloat menuBarHeight = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; if (menuBarHeight != 0.f) { size.y += menuBarHeight; -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 101104 } else { - size.y += [[NSStatusBar systemStatusBar] thickness]; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101200 + if (floor(NSAppKitVersionNumber) < NSAppKitVersionNumber10_12) { +#else + { #endif + size.y += [[NSStatusBar systemStatusBar] thickness]; + } } } diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index d7987d4a19..cf01ce8643 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -305,11 +305,15 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) { case BUTTON_WHEEL_DOWN: { - _scroll(-b->get_factor(), b->get_position()); + if (get_global_position().y + get_size().y > get_viewport_rect().size.y) { + _scroll(-b->get_factor(), b->get_position()); + } } break; case BUTTON_WHEEL_UP: { - _scroll(b->get_factor(), b->get_position()); + if (get_global_position().y < 0) { + _scroll(b->get_factor(), b->get_position()); + } } break; case BUTTON_LEFT: { @@ -380,7 +384,9 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) { Ref<InputEventPanGesture> pan_gesture = p_event; if (pan_gesture.is_valid()) { - _scroll(-pan_gesture->get_delta().y, pan_gesture->get_position()); + if (get_global_position().y + get_size().y > get_viewport_rect().size.y || get_global_position().y < 0) { + _scroll(-pan_gesture->get_delta().y, pan_gesture->get_position()); + } } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 881cdc48f7..a3f59b54fc 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -3641,9 +3641,10 @@ void TextEdit::center_viewport_to_cursor() { int visible_rows = get_visible_rows(); if (h_scroll->is_visible_in_tree()) visible_rows -= ((h_scroll->get_combined_minimum_size().height - 1) / get_row_height()); - - int max_ofs = text.size() - (scroll_past_end_of_file_enabled ? 1 : num_lines_from(text.size() - 1, -visible_rows)); - cursor.line_ofs = CLAMP(cursor.line - num_lines_from(cursor.line - visible_rows / 2, -visible_rows / 2), 0, max_ofs); + if (text.size() >= visible_rows) { + int max_ofs = text.size() - (scroll_past_end_of_file_enabled ? 1 : MAX(num_lines_from(text.size() - 1, -visible_rows), 0)); + cursor.line_ofs = CLAMP(cursor.line - num_lines_from(MAX(cursor.line - visible_rows / 2, 0), -visible_rows / 2), 0, max_ofs); + } int cursor_x = get_column_x_offset(cursor.column, text[cursor.line]); if (cursor_x > (cursor.x_ofs + visible_width)) |