Remove AutoTranslatePayload text cache

- Lumina lookups aren't that taxing anymore
- Cache wasn't invalidated when the language override changes
This commit is contained in:
Haselnussbomber 2025-09-21 14:00:23 +02:00
parent 374f9fcbd0
commit ce1faa50cf
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1

View file

@ -14,7 +14,6 @@ namespace Dalamud.Game.Text.SeStringHandling.Payloads;
/// </summary> /// </summary>
public class AutoTranslatePayload : Payload, ITextProvider public class AutoTranslatePayload : Payload, ITextProvider
{ {
private string? text;
private ReadOnlySeString payload; private ReadOnlySeString payload;
/// <summary> /// <summary>
@ -77,11 +76,11 @@ public class AutoTranslatePayload : Payload, ITextProvider
{ {
if (this.Group is 100 or 200) if (this.Group is 100 or 200)
{ {
return this.text ??= Service<SeStringEvaluator>.Get().Evaluate(this.payload).ToString(); return Service<SeStringEvaluator>.Get().Evaluate(this.payload).ToString();
} }
// wrap the text in the colored brackets that is uses in-game, since those are not actually part of any of the payloads // wrap the text in the colored brackets that are used in-game, since those are not actually part of any of the fixed macro payload
return this.text ??= $"{(char)SeIconChar.AutoTranslateOpen} {Service<SeStringEvaluator>.Get().Evaluate(this.payload)} {(char)SeIconChar.AutoTranslateClose}"; return $"{(char)SeIconChar.AutoTranslateOpen} {Service<SeStringEvaluator>.Get().Evaluate(this.payload)} {(char)SeIconChar.AutoTranslateClose}";
} }
} }