diff --git a/client/FodyWeavers.xml b/client/FodyWeavers.xml old mode 100755 new mode 100644 diff --git a/client/HousingLocationExt.cs b/client/HousingLocationExt.cs new file mode 100755 index 0000000..181c329 --- /dev/null +++ b/client/HousingLocationExt.cs @@ -0,0 +1,19 @@ +using XivCommon.Functions.Housing; + +namespace OrangeGuidanceTomestone; + +internal static class HousingLocationExt { + internal static ushort? CombinedPlot(this HousingLocation housing) { + if (housing is { Apartment: { } apt, ApartmentWing: { } wing }) { + return (ushort) (10_000 + + (wing - 1) * 5_000 + + apt); + } + + if (housing.Plot is { } plotNum) { + return plotNum; + } + + return null; + } +} diff --git a/client/Message.cs b/client/Message.cs index eaa20cf..89c4b42 100644 --- a/client/Message.cs +++ b/client/Message.cs @@ -31,6 +31,7 @@ internal class MessageWithTerritory { public Guid Id { get; init; } public uint Territory { get; init; } public uint? Ward { get; init; } + public uint? Plot { get; init; } public float X { get; init; } public float Y { get; init; } public float Z { get; init; } diff --git a/client/Messages.cs b/client/Messages.cs index b5cdab0..6fd6656 100644 --- a/client/Messages.cs +++ b/client/Messages.cs @@ -155,14 +155,7 @@ internal class Messages : IDisposable { var housing = this.Plugin.Common.Functions.Housing.Location; var ward = housing?.Ward; - ushort? plot = null; - if (housing is { Apartment: { } apt, ApartmentWing: { } wing }) { - plot = (ushort) (10_000 - + (wing - 1) * 5_000 - + apt); - } else if (housing?.Plot is { } plotNum) { - plot = plotNum; - } + var plot = housing?.CombinedPlot(); if (this.Plugin.Config.DisableTrials && this.Trials.Contains(territory)) { return; diff --git a/client/OrangeGuidanceTomestone.yaml b/client/OrangeGuidanceTomestone.yaml old mode 100755 new mode 100644 diff --git a/client/Ui/MainWindowTabs/MessageList.cs b/client/Ui/MainWindowTabs/MessageList.cs index c7bb790..bcab869 100644 --- a/client/Ui/MainWindowTabs/MessageList.cs +++ b/client/Ui/MainWindowTabs/MessageList.cs @@ -76,7 +76,13 @@ internal class MessageList : ITab { var loc = $"Location: {territoryName}"; if (message.Ward != null) { - loc += $" (Ward {message.Ward.Value})"; + loc += $" (Ward {message.Ward.Value}"; + + if (message.Plot != null) { + loc += $", Plot {message.Plot.Value}"; + } + + loc += ")"; } ImGui.TextUnformatted(message.Text); diff --git a/client/Ui/MainWindowTabs/Write.cs b/client/Ui/MainWindowTabs/Write.cs index 0bab9e9..765a754 100644 --- a/client/Ui/MainWindowTabs/Write.cs +++ b/client/Ui/MainWindowTabs/Write.cs @@ -232,7 +232,7 @@ internal class Write : ITab { var req = new MessageRequest { Territory = this.Plugin.ClientState.TerritoryType, Ward = this.Plugin.Common.Functions.Housing.Location?.Ward, - Plot = this.Plugin.Common.Functions.Housing.Location?.Plot, + Plot = this.Plugin.Common.Functions.Housing.Location?.CombinedPlot(), X = player.Position.X, Y = player.Position.Y, Z = player.Position.Z,