Commit Graph

212 Commits

Author SHA1 Message Date
7a13cf9aeb Merge pull request #75510 from SilicDev/string_erase
Reimplement `String.erase()` as immutable method
2023-05-05 10:03:49 -07:00
610877e326 Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
2023-05-05 09:56:48 -07:00
6fa4f71ca6 Reimplement String.erase 2023-05-04 00:52:35 +02:00
6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +02:00
36bedd341a Fix misuses of error macros 2023-04-18 10:20:48 +03:00
8950943356 Optimize Object::get_class_name
* Run the static function once per class instead of one per instance.
* Saves some memory in Object derived classes.
2023-04-08 19:25:50 +02:00
223ce4fcb9 Optimize Node::add_child validation
Adding 10k nodes is almost twice as fast.
2023-04-07 13:18:47 +02:00
ca0feabbb0 add hex_decode() to String 2023-04-05 19:44:00 +07:00
d72b563250 Add GDScript to_wchar_buffer and get_string_from_wchar functions. 2023-03-21 15:39:54 +02:00
82d7923c65 Improve layout direction/locale automatic selection. 2023-02-22 08:37:14 +02:00
52b4014362 Don't warn when using TTRN() in a language without plurals 2023-02-11 13:21:57 +08:00
ab4a7b2b77 Merge pull request #72547 from MewPurPur/string-split-fix
Fix String.split() with empty string and delimeter
2023-02-09 16:12:57 +01:00
5d7e003b29 Prepare for moving editor and classref translations to godot-editor-l10n repo
- Separate editor interface and property translations.
- Add property translation in TranslationServer.
- The split and merge of the POT/PO/Makefiles and extract scripts is done
  directly in godot-editor-l10n, the files will be removed in the next commit.
- Remove the hardcoded "to_include" lists from the SCsub, we'll only commit the
  files which are ready to inclue.
2023-02-07 14:20:40 +01:00
82c52eab6c StringName: fix returning dangling data from char constructor.
Fixes a copy paste mistake in the `StringName(const char *,bool)` constructor,
to match the same form as the other two constrcutors.
This fixes a case where this constructor can return a dangling pointer and cause use-after-free.
2023-02-06 07:16:55 -08:00
57e39d0ce9 Fix String.split() with empty string and delimeter 2023-02-02 01:34:11 +01:00
0fcdf48f83 Remove unused has_slashes from NodePath 2023-02-01 11:32:39 -06:00
39922d7167 Handle gltf binary
[ Ignore and Warn | Extract Textures (default) | Optimize Loading Embedded as Basisu ]

Enable compressed mip maps from Basis Universal for faster compressions.

Increase the quality of Basis to avoid corruption.

To keep compatibility use the first mip of the previous internal Godot format.

Because texture names may have invalid filename characters, adds String::validate_filename to sanitize filenames for import pipeline use.
2023-01-27 02:02:02 -08:00
163f6f5fe8 Merge pull request #68429 from KoBeWi/PropertySettings
Add PropertyInfo overload for GLOBAL_DEF
2023-01-06 22:59:29 +01:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
522d4243bf Add missing != operator to StringName 2022-12-20 17:25:54 +03:00
207e52c161 Fix String::word_wrap() for long words
- Changes `TextServer.string_get_word_breaks()`
  - Returns pairs of boundary start and end offsets
  - Accepts `chars_per_line` to return line breaks
- Removes `String::word_wrap()`

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-12-16 13:18:57 +08:00
7c6b659bd7 Add PropertyInfo overload for GLOBAL_DEF 2022-12-11 21:36:48 +01:00
a479f5af22 Improve logic for detecting and tracking extensions 2022-11-24 21:48:16 +11:00
e791f4fce2 Double precision of String.split_floats 2022-11-20 12:29:50 +01:00
1959284769 Merge pull request #68229 from Mickeon/c-escape-hell
Remove "?" from String.c_escape()
2022-11-14 23:24:35 +01:00
3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
5b3a03bf5c Merge pull request #68448 from bruvzg/font_imp_tr
[Font] Add an import option to pre-render all glyphs required for the translation.
2022-11-14 11:12:01 +01:00
35528b800c [Font] Add an import option to pre-render all glyphs required for the translation. 2022-11-10 10:43:15 +02:00
75e617c05d fix a buffer overflow due to a misbehaving vcrt snprintf call on String::num, at core/string/ustring.cpp 2022-11-09 10:25:52 -03:00
8a47a12207 Add support for empty delimiter in String.split 2022-11-04 15:09:12 +01:00
521d8a5d24 Remove "?" from String.c_escape() 2022-11-03 19:52:21 +01:00
0e9878b12a Merge pull request #67931 from bruvzg/locale_no_def
Do not auto add default script and country codes to the locale.
2022-10-31 14:30:18 +01:00
5947f22be9 Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
ec3c4fcba9 Do not auto add default script and country codes to the locale. 2022-10-27 09:31:05 +03:00
56fa8f1d58 Fix localize_path with custom protocol identifiers 2022-10-20 14:12:25 +02:00
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
c60ac64e8f Fix big negative numbers printing incorrect decimals in num_real 2022-10-15 17:57:54 -05:00
bf1a40c168 Make String.simplify_path keep the protocol identifier for urls 2022-10-13 12:23:49 +02:00
58eff50bf1 Merge pull request #64268 from timothyqiu/is-finite
Add `is_finite` method for checking built-in types
2022-10-11 09:25:46 +02:00
785e5880b3 Fix simplify_path() breaking uid:// 2022-10-09 14:22:13 +02:00
5da515773d Add is_finite method for checking built-in types 2022-10-08 13:25:08 +08:00
0103af1ddd Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
cf6978f286 Merge pull request #64833 from MarcusElg/naninfprinting
Improve string formatting (%f and %v) for inf and nan
2022-10-03 09:23:12 +02:00
0e53dd642c Fix MSVC warning C4706: assignment within conditional expression
Part of #66537.
2022-09-28 16:05:07 +02:00
49fcf4ffad Style: Cleanup header guards for consistency
Fix file names for {Static,Lightmap}RaycasterEmbree.
2022-09-26 13:51:17 +02:00
ec8084d87f HarfBuzz: Update to version 5.2.0, add new Unicode 15 blocks and scripts. 2022-09-17 23:19:11 +03:00
10bd79cc6a Merge pull request #64714 from Chaosus/string_remove_erase 2022-09-01 22:57:22 +02:00
d4555ef5fb Add String.to_{camel,pascal,snake}_case methods 2022-08-30 12:36:24 +03:00
10a56981dc Rename String plus_file to path_join 2022-08-29 19:38:13 -05:00
b21460981d Improve string formatting for %f and %v for inf and nan 2022-08-25 07:41:21 +02:00