fix: handle plots better
This commit is contained in:
parent
544ef9a65b
commit
71ebff5cba
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ internal class MessageWithTerritory {
|
||||||
public Guid Id { get; init; }
|
public Guid Id { get; init; }
|
||||||
public uint Territory { get; init; }
|
public uint Territory { get; init; }
|
||||||
public uint? Ward { get; init; }
|
public uint? Ward { get; init; }
|
||||||
|
public uint? Plot { get; init; }
|
||||||
public float X { get; init; }
|
public float X { get; init; }
|
||||||
public float Y { get; init; }
|
public float Y { get; init; }
|
||||||
public float Z { get; init; }
|
public float Z { get; init; }
|
||||||
|
|
|
@ -155,14 +155,7 @@ internal class Messages : IDisposable {
|
||||||
|
|
||||||
var housing = this.Plugin.Common.Functions.Housing.Location;
|
var housing = this.Plugin.Common.Functions.Housing.Location;
|
||||||
var ward = housing?.Ward;
|
var ward = housing?.Ward;
|
||||||
ushort? plot = null;
|
var plot = housing?.CombinedPlot();
|
||||||
if (housing is { Apartment: { } apt, ApartmentWing: { } wing }) {
|
|
||||||
plot = (ushort) (10_000
|
|
||||||
+ (wing - 1) * 5_000
|
|
||||||
+ apt);
|
|
||||||
} else if (housing?.Plot is { } plotNum) {
|
|
||||||
plot = plotNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.Plugin.Config.DisableTrials && this.Trials.Contains(territory)) {
|
if (this.Plugin.Config.DisableTrials && this.Trials.Contains(territory)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -76,7 +76,13 @@ internal class MessageList : ITab {
|
||||||
|
|
||||||
var loc = $"Location: {territoryName}";
|
var loc = $"Location: {territoryName}";
|
||||||
if (message.Ward != null) {
|
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);
|
ImGui.TextUnformatted(message.Text);
|
||||||
|
|
|
@ -232,7 +232,7 @@ internal class Write : ITab {
|
||||||
var req = new MessageRequest {
|
var req = new MessageRequest {
|
||||||
Territory = this.Plugin.ClientState.TerritoryType,
|
Territory = this.Plugin.ClientState.TerritoryType,
|
||||||
Ward = this.Plugin.Common.Functions.Housing.Location?.Ward,
|
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,
|
X = player.Position.X,
|
||||||
Y = player.Position.Y,
|
Y = player.Position.Y,
|
||||||
Z = player.Position.Z,
|
Z = player.Position.Z,
|
||||||
|
|
Loading…
Reference in New Issue