mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-02 13:53:40 +01:00
AutoTranslatePayload: Use Alias for TextCommands (#1809)
This commit is contained in:
parent
d5d9942d91
commit
9fcb890d20
1 changed files with 9 additions and 1 deletions
|
|
@ -150,7 +150,7 @@ public class AutoTranslatePayload : Payload, ITextProvider
|
||||||
"PetMirage" => this.DataResolver.GetExcelSheet<PetMirage>().GetRow(this.key).Name,
|
"PetMirage" => this.DataResolver.GetExcelSheet<PetMirage>().GetRow(this.key).Name,
|
||||||
"PlaceName" => this.DataResolver.GetExcelSheet<PlaceName>().GetRow(this.key).Name,
|
"PlaceName" => this.DataResolver.GetExcelSheet<PlaceName>().GetRow(this.key).Name,
|
||||||
"Race" => this.DataResolver.GetExcelSheet<Race>().GetRow(this.key).Masculine,
|
"Race" => this.DataResolver.GetExcelSheet<Race>().GetRow(this.key).Masculine,
|
||||||
"TextCommand" => this.DataResolver.GetExcelSheet<TextCommand>().GetRow(this.key).Command,
|
"TextCommand" => this.ResolveTextCommand(),
|
||||||
"Tribe" => this.DataResolver.GetExcelSheet<Tribe>().GetRow(this.key).Masculine,
|
"Tribe" => this.DataResolver.GetExcelSheet<Tribe>().GetRow(this.key).Masculine,
|
||||||
"Weather" => this.DataResolver.GetExcelSheet<Weather>().GetRow(this.key).Name,
|
"Weather" => this.DataResolver.GetExcelSheet<Weather>().GetRow(this.key).Name,
|
||||||
_ => throw new Exception(actualTableName),
|
_ => throw new Exception(actualTableName),
|
||||||
|
|
@ -166,4 +166,12 @@ public class AutoTranslatePayload : Payload, ITextProvider
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Lumina.Text.SeString ResolveTextCommand()
|
||||||
|
{
|
||||||
|
// TextCommands prioritize the `Alias` field, if it not empty
|
||||||
|
// Example for this is /rangerpose2l which becomes /blackrangerposeb in chat
|
||||||
|
var result = this.DataResolver.GetExcelSheet<TextCommand>().GetRow(this.key);
|
||||||
|
return result.Alias.Payloads.Count > 0 ? result.Alias : result.Command;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue