Commit graph

14 commits

Author SHA1 Message Date
Kamron Batman
c75514cc04
feat: Updates to .NET 9 (#1984)
### Summary

* Bumps to .NET 9 with updated dependencies
* Comparing a value type against null is no longer allowed
* CI/CD now uses the version specified in global.json
* Serialization generator updated to .NET 9 with bug fixes, fixes to turkish language, and parallelization
2024-12-08 10:16:34 -08:00
Kamron Batman
ac06a0d52d
fix: Adds BWT cliloc support for v7.0.104+ (#1982) 2024-10-19 22:01:35 -07:00
Kamron Batman
6cb18f87fa
fix: Simplifies create food and localizes. Fixes localization fallback (#1721) 2024-04-05 19:45:42 -07:00
Kamron Batman
b5342a82e1
fix: Fixes language casing and adds localization reset command (#1703) 2024-03-09 11:02:56 -08:00
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
47d427ed6e
fix: Adds cliloc replacement support (#1014) 2022-05-09 21:10:58 -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