diff options
-rw-r--r-- | .editorconfig | 2 | ||||
-rw-r--r-- | SConstruct | 25 | ||||
-rw-r--r-- | core/bind/core_bind.cpp | 6 | ||||
-rw-r--r-- | core/bind/core_bind.h | 1 | ||||
-rw-r--r-- | core/os/os.cpp | 3 | ||||
-rw-r--r-- | core/os/os.h | 1 | ||||
-rw-r--r-- | doc/classes/OS.xml | 14 | ||||
-rw-r--r-- | editor/editor_export.cpp | 4 | ||||
-rw-r--r-- | editor/project_manager.cpp | 24 | ||||
-rw-r--r-- | editor/project_manager.h | 2 | ||||
-rw-r--r-- | main/main.cpp | 24 | ||||
-rw-r--r-- | platform/osx/os_osx.h | 1 | ||||
-rw-r--r-- | platform/osx/os_osx.mm | 25 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 111 | ||||
-rw-r--r-- | platform/windows/os_windows.h | 21 | ||||
-rw-r--r-- | scene/2d/path_2d.cpp | 24 | ||||
-rw-r--r-- | scene/3d/cpu_particles.cpp | 2 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
19 files changed, 262 insertions, 32 deletions
diff --git a/.editorconfig b/.editorconfig index ab03b8421c..56cc2e9c2d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,7 +9,7 @@ insert_final_newline = true [*.{cpp,hpp,c,h,mm}] trim_trailing_whitespace = true -[{*.{py,cs},SCsub}] +[{*.{py,cs},SConstruct,SCsub}] indent_style = space indent_size = 4 diff --git a/SConstruct b/SConstruct index 88bb43fbc7..b75ca24da6 100644 --- a/SConstruct +++ b/SConstruct @@ -149,7 +149,7 @@ opts.Add(BoolVariable('builtin_libwebsockets', "Use the built-in libwebsockets l opts.Add(BoolVariable('builtin_mbedtls', "Use the built-in mbedTLS library", True)) opts.Add(BoolVariable('builtin_miniupnpc', "Use the built-in miniupnpc library", True)) opts.Add(BoolVariable('builtin_opus', "Use the built-in Opus library", True)) -opts.Add(BoolVariable('builtin_pcre2', "Use the built-in PCRE2 library)", True)) +opts.Add(BoolVariable('builtin_pcre2', "Use the built-in PCRE2 library", True)) opts.Add(BoolVariable('builtin_recast', "Use the built-in Recast library", True)) opts.Add(BoolVariable('builtin_squish', "Use the built-in squish library", True)) opts.Add(BoolVariable('builtin_xatlas', "Use the built-in xatlas library", True)) @@ -226,6 +226,23 @@ if env_base['platform'] != "": elif env_base['p'] != "": selected_platform = env_base['p'] env_base["platform"] = selected_platform +else: + # Missing `platform` argument, try to detect platform automatically + if sys.platform.startswith('linux'): + selected_platform = 'linux' + elif sys.platform == 'darwin': + selected_platform = 'osx' + elif sys.platform == 'win32': + selected_platform = 'windows' + else: + print("Could not detect platform automatically. Supported platforms:") + for x in platform_list: + print("\t" + x) + print("\nPlease run SCons again and select a valid platform: platform=<string>") + + if selected_platform != "": + print("Automatically detected platform: " + selected_platform) + env_base["platform"] = selected_platform if selected_platform in platform_list: tmppath = "./platform/" + selected_platform @@ -492,13 +509,13 @@ if selected_platform in platform_list: if (conf.CheckCHeader(header[0])): env.AppendUnique(CPPDEFINES=[header[1]]) -else: +elif selected_platform != "": - print("No valid target platform selected.") + print("Invalid target platform: " + selected_platform) print("The following platforms were detected:") for x in platform_list: print("\t" + x) - print("\nPlease run SCons again with the argument: platform=<string>") + print("\nPlease run SCons again and select a valid platform: platform=<string>") # The following only makes sense when the env is defined, and assumes it is if 'env' in locals(): diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index ddb60e1345..27b33d942b 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -611,6 +611,11 @@ uint64_t _OS::get_dynamic_memory_usage() const { return OS::get_singleton()->get_dynamic_memory_usage(); } +void _OS::set_native_icon(const String &p_filename) { + + OS::get_singleton()->set_native_icon(p_filename); +} + void _OS::set_icon(const Ref<Image> &p_icon) { OS::get_singleton()->set_icon(p_icon); @@ -1199,6 +1204,7 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("get_system_time_secs"), &_OS::get_system_time_secs); ClassDB::bind_method(D_METHOD("get_system_time_msecs"), &_OS::get_system_time_msecs); + ClassDB::bind_method(D_METHOD("set_native_icon", "filename"), &_OS::set_native_icon); ClassDB::bind_method(D_METHOD("set_icon", "icon"), &_OS::set_icon); ClassDB::bind_method(D_METHOD("get_exit_code"), &_OS::get_exit_code); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index d4fa3bc735..3e46d24627 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -275,6 +275,7 @@ public: void set_use_file_access_save_and_swap(bool p_enable); + void set_native_icon(const String &p_filename); void set_icon(const Ref<Image> &p_icon); int get_exit_code() const; diff --git a/core/os/os.cpp b/core/os/os.cpp index ea378c9e83..1a3c9ac5f8 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -465,6 +465,9 @@ void OS::_ensure_user_data_dir() { memdelete(da); } +void OS::set_native_icon(const String &p_filename) { +} + void OS::set_icon(const Ref<Image> &p_icon) { } diff --git a/core/os/os.h b/core/os/os.h index 07865b636e..4f6a539e78 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -451,6 +451,7 @@ public: virtual void make_rendering_thread(); virtual void swap_buffers(); + virtual void set_native_icon(const String &p_filename); virtual void set_icon(const Ref<Image> &p_icon); virtual int get_exit_code() const; diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index c9c83bc0e0..ec2ee78701 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -697,7 +697,19 @@ <argument index="0" name="icon" type="Image"> </argument> <description> - Sets the game's icon. + Sets the game's icon using an [Image] resource. + The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed. + </description> + </method> + <method name="set_native_icon"> + <return type="void"> + </return> + <argument index="0" name="filename" type="String"> + </argument> + <description> + Sets the game's icon using a multi-size platform-specific icon file ([code]*.ico[/code] on Windows and [code]*.icns[/code] on macOS). + Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog. + Note: This method is only implemented on macOS and Windows. </description> </method> <method name="set_ime_active"> diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index df481e0855..37f148bdbb 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -693,6 +693,10 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> & } } + //add native icons to non-resource include list + _edit_filter_list(paths, String("*.icns"), false); + _edit_filter_list(paths, String("*.ico"), false); + _edit_filter_list(paths, p_preset->get_include_filter(), false); _edit_filter_list(paths, p_preset->get_exclude_filter(), true); diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 81c99eafd3..b0baf954d2 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1627,40 +1627,28 @@ void ProjectManager::_show_project(const String &p_path) { OS::get_singleton()->shell_open(String("file://") + p_path); } -void ProjectManager::_scan_dir(DirAccess *da, float pos, float total, List<String> *r_projects) { - - List<String> subdirs; +void ProjectManager::_scan_dir(const String &path, List<String> *r_projects) { + DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + da->change_dir(path); da->list_dir_begin(); String n = da->get_next(); while (n != String()) { if (da->current_is_dir() && !n.begins_with(".")) { - subdirs.push_front(n); + _scan_dir(da->get_current_dir().plus_file(n), r_projects); } else if (n == "project.godot") { r_projects->push_back(da->get_current_dir()); } n = da->get_next(); } da->list_dir_end(); - int m = 0; - for (List<String>::Element *E = subdirs.front(); E; E = E->next()) { - - da->change_dir(E->get()); - - float slice = total / subdirs.size(); - _scan_dir(da, pos + slice * m, slice, r_projects); - da->change_dir(".."); - m++; - } + memdelete(da); } void ProjectManager::_scan_begin(const String &p_base) { print_line("Scanning projects at: " + p_base); List<String> projects; - DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - da->change_dir(p_base); - _scan_dir(da, 0, 1, &projects); - memdelete(da); + _scan_dir(p_base, &projects); print_line("Found " + itos(projects.size()) + " projects."); for (List<String>::Element *E = projects.front(); E; E = E->next()) { diff --git a/editor/project_manager.h b/editor/project_manager.h index 382e9fc8fb..fa878e75a6 100644 --- a/editor/project_manager.h +++ b/editor/project_manager.h @@ -106,7 +106,7 @@ class ProjectManager : public Control { void _on_project_created(const String &dir); void _on_projects_updated(); void _update_scroll_position(const String &dir); - void _scan_dir(DirAccess *da, float pos, float total, List<String> *r_projects); + void _scan_dir(const String &path, List<String> *r_projects); void _install_project(const String &p_zip_path, const String &p_title); diff --git a/main/main.cpp b/main/main.cpp index fb75b4d78f..fdb5bca624 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1197,6 +1197,12 @@ Error Main::setup2(Thread::ID p_main_tid_override) { GLOBAL_DEF("application/config/icon", String()); ProjectSettings::get_singleton()->set_custom_property_info("application/config/icon", PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp")); + GLOBAL_DEF("application/config/macos_native_icon", String()); + ProjectSettings::get_singleton()->set_custom_property_info("application/config/macos_native_icon", PropertyInfo(Variant::STRING, "application/config/macos_native_icon", PROPERTY_HINT_FILE, "*.icns")); + + GLOBAL_DEF("application/config/windows_native_icon", String()); + ProjectSettings::get_singleton()->set_custom_property_info("application/config/windows_native_icon", PropertyInfo(Variant::STRING, "application/config/windows_native_icon", PROPERTY_HINT_FILE, "*.ico")); + InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton()); if (id) { if (bool(GLOBAL_DEF("input_devices/pointing/emulate_touch_from_mouse", false)) && !(editor || project_manager)) { @@ -1747,8 +1753,24 @@ bool Main::start() { ERR_FAIL_COND_V(!scene, false) sml->add_current_scene(scene); +#ifdef OSX_ENABLED + String mac_iconpath = GLOBAL_DEF("application/config/macos_native_icon", "Variant()"); + if (mac_iconpath != "") { + OS::get_singleton()->set_native_icon(mac_iconpath); + hasicon = true; + } +#endif + +#ifdef WINDOWS_ENABLED + String win_iconpath = GLOBAL_DEF("application/config/windows_native_icon", "Variant()"); + if (win_iconpath != "") { + OS::get_singleton()->set_native_icon(win_iconpath); + hasicon = true; + } +#endif + String iconpath = GLOBAL_DEF("application/config/icon", "Variant()"); - if (iconpath != "") { + if ((iconpath != "") && (!hasicon)) { Ref<Image> icon; icon.instance(); if (ImageLoader::load_image(iconpath, icon) == OK) { diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index d2a6f38b01..212966af11 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -186,6 +186,7 @@ public: virtual Size2 get_window_size() const; virtual Size2 get_real_window_size() const; + virtual void set_native_icon(const String &p_filename); virtual void set_icon(const Ref<Image> &p_icon); virtual MainLoop *get_main_loop() const; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index fc97bd4a20..113c6636f0 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1858,6 +1858,31 @@ void OS_OSX::set_window_title(const String &p_title) { [window_object setTitle:[NSString stringWithUTF8String:p_title.utf8().get_data()]]; } +void OS_OSX::set_native_icon(const String &p_filename) { + + FileAccess *f = FileAccess::open(p_filename, FileAccess::READ); + ERR_FAIL_COND(!f); + + Vector<uint8_t> data; + uint32_t len = f->get_len(); + data.resize(len); + f->get_buffer((uint8_t *)&data.write[0], len); + memdelete(f); + + NSData *icon_data = [[[NSData alloc] initWithBytes:&data.write[0] length:len] autorelease]; + if (!icon_data) { + ERR_EXPLAIN("Error reading icon data"); + ERR_FAIL(); + } + NSImage *icon = [[[NSImage alloc] initWithData:icon_data] autorelease]; + if (!icon) { + ERR_EXPLAIN("Error loading icon"); + ERR_FAIL(); + } + + [NSApp setApplicationIconImage:icon]; +} + void OS_OSX::set_icon(const Ref<Image> &p_icon) { Ref<Image> img = p_icon; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 4c6e4e96b5..e3494a1dbf 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -2577,6 +2577,117 @@ String OS_Windows::get_executable_path() const { return s; } +void OS_Windows::set_native_icon(const String &p_filename) { + + FileAccess *f = FileAccess::open(p_filename, FileAccess::READ); + ERR_FAIL_COND(!f); + + ICONDIR *icon_dir = (ICONDIR *)memalloc(sizeof(ICONDIR)); + int pos = 0; + + icon_dir->idReserved = f->get_32(); + pos += sizeof(WORD); + f->seek(pos); + + icon_dir->idType = f->get_32(); + pos += sizeof(WORD); + f->seek(pos); + + if (icon_dir->idType != 1) { + ERR_EXPLAIN("Invalid icon file format!"); + ERR_FAIL(); + } + + icon_dir->idCount = f->get_32(); + pos += sizeof(WORD); + f->seek(pos); + + icon_dir = (ICONDIR *)memrealloc(icon_dir, 3 * sizeof(WORD) + icon_dir->idCount * sizeof(ICONDIRENTRY)); + f->get_buffer((uint8_t *)&icon_dir->idEntries[0], icon_dir->idCount * sizeof(ICONDIRENTRY)); + + int small_icon_index = -1; // Select 16x16 with largest color count + int small_icon_cc = 0; + int big_icon_index = -1; // Select largest + int big_icon_width = 16; + int big_icon_cc = 0; + + for (int i = 0; i < icon_dir->idCount; i++) { + int colors = (icon_dir->idEntries[i].bColorCount == 0) ? 32768 : icon_dir->idEntries[i].bColorCount; + int width = (icon_dir->idEntries[i].bWidth == 0) ? 256 : icon_dir->idEntries[i].bWidth; + if (width == 16) { + if (colors >= small_icon_cc) { + small_icon_index = i; + small_icon_cc = colors; + } + } + if (width >= big_icon_width) { + if (colors >= big_icon_cc) { + big_icon_index = i; + big_icon_width = width; + big_icon_cc = colors; + } + } + } + + if (big_icon_index == -1) { + ERR_EXPLAIN("No valid icons found!"); + ERR_FAIL(); + } + + if (small_icon_index == -1) { + WARN_PRINTS("No small icon found, reusing " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon!"); + small_icon_index = big_icon_index; + small_icon_cc = big_icon_cc; + } + + // Read the big icon + DWORD bytecount_big = icon_dir->idEntries[big_icon_index].dwBytesInRes; + Vector<uint8_t> data_big; + data_big.resize(bytecount_big); + pos = icon_dir->idEntries[big_icon_index].dwImageOffset; + f->seek(pos); + f->get_buffer((uint8_t *)&data_big.write[0], bytecount_big); + HICON icon_big = CreateIconFromResource((PBYTE)&data_big.write[0], bytecount_big, TRUE, 0x00030000); + if (!icon_big) { + ERR_EXPLAIN("Could not create " + itos(big_icon_width) + "x" + itos(big_icon_width) + " @" + itos(big_icon_cc) + " icon, error: " + format_error_message(GetLastError())); + ERR_FAIL(); + } + + // Read the small icon + DWORD bytecount_small = icon_dir->idEntries[small_icon_index].dwBytesInRes; + Vector<uint8_t> data_small; + data_small.resize(bytecount_small); + pos = icon_dir->idEntries[small_icon_index].dwImageOffset; + f->seek(pos); + f->get_buffer((uint8_t *)&data_small.write[0], bytecount_small); + HICON icon_small = CreateIconFromResource((PBYTE)&data_small.write[0], bytecount_small, TRUE, 0x00030000); + if (!icon_small) { + ERR_EXPLAIN("Could not create 16x16 @" + itos(small_icon_cc) + " icon, error: " + format_error_message(GetLastError())); + ERR_FAIL(); + } + + // Online tradition says to be sure last error is cleared and set the small icon first + int err = 0; + SetLastError(err); + + SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)icon_small); + err = GetLastError(); + if (err) { + ERR_EXPLAIN("Error setting ICON_SMALL: " + format_error_message(err)); + ERR_FAIL(); + } + + SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)icon_big); + err = GetLastError(); + if (err) { + ERR_EXPLAIN("Error setting ICON_BIG: " + format_error_message(err)); + ERR_FAIL(); + } + + memdelete(f); + memdelete(icon_dir); +} + void OS_Windows::set_icon(const Ref<Image> &p_icon) { ERR_FAIL_COND(!p_icon.is_valid()); diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 59aeb01b51..0aacbcb9ff 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -58,6 +58,25 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ + +typedef struct { + BYTE bWidth; // Width, in pixels, of the image + BYTE bHeight; // Height, in pixels, of the image + BYTE bColorCount; // Number of colors in image (0 if >=8bpp) + BYTE bReserved; // Reserved ( must be 0) + WORD wPlanes; // Color Planes + WORD wBitCount; // Bits per pixel + DWORD dwBytesInRes; // How many bytes in this resource? + DWORD dwImageOffset; // Where in the file is this image? +} ICONDIRENTRY, *LPICONDIRENTRY; + +typedef struct { + WORD idReserved; // Reserved (must be 0) + WORD idType; // Resource Type (1 for icons) + WORD idCount; // How many images? + ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) +} ICONDIR, *LPICONDIR; + class JoypadWindows; class OS_Windows : public OS { @@ -276,6 +295,8 @@ public: CursorShape get_cursor_shape() const; virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot); void GetMaskBitmaps(HBITMAP hSourceBitmap, COLORREF clrTransparent, OUT HBITMAP &hAndMaskBitmap, OUT HBITMAP &hXorMaskBitmap); + + void set_native_icon(const String &p_filename); void set_icon(const Ref<Image> &p_icon); virtual String get_executable_path() const; diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 4097006b33..e062067248 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -264,7 +264,7 @@ void PathFollow2D::_validate_property(PropertyInfo &property) const { if (path && path->get_curve().is_valid()) max = path->get_curve()->get_baked_length(); - property.hint_string = "0," + rtos(max) + ",0.01,or_greater"; + property.hint_string = "0," + rtos(max) + ",0.01,or_lesser"; } } @@ -306,8 +306,8 @@ void PathFollow2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_lookahead", "lookahead"), &PathFollow2D::set_lookahead); ClassDB::bind_method(D_METHOD("get_lookahead"), &PathFollow2D::get_lookahead); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_greater"), "set_offset", "get_offset"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_greater", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "offset", PROPERTY_HINT_RANGE, "0,10000,0.01,or_lesser"), "set_offset", "get_offset"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_offset", PROPERTY_HINT_RANGE, "0,1,0.0001,or_lesser", PROPERTY_USAGE_EDITOR), "set_unit_offset", "get_unit_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "rotate"), "set_rotate", "is_rotating"); @@ -319,8 +319,24 @@ void PathFollow2D::_bind_methods() { void PathFollow2D::set_offset(float p_offset) { offset = p_offset; - if (path) + if (path) { + if (path->get_curve().is_valid() && path->get_curve()->get_baked_length()) { + float path_length = path->get_curve()->get_baked_length(); + + if (loop) { + while (offset > path_length) + offset -= path_length; + + while (offset < 0) + offset += path_length; + + } else { + offset = CLAMP(offset, 0, path_length); + } + } + _update_transform(); + } _change_notify("offset"); _change_notify("unit_offset"); } diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index d4e242dcb7..138c446fea 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -212,7 +212,7 @@ String CPUParticles::get_configuration_warning() const { get_param_curve(PARAM_ANIM_SPEED).is_valid() || get_param_curve(PARAM_ANIM_OFFSET).is_valid())) { if (warnings != String()) warnings += "\n"; - warnings += "- " + TTR("CPUParticles animation requires the usage of a SpatialMaterial with \"Billboard Particles\" enabled."); + warnings += "- " + TTR("CPUParticles animation requires the usage of a SpatialMaterial whose Billboard Mode is set to \"Particle Billboard\"."); } return warnings; diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 57ab01f7be..156560f802 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -268,7 +268,7 @@ String Particles::get_configuration_warning() const { process->get_param_texture(ParticlesMaterial::PARAM_ANIM_SPEED).is_valid() || process->get_param_texture(ParticlesMaterial::PARAM_ANIM_OFFSET).is_valid())) { if (warnings != String()) warnings += "\n"; - warnings += "- " + TTR("Particles animation requires the usage of a SpatialMaterial with \"Billboard Particles\" enabled."); + warnings += "- " + TTR("Particles animation requires the usage of a SpatialMaterial whose Billboard Mode is set to \"Particle Billboard\"."); } } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index acd2950b4c..ef6bfc2e2d 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -406,6 +406,7 @@ void TextEdit::_update_scrollbars() { cursor.line_ofs = 0; cursor.wrap_ofs = 0; v_scroll->set_value(0); + v_scroll->set_max(0); v_scroll->hide(); } @@ -424,6 +425,7 @@ void TextEdit::_update_scrollbars() { cursor.x_ofs = 0; h_scroll->set_value(0); + h_scroll->set_max(0); h_scroll->hide(); } |