mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 21:03:43 +01:00
fix: EventItem name for Japanese client.
This commit is contained in:
parent
52166e4b9e
commit
3c8cef06dd
1 changed files with 7 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ using System.Runtime.CompilerServices;
|
|||
using Dalamud.Data;
|
||||
using Dalamud.Game;
|
||||
using Dalamud.Game.Text;
|
||||
|
||||
using Lumina.Excel.Sheets;
|
||||
using Lumina.Text;
|
||||
using Lumina.Text.ReadOnly;
|
||||
|
|
@ -125,10 +126,15 @@ public static class ItemUtil
|
|||
|
||||
if (IsEventItem(itemId))
|
||||
{
|
||||
// Only English, German, and French have a Name field.
|
||||
// For other languages, the Name is an empty string, and the Singular field should be used instead.
|
||||
language ??= dataManager.Language;
|
||||
var useSingular = language is not (ClientLanguage.English or ClientLanguage.German or ClientLanguage.French);
|
||||
|
||||
return dataManager
|
||||
.GetExcelSheet<EventItem>(language)
|
||||
.TryGetRow(itemId, out var eventItem)
|
||||
? eventItem.Name
|
||||
? (useSingular ? eventItem.Singular : eventItem.Name)
|
||||
: default;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue