Fix floor change regex (for pomanders)
Not sure how or why that even broke, the string doesn't seem to have changed in the LogMessage sheet. Fixes #18.
This commit is contained in:
parent
8042aee951
commit
58404b9728
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
using Dalamud.Game.Gui;
|
using Dalamud.Game.Gui;
|
||||||
@ -82,14 +83,21 @@ internal sealed class ChatService : IDisposable
|
|||||||
HoardNotOnCurrentFloor = GetLocalizedString(7273),
|
HoardNotOnCurrentFloor = GetLocalizedString(7273),
|
||||||
HoardCofferOpened = GetLocalizedString(7274),
|
HoardCofferOpened = GetLocalizedString(7274),
|
||||||
FloorChanged =
|
FloorChanged =
|
||||||
new Regex("^" + GetLocalizedString(7270).Replace("\u0002 \u0003\ufffd\u0002\u0003", @"(\d+)") +
|
new Regex("^" + GetLocalizedString(7270, true).Replace("\u0002 \u0003\ufffd\u0002\u0003", @"(\d+)") +
|
||||||
"$"),
|
"$"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetLocalizedString(uint id)
|
private string GetLocalizedString(uint id, bool asRawData = false)
|
||||||
{
|
{
|
||||||
return _dataManager.GetExcelSheet<LogMessage>()?.GetRow(id)?.Text?.ToString() ?? "Unknown";
|
var text = _dataManager.GetExcelSheet<LogMessage>()?.GetRow(id)?.Text;
|
||||||
|
if (text == null)
|
||||||
|
return "Unknown";
|
||||||
|
|
||||||
|
if (asRawData)
|
||||||
|
return Encoding.UTF8.GetString(text.RawData);
|
||||||
|
else
|
||||||
|
return text.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class LocalizedChatMessages
|
private sealed class LocalizedChatMessages
|
||||||
|
Loading…
Reference in New Issue
Block a user