Reimplement classjob article prefix
This commit is contained in:
@@ -160,7 +160,18 @@ internal static class ClassJobUtils
|
|||||||
public static string GetName(this ClassJob me)
|
public static string GetName(this ClassJob me)
|
||||||
{
|
{
|
||||||
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex())!;
|
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex())!;
|
||||||
return CultureInfo.InvariantCulture.TextInfo.ToTitleCase(job.Name.ToDalamudString().TextValue);
|
return job.Name.ToDalamudString().TextValue.ToLowerInvariant();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetNameArticle(this ClassJob me)
|
||||||
|
{
|
||||||
|
var job = LuminaSheets.ClassJobSheet.GetRow(me.GetClassJobIndex())!;
|
||||||
|
if (job.SheetLanguage == Lumina.Data.Language.English)
|
||||||
|
{
|
||||||
|
if (me is ClassJob.Alchemist or ClassJob.Armorer)
|
||||||
|
return "an";
|
||||||
|
}
|
||||||
|
return "a";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetAbbreviation(this ClassJob me)
|
public static string GetAbbreviation(this ClassJob me)
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
{
|
{
|
||||||
case CraftableStatus.LockedClassJob:
|
case CraftableStatus.LockedClassJob:
|
||||||
{
|
{
|
||||||
ImGuiUtils.TextCentered($"You do not have {RecipeData.ClassJob.GetName().ToLowerInvariant()} unlocked.");
|
ImGuiUtils.TextCentered($"You do not have {RecipeData.ClassJob.GetName()} unlocked.");
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
var unlockQuest = RecipeData.ClassJob.GetUnlockQuest();
|
var unlockQuest = RecipeData.ClassJob.GetUnlockQuest();
|
||||||
var (questGiver, questTerritory, questLocation, mapPayload) = ResolveLevelData(unlockQuest.IssuerLocation.Row);
|
var (questGiver, questTerritory, questLocation, mapPayload) = ResolveLevelData(unlockQuest.IssuerLocation.Row);
|
||||||
@@ -503,11 +503,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
break;
|
break;
|
||||||
case CraftableStatus.WrongClassJob:
|
case CraftableStatus.WrongClassJob:
|
||||||
{
|
{
|
||||||
var fullClassName = RecipeData.ClassJob.GetName().ToLowerInvariant();
|
ImGuiUtils.TextCentered($"You are not {RecipeData.ClassJob.GetNameArticle()} {RecipeData.ClassJob.GetName()}.");
|
||||||
var classArticle = "a";
|
|
||||||
if (fullClassName == "Alchemist" || fullClassName == "Armorer")
|
|
||||||
classArticle = "an";
|
|
||||||
ImGuiUtils.TextCentered($"You are not {classArticle} {fullClassName}.");
|
|
||||||
var gearsetId = GetGearsetForJob(RecipeData.ClassJob);
|
var gearsetId = GetGearsetForJob(RecipeData.ClassJob);
|
||||||
if (gearsetId.HasValue)
|
if (gearsetId.HasValue)
|
||||||
{
|
{
|
||||||
@@ -517,7 +513,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
ImGuiUtils.Tooltip($"Swap to gearset {gearsetId + 1}");
|
ImGuiUtils.Tooltip($"Swap to gearset {gearsetId + 1}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ImGuiUtils.TextCentered($"You do not have any {RecipeData.ClassJob.GetName().ToLowerInvariant()} gearsets.");
|
ImGuiUtils.TextCentered($"You do not have any {RecipeData.ClassJob.GetName()} gearsets.");
|
||||||
ImGui.Dummy(default);
|
ImGui.Dummy(default);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user