diff options
-rw-r--r-- | .gitignore | 4 | ||||
-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/Vector2.xml | 4 | ||||
-rw-r--r-- | doc/classes/Vector3.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/plugins/tile_set_editor_plugin.cpp | 95 | ||||
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.h | 1 | ||||
-rw-r--r-- | editor/script_editor_debugger.cpp | 2 | ||||
-rw-r--r-- | main/main.cpp | 2 | ||||
-rw-r--r-- | methods.py | 2 | ||||
-rw-r--r-- | platform/javascript/detect.py | 10 | ||||
-rw-r--r-- | platform/javascript/engine.js | 10 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 12 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 8 | ||||
-rw-r--r-- | scene/gui/video_player.h | 2 | ||||
-rw-r--r-- | scene/resources/dynamic_font.cpp | 2 |
22 files changed, 236 insertions, 185 deletions
diff --git a/.gitignore b/.gitignore index cbb0b5b133..f8296ef51e 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,10 @@ gmon.out .cproject .settings/ +# Geany/geany-plugins files +*.geany +.geanyprj + # Misc .DS_Store logs/ 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/Vector2.xml b/doc/classes/Vector2.xml index 976cdbbd90..5c1281b628 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -92,7 +92,7 @@ <argument index="3" name="t" type="float"> </argument> <description> - Cubicly interpolates between this Vector and "b", using "pre_a" and "post_b" as handles, and returning the result at position "t". + Cubicly interpolates between this Vector and "b", using "pre_a" and "post_b" as handles, and returning the result at position "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is. </description> </method> <method name="distance_squared_to"> @@ -158,7 +158,7 @@ <argument index="1" name="t" type="float"> </argument> <description> - Returns the result of the linear interpolation between this vector and "b", by amount "t". + Returns the result of the linear interpolation between this vector and "b", by amount "t". "t" should be a float of 0.0-1.0, a percentage of how far along the interpolation is. </description> </method> <method name="normalized"> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index acb41297a7..dff3d04b0c 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -77,7 +77,7 @@ <argument index="3" name="t" type="float"> </argument> <description> - Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount (t). + Performs a cubic interpolation between vectors [code]pre_a[/code], [code]a[/code], [code]b[/code], [code]post_b[/code] ([code]a[/code] is current), by the given amount (t). (t) should be a float of 0.0-1.0, a percentage of how far along the interpolation is. </description> </method> <method name="distance_squared_to"> @@ -150,7 +150,7 @@ <argument index="1" name="t" type="float"> </argument> <description> - Linearly interpolates the vector to a given one (b), by the given amount (t). + Linearly interpolates the vector to a given one (b), by the given amount (t). (t) should be a float of 0.0-1.0, a percentage of how far along the interpolation is. </description> </method> <method name="max_axis"> 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/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 15e8347bbd..08679b781a 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -618,8 +618,10 @@ void AutotileEditor::_on_edit_mode_changed(int p_edit_mode) { tool_containers[TOOLBAR_BITMASK]->hide(); tool_containers[TOOLBAR_SHAPE]->show(); tools[TOOL_SELECT]->set_tooltip(TTR("Select current edited sub-tile.")); - current_shape = PoolVector2Array(); spin_priority->hide(); + + current_shape = PoolVector2Array(); + select_coord(edited_shape_coord); } break; default: { tool_containers[TOOLBAR_DUMMY]->show(); @@ -931,50 +933,18 @@ void AutotileEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { edited_shape_coord = coord; edited_occlusion_shape = tile_set->autotile_get_light_occluder(get_current_tile(), edited_shape_coord); edited_navigation_shape = tile_set->autotile_get_navigation_polygon(get_current_tile(), edited_shape_coord); - shape_anchor = edited_shape_coord; - shape_anchor.x *= (size.x + spacing); - shape_anchor.y *= (size.y + spacing); - if (edit_mode == EDITMODE_OCCLUSION) { - current_shape.resize(0); - if (edited_occlusion_shape.is_valid()) { - for (int i = 0; i < edited_occlusion_shape->get_polygon().size(); i++) { - current_shape.push_back(edited_occlusion_shape->get_polygon()[i] + shape_anchor); - } - } - } else if (edit_mode == EDITMODE_NAVIGATION) { - current_shape.resize(0); - if (edited_navigation_shape.is_valid()) { - if (edited_navigation_shape->get_polygon_count() > 0) { - PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices(); - for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) { - current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + shape_anchor); - } - } - } - } - } else { - if (edit_mode == EDITMODE_COLLISION) { - Vector<TileSet::ShapeData> sd = tile_set->tile_get_shapes(get_current_tile()); - for (int i = 0; i < sd.size(); i++) { - if (sd[i].autotile_coord == coord) { - Ref<ConvexPolygonShape2D> shape = sd[i].shape; - if (shape.is_valid()) { - - Rect2 bounding_rect; - PoolVector2Array polygon; - bounding_rect.position = shape->get_points()[0]; - for (int j = 0; j < shape->get_points().size(); j++) { - polygon.push_back(shape->get_points()[j] + shape_anchor); - bounding_rect.expand_to(shape->get_points()[j] + shape_anchor); - } - if (bounding_rect.has_point(mb->get_position())) { - current_shape = polygon; - edited_collision_shape = shape; - } - } - } + Vector<TileSet::ShapeData> sd = tile_set->tile_get_shapes(get_current_tile()); + bool found_collision_shape = false; + for (int i = 0; i < sd.size(); i++) { + if (sd[i].autotile_coord == coord) { + edited_collision_shape = sd[i].shape; + found_collision_shape = true; + break; } } + if (!found_collision_shape) + edited_collision_shape = Ref<ConvexPolygonShape2D>(NULL); + select_coord(edited_shape_coord); } workspace->update(); } else if (!mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { @@ -1341,7 +1311,7 @@ void AutotileEditor::draw_polygon_shapes() { } Vector<Vector2> polygon; Vector<Color> colors; - if (shape == edited_collision_shape) { + if (shape == edited_collision_shape && current_shape.size() > 2) { for (int j = 0; j < current_shape.size(); j++) { polygon.push_back(current_shape[j]); colors.push_back(c_bg); @@ -1391,7 +1361,7 @@ void AutotileEditor::draw_polygon_shapes() { } Vector<Vector2> polygon; Vector<Color> colors; - if (shape == edited_occlusion_shape) { + if (shape == edited_occlusion_shape && current_shape.size() > 2) { for (int j = 0; j < current_shape.size(); j++) { polygon.push_back(current_shape[j]); colors.push_back(c_bg); @@ -1439,7 +1409,7 @@ void AutotileEditor::draw_polygon_shapes() { } Vector<Vector2> polygon; Vector<Color> colors; - if (shape == edited_navigation_shape) { + if (shape == edited_navigation_shape && current_shape.size() > 2) { for (int j = 0; j < current_shape.size(); j++) { polygon.push_back(current_shape[j]); colors.push_back(c_bg); @@ -1549,6 +1519,39 @@ void AutotileEditor::close_shape(const Vector2 &shape_anchor) { } } +void AutotileEditor::select_coord(const Vector2 &coord) { + int spacing = tile_set->autotile_get_spacing(get_current_tile()); + Vector2 size = tile_set->autotile_get_size(get_current_tile()); + Vector2 shape_anchor = coord; + shape_anchor.x *= (size.x + spacing); + shape_anchor.y *= (size.y + spacing); + if (edit_mode == EDITMODE_COLLISION) { + current_shape.resize(0); + if (edited_collision_shape.is_valid()) { + for (int j = 0; j < edited_collision_shape->get_points().size(); j++) { + current_shape.push_back(edited_collision_shape->get_points()[j] + shape_anchor); + } + } + } else if (edit_mode == EDITMODE_OCCLUSION) { + current_shape.resize(0); + if (edited_occlusion_shape.is_valid()) { + for (int i = 0; i < edited_occlusion_shape->get_polygon().size(); i++) { + current_shape.push_back(edited_occlusion_shape->get_polygon()[i] + shape_anchor); + } + } + } else if (edit_mode == EDITMODE_NAVIGATION) { + current_shape.resize(0); + if (edited_navigation_shape.is_valid()) { + if (edited_navigation_shape->get_polygon_count() > 0) { + PoolVector<Vector2> vertices = edited_navigation_shape->get_vertices(); + for (int i = 0; i < edited_navigation_shape->get_polygon(0).size(); i++) { + current_shape.push_back(vertices[edited_navigation_shape->get_polygon(0)[i]] + shape_anchor); + } + } + } + } +} + Vector2 AutotileEditor::snap_point(const Vector2 &point) { Vector2 p = point; Vector2 coord = edited_shape_coord; diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index de989a11e8..9bd3e23181 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -144,6 +144,7 @@ private: void draw_grid_snap(); void draw_polygon_shapes(); void close_shape(const Vector2 &shape_anchor); + void select_coord(const Vector2 &coord); Vector2 snap_point(const Vector2 &point); void edit(Object *p_node); 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/methods.py b/methods.py index f9da6c8dd5..fbdac8a966 100644 --- a/methods.py +++ b/methods.py @@ -1274,6 +1274,8 @@ def detect_modules(): for x in files: if (not os.path.isdir(x)): continue + if (not os.path.exists(x + "/config.py")): + continue x = x.replace("modules/", "") # rest of world x = x.replace("modules\\", "") # win32 module_list.append(x) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 8472c3ccab..8c7a904bca 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -49,8 +49,14 @@ def configure(env): ## Build type if (env["target"] == "release"): - env.Append(CCFLAGS=['-O3']) - env.Append(LINKFLAGS=['-O3']) + # Use -Os to prioritize optimizing for reduced file size. This is + # particularly valuable for the web platform because it directly + # decreases download time. + # -Os reduces file size by around 5 MiB over -O3. -Oz only saves about + # 100 KiB over -Os, which does not justify the negative impact on + # run-time performance. + env.Append(CCFLAGS=['-Os']) + env.Append(LINKFLAGS=['-Os']) elif (env["target"] == "release_debug"): env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) diff --git a/platform/javascript/engine.js b/platform/javascript/engine.js index dc4bdc7efb..bca1851f40 100644 --- a/platform/javascript/engine.js +++ b/platform/javascript/engine.js @@ -138,13 +138,17 @@ } var actualCanvas = this.rtenv.canvas; - var context = false; + var testContext = false; + var testCanvas; try { - context = actualCanvas.getContext('webgl2') || actualCanvas.getContext('experimental-webgl2'); + testCanvas = document.createElement('canvas'); + testContext = testCanvas.getContext('webgl2') || testCanvas.getContext('experimental-webgl2'); } catch (e) {} - if (!context) { + if (!testContext) { throw new Error("WebGL 2 not available"); } + testCanvas = null; + testContext = null; // canvas can grab focus on click if (actualCanvas.tabIndex < 0) { 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/video_player.cpp b/scene/gui/video_player.cpp index 953ebe84f6..b0739a2f37 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -38,11 +38,6 @@ int VideoPlayer::sp_get_channel_count() const { return playback->get_channels(); } -void VideoPlayer::sp_set_mix_rate(int p_rate) { - - server_mix_rate = p_rate; -} - bool VideoPlayer::mix(AudioFrame *p_buffer, int p_frames) { // Check the amount resampler can really handle. @@ -241,7 +236,7 @@ void VideoPlayer::set_stream(const Ref<VideoStream> &p_stream) { AudioServer::get_singleton()->lock(); if (channels > 0) - resampler.setup(channels, playback->get_mix_rate(), server_mix_rate, buffering_ms, 0); + resampler.setup(channels, playback->get_mix_rate(), AudioServer::get_singleton()->get_mix_rate(), buffering_ms, 0); else resampler.clear(); AudioServer::get_singleton()->unlock(); @@ -494,7 +489,6 @@ VideoPlayer::VideoPlayer() { bus_index = 0; buffering_ms = 500; - server_mix_rate = 44100; // internal_stream.player=this; // stream_rid=AudioServer::get_singleton()->audio_stream_create(&internal_stream); diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index 7010c71ad9..5c379b5620 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -50,7 +50,6 @@ class VideoPlayer : public Control { Ref<VideoStream> stream; int sp_get_channel_count() const; - void sp_set_mix_rate(int p_rate); //notify the stream of the mix rate bool mix(AudioFrame *p_buffer, int p_frames); RID stream_rid; @@ -69,7 +68,6 @@ class VideoPlayer : public Control { bool expand; bool loops; int buffering_ms; - int server_mix_rate; int audio_track; int bus_index; diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 00fc601779..575c222cc1 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -651,8 +651,8 @@ DynamicFontAtSize::~DynamicFontAtSize() { if (valid) { FT_Done_FreeType(library); - font->size_cache.erase(id); } + font->size_cache.erase(id); } ///////////////////////// |