Kamron Batman
8389bfacfe
chore: Updates copyright ( #1448 )
2023-08-09 09:09:26 -07:00
mdodkins
a9a2a89908
feat: Customize expansion and set maps on first boot ( #1425 )
2023-07-31 20:46:49 -07:00
Kamron Batman
f24c6a08dd
fix: Fixes string interpolation in value string builder ( #1339 )
2023-02-13 23:09:50 -08:00
Kamron Batman
2fb660040b
fix: Cleans up namespaces ( #1069 )
2022-06-15 19:52:23 -07:00
Kamron Batman
5f00330a66
fix: Adds optimized formatter for clilocs ( #1045 )
...
Adds an optimized formatter for localization. Example:
```cs
string localizationText = Localization.Format(1050039, "enu", $"{m_Amount}\t{LabelNumber:#}");
```
Fixes #1044
2022-06-04 11:53:32 -07:00
Kamron Batman
87b63b38a5
fix: Eliminates string allocations while writing gump packets ( #1017 )
...
* Introduces `RawInterpolatedStringHandler` which is exactly the same as `DefaultInterpolatedStringHandler` except it _unsafely exposes_ it's `ReadOnlySpan<char>` buffer. This is useful for writing the string's data without actually building the string.
* Uses this new string interpolation handler in `SpanWriter` to eliminate intermediate strings built. This is immensely useful in eliminating string allocations in writing Gump packets.
2022-05-10 18:50:23 -07:00
Kamron Batman
097c0143b0
fix: Fixes missing localization interpolation handler ( #1016 )
2022-05-10 00:42:59 -07:00
Kamron Batman
8031de4738
fix: Fixes string format of cliloc arguments ( #1015 )
2022-05-10 00:37:07 -07:00
Kamron Batman
be7da3a3dc
feat: Adds cliloc support and fixes valuestringbuilder ctor ( #1013 )
...
- [X] Adds cliloc support using the following API:
```cs
public static class Localization
{
string GetText(int number);
string GetText(int number, string lang);
string Format(int number, params object[] args);
string Format(int number, string lang, params object[] args);
string Format(int number, $"{arg1}{arg2}{arg3}");
string Format(int number, lang, $"{arg1}{arg2}{arg3}");
bool TryGetLocalization(int number, out LocalizationEntry entry);
bool TryGetLocalization(int number, string lang, out LocalizationEntry entry);
}
public class LocalizationEntry
{
string Language { get; }
string Number { get; }
string Text { get; }
string?[] TextSlices { get; } // Used for string building
string StringFormatter { get; }
string Format(params object[] args);
string Format($"{arg1}{arg2}{arg3}");
}
```
- [X] Fixes a bug with ValueStringBuilder and default initialization size
- [X] Optimizes ValueStringBuilder to use `ISpanFormattable`
- [X] Adds `Append<T>(T value);` support ValueStringBuilder
- [X] Adds `Append($"");` string interpolation support to ValueStringBuider
2022-05-08 21:24:32 -07:00