mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 04:13:40 +01:00
Merge pull request #2522 from Loskh/fix_item_name
fix: EventItem name for Japanese client.
This commit is contained in:
commit
05beea003c
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