refactor: pull CharaMakeName into constant

This commit is contained in:
Anna 2021-09-30 14:32:13 -04:00
parent f5ac3c419f
commit 1248814bf7
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,7 @@ namespace NominaOcculta {
this._numRaces = this.Plugin.DataManager.GetExcelSheet<Race>()!.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();
}

View File

@ -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) {