mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33: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.Data;
|
||||||
using Dalamud.Game;
|
using Dalamud.Game;
|
||||||
using Dalamud.Game.Text;
|
using Dalamud.Game.Text;
|
||||||
|
|
||||||
using Lumina.Excel.Sheets;
|
using Lumina.Excel.Sheets;
|
||||||
using Lumina.Text;
|
using Lumina.Text;
|
||||||
using Lumina.Text.ReadOnly;
|
using Lumina.Text.ReadOnly;
|
||||||
|
|
@ -125,10 +126,15 @@ public static class ItemUtil
|
||||||
|
|
||||||
if (IsEventItem(itemId))
|
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
|
return dataManager
|
||||||
.GetExcelSheet<EventItem>(language)
|
.GetExcelSheet<EventItem>(language)
|
||||||
.TryGetRow(itemId, out var eventItem)
|
.TryGetRow(itemId, out var eventItem)
|
||||||
? eventItem.Name
|
? (useSingular ? eventItem.Singular : eventItem.Name)
|
||||||
: default;
|
: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue