From 1248814bf7bf24ef666c125fedd478961d03f5f1 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 30 Sep 2021 14:32:13 -0400 Subject: [PATCH] refactor: pull CharaMakeName into constant --- NominaOcculta/NameRepository.cs | 4 ++-- NominaOcculta/Util.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NominaOcculta/NameRepository.cs b/NominaOcculta/NameRepository.cs index dee9220..5d8b837 100755 --- a/NominaOcculta/NameRepository.cs +++ b/NominaOcculta/NameRepository.cs @@ -30,7 +30,7 @@ namespace NominaOcculta { this._numRaces = this.Plugin.DataManager.GetExcelSheet()!.Count(row => row.RowId != 0); - this.Plugin.Functions.LoadSheet("CharaMakeName"); + this.Plugin.Functions.LoadSheet(Util.SheetName); this.Plugin.ClientState.Login += this.OnLogin; for (var race = (byte) 1; race <= this._numRaces; race++) { @@ -53,7 +53,7 @@ namespace NominaOcculta { // The game unloads the CharaMakeName sheet after logging in. // We need this sheet to generate names, so we load it again. if (this._loadSheetWatch.IsRunning && this._loadSheetWatch.Elapsed > TimeSpan.FromSeconds(3)) { - this.Plugin.Functions.LoadSheet("CharaMakeName"); + this.Plugin.Functions.LoadSheet(Util.SheetName); this._loadSheetWatch.Reset(); } diff --git a/NominaOcculta/Util.cs b/NominaOcculta/Util.cs index b3b4aaa..09ba8f0 100755 --- a/NominaOcculta/Util.cs +++ b/NominaOcculta/Util.cs @@ -6,6 +6,8 @@ using Dalamud.Game.Text.SeStringHandling.Payloads; namespace NominaOcculta { internal static class Util { + internal const string SheetName = "CharaMakeName"; + internal static bool ContainsPlayerName(this SeString text, string name) { foreach (var payload in text.Payloads) { switch (payload) {