From 3e950b09fe7baa4ff4748f433893187a82078d44 Mon Sep 17 00:00:00 2001 From: Infi Date: Sun, 30 Jun 2024 00:18:47 +0200 Subject: [PATCH] Update MarketBoard related packet structs (#1868) * Update MarketBoardHistory * Update MarketBoardCurrentOfferings * small fix * Update other structs & update widget * Mark obsolete fields as internal --- .../IMarketBoardCurrentOfferings.cs | 57 +++++++---------- .../Network/Structures/IMarketBoardHistory.cs | 16 ++--- .../Structures/IMarketBoardPurchase.cs | 4 +- .../Structures/IMarketBoardPurchaseHandler.cs | 25 ++++++-- .../Network/Structures/IMarketTaxRates.cs | 26 +++++--- .../Structures/MarketBoardCurrentOfferings.cs | 62 ++++++++++--------- .../Network/Structures/MarketBoardHistory.cs | 47 +++++--------- .../Network/Structures/MarketBoardPurchase.cs | 4 +- .../Structures/MarketBoardPurchaseHandler.cs | 39 +++++++++--- .../Game/Network/Structures/MarketTaxRates.cs | 25 ++++++-- .../Windows/Data/Widgets/MarketBoardWidget.cs | 29 ++++++--- 11 files changed, 187 insertions(+), 147 deletions(-) diff --git a/Dalamud/Game/Network/Structures/IMarketBoardCurrentOfferings.cs b/Dalamud/Game/Network/Structures/IMarketBoardCurrentOfferings.cs index bbb7fdd73..3c50950a6 100644 --- a/Dalamud/Game/Network/Structures/IMarketBoardCurrentOfferings.cs +++ b/Dalamud/Game/Network/Structures/IMarketBoardCurrentOfferings.cs @@ -12,20 +12,10 @@ public interface IMarketBoardCurrentOfferings /// IReadOnlyList ItemListings { get; } - /// - /// Gets the listing end index. - /// - int ListingIndexEnd { get; } - - /// - /// Gets the listing start index. - /// - int ListingIndexStart { get; } - /// /// Gets the request ID. /// - int RequestId { get; } + public int RequestId { get; } } /// @@ -36,82 +26,77 @@ public interface IMarketBoardItemListing /// /// Gets the artisan ID. /// - ulong ArtisanId { get; } + public ulong ArtisanId { get; } /// /// Gets the item ID. /// - uint ItemId { get; } + public uint ItemId { get; } /// /// Gets a value indicating whether the item is HQ. /// - bool IsHq { get; } + public bool IsHq { get; } /// /// Gets the item quantity. /// - uint ItemQuantity { get; } - - /// - /// Gets the time this offering was last reviewed. - /// - DateTime LastReviewTime { get; } + public uint ItemQuantity { get; } /// /// Gets the listing ID. /// - ulong ListingId { get; } + public ulong ListingId { get; } /// /// Gets the list of materia attached to this item. /// - IReadOnlyList Materia { get; } + public IReadOnlyList Materia { get; } /// /// Gets the amount of attached materia. /// - int MateriaCount { get; } + public int MateriaCount { get; } /// /// Gets a value indicating whether this item is on a mannequin. /// - bool OnMannequin { get; } - - /// - /// Gets the player name. - /// - string PlayerName { get; } + public bool OnMannequin { get; } /// /// Gets the price per unit. /// - uint PricePerUnit { get; } + public uint PricePerUnit { get; } /// /// Gets the city ID of the retainer selling the item. /// - int RetainerCityId { get; } + public int RetainerCityId { get; } /// /// Gets the ID of the retainer selling the item. /// - ulong RetainerId { get; } + public ulong RetainerId { get; } /// /// Gets the name of the retainer. /// - string RetainerName { get; } + public string RetainerName { get; } /// - /// Gets the stain or applied dye of the item. + /// Gets the first stain or applied dye of the item. /// - int StainId { get; } + public int Stain1Id { get; } + + /// + /// Gets the second stain or applied dye of the item. + /// + public int Stain2Id { get; } /// /// Gets the total tax. /// - uint TotalTax { get; } + public uint TotalTax { get; } } /// diff --git a/Dalamud/Game/Network/Structures/IMarketBoardHistory.cs b/Dalamud/Game/Network/Structures/IMarketBoardHistory.cs index 650c68ca0..e3cd8982a 100644 --- a/Dalamud/Game/Network/Structures/IMarketBoardHistory.cs +++ b/Dalamud/Game/Network/Structures/IMarketBoardHistory.cs @@ -10,12 +10,12 @@ public interface IMarketBoardHistory /// /// Gets the item ID. /// - uint ItemId { get; } + public uint ItemId { get; } /// /// Gets the list of individual item history listings. /// - IReadOnlyList HistoryListings { get; } + public IReadOnlyList HistoryListings { get; } } /// @@ -26,30 +26,30 @@ public interface IMarketBoardHistoryListing /// /// Gets the buyer's name. /// - string BuyerName { get; } + public string BuyerName { get; } /// /// Gets a value indicating whether the item is HQ. /// - bool IsHq { get; } + public bool IsHq { get; } /// /// Gets a value indicating whether the item is on a mannequin. /// - bool OnMannequin { get; } + public bool OnMannequin { get; } /// /// Gets the time of purchase. /// - DateTime PurchaseTime { get; } + public DateTime PurchaseTime { get; } /// /// Gets the quantity. /// - uint Quantity { get; } + public uint Quantity { get; } /// /// Gets the sale price. /// - uint SalePrice { get; } + public uint SalePrice { get; } } diff --git a/Dalamud/Game/Network/Structures/IMarketBoardPurchase.cs b/Dalamud/Game/Network/Structures/IMarketBoardPurchase.cs index cc12c3492..40ffb0de5 100644 --- a/Dalamud/Game/Network/Structures/IMarketBoardPurchase.cs +++ b/Dalamud/Game/Network/Structures/IMarketBoardPurchase.cs @@ -9,10 +9,10 @@ public interface IMarketBoardPurchase /// /// Gets the item ID of the item that was purchased. /// - uint CatalogId { get; } + public uint CatalogId { get; } /// /// Gets the quantity of the item that was purchased. /// - uint ItemQuantity { get; } + public uint ItemQuantity { get; } } diff --git a/Dalamud/Game/Network/Structures/IMarketBoardPurchaseHandler.cs b/Dalamud/Game/Network/Structures/IMarketBoardPurchaseHandler.cs index 94994e27e..ebb409cfb 100644 --- a/Dalamud/Game/Network/Structures/IMarketBoardPurchaseHandler.cs +++ b/Dalamud/Game/Network/Structures/IMarketBoardPurchaseHandler.cs @@ -9,25 +9,40 @@ public interface IMarketBoardPurchaseHandler /// /// Gets the object ID of the retainer associated with the sale. /// - ulong RetainerId { get; } + public ulong RetainerId { get; } /// /// Gets the object ID of the item listing. /// - ulong ListingId { get; } + public ulong ListingId { get; } /// /// Gets the item ID of the item that was purchased. /// - uint CatalogId { get; } + public uint CatalogId { get; } /// /// Gets the quantity of the item that was purchased. /// - uint ItemQuantity { get; } + public uint ItemQuantity { get; } /// /// Gets the unit price of the item. /// - uint PricePerUnit { get; } + public uint PricePerUnit { get; } + + /// + /// Gets a value indicating whether the item is HQ. + /// + public bool IsHq { get; } + + /// + /// Gets the total tax. + /// + public uint TotalTax { get; } + + /// + /// Gets the city ID of the retainer selling the item. + /// + public int RetainerCityId { get; } } diff --git a/Dalamud/Game/Network/Structures/IMarketTaxRates.cs b/Dalamud/Game/Network/Structures/IMarketTaxRates.cs index 555b482ad..f0e9bf2a1 100644 --- a/Dalamud/Game/Network/Structures/IMarketTaxRates.cs +++ b/Dalamud/Game/Network/Structures/IMarketTaxRates.cs @@ -8,40 +8,50 @@ public interface IMarketTaxRates /// /// Gets the category of this ResultDialog packet. /// - uint Category { get; } + public uint Category { get; } /// /// Gets the tax rate in Limsa Lominsa. /// - uint LimsaLominsaTax { get; } + public uint LimsaLominsaTax { get; } /// /// Gets the tax rate in Gridania. /// - uint GridaniaTax { get; } + public uint GridaniaTax { get; } /// /// Gets the tax rate in Ul'dah. /// - uint UldahTax { get; } + public uint UldahTax { get; } /// /// Gets the tax rate in Ishgard. /// - uint IshgardTax { get; } + public uint IshgardTax { get; } /// /// Gets the tax rate in Kugane. /// - uint KuganeTax { get; } + public uint KuganeTax { get; } /// /// Gets the tax rate in the Crystarium. /// - uint CrystariumTax { get; } + public uint CrystariumTax { get; } /// /// Gets the tax rate in the Crystarium. /// - uint SharlayanTax { get; } + public uint SharlayanTax { get; } + + /// + /// Gets the tax rate in Tuliyollal. + /// + public uint TuliyollalTax { get; } + + /// + /// Gets until when these values are valid. + /// + public DateTime ValidUntil { get; } } diff --git a/Dalamud/Game/Network/Structures/MarketBoardCurrentOfferings.cs b/Dalamud/Game/Network/Structures/MarketBoardCurrentOfferings.cs index 18c59e4be..96fafe6b6 100644 --- a/Dalamud/Game/Network/Structures/MarketBoardCurrentOfferings.cs +++ b/Dalamud/Game/Network/Structures/MarketBoardCurrentOfferings.cs @@ -17,22 +17,12 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings /// Gets the list of individual item listings. /// IReadOnlyList IMarketBoardCurrentOfferings.ItemListings => this.InternalItemListings; - - /// - /// Gets the listing end index. - /// - public int ListingIndexEnd { get; internal set; } - - /// - /// Gets the listing start index. - /// - public int ListingIndexStart { get; internal set; } /// /// Gets the request ID. /// public int RequestId { get; internal set; } - + /// /// Gets or sets the internal read-write list of marketboard item listings. /// @@ -43,7 +33,7 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings /// /// Address to read. /// A new object. - public static unsafe MarketBoardCurrentOfferings Read(IntPtr dataPtr) + public static unsafe MarketBoardCurrentOfferings Read(nint dataPtr) { var output = new MarketBoardCurrentOfferings(); @@ -60,19 +50,17 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings listingEntry.RetainerId = reader.ReadUInt64(); listingEntry.RetainerOwnerId = reader.ReadUInt64(); listingEntry.ArtisanId = reader.ReadUInt64(); + listingEntry.PricePerUnit = reader.ReadUInt32(); listingEntry.TotalTax = reader.ReadUInt32(); listingEntry.ItemQuantity = reader.ReadUInt32(); listingEntry.CatalogId = reader.ReadUInt32(); - listingEntry.LastReviewTime = DateTimeOffset.UtcNow.AddSeconds(-reader.ReadUInt16()).DateTime; - reader.ReadUInt16(); // container - reader.ReadUInt32(); // slot - reader.ReadUInt16(); // durability - reader.ReadUInt16(); // spiritbond + reader.ReadUInt16(); // Slot + reader.ReadUInt16(); // Durability + reader.ReadUInt16(); // Spiritbond var materiaList = new List(); - for (var materiaIndex = 0; materiaIndex < 5; materiaIndex++) { var materiaVal = reader.ReadUInt16(); @@ -88,27 +76,28 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings listingEntry.Materia = materiaList; - reader.ReadUInt16(); - reader.ReadUInt32(); + reader.ReadBytes(0x6); // Padding + + listingEntry.RetainerName = Encoding.UTF8.GetString(reader.ReadBytes(0x20)).TrimEnd('\u0000'); + reader.ReadBytes(0x20); // Empty Buffer, was PlayerName pre 7.0 - listingEntry.RetainerName = Encoding.UTF8.GetString(reader.ReadBytes(32)).TrimEnd('\u0000'); - listingEntry.PlayerName = Encoding.UTF8.GetString(reader.ReadBytes(32)).TrimEnd('\u0000'); listingEntry.IsHq = reader.ReadBoolean(); listingEntry.MateriaCount = reader.ReadByte(); listingEntry.OnMannequin = reader.ReadBoolean(); listingEntry.RetainerCityId = reader.ReadByte(); - listingEntry.StainId = reader.ReadUInt16(); - reader.ReadUInt16(); - reader.ReadUInt32(); + listingEntry.Stain1Id = reader.ReadByte(); + listingEntry.Stain2Id = reader.ReadByte(); + + reader.ReadBytes(0x4); // Padding if (listingEntry.CatalogId != 0) listings.Add(listingEntry); } output.InternalItemListings = listings; - output.ListingIndexEnd = reader.ReadByte(); - output.ListingIndexStart = reader.ReadByte(); + reader.ReadByte(); // Was ListingIndexEnd + reader.ReadByte(); // Was ListingIndexStart output.RequestId = reader.ReadUInt16(); return output; @@ -152,7 +141,8 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings /// /// Gets the time this offering was last reviewed. /// - public DateTime LastReviewTime { get; internal set; } + [Obsolete("Universalis Compatibility, contains a fake value", false)] + internal DateTime LastReviewTime { get; set; } = DateTime.UtcNow; /// /// Gets the listing ID. @@ -177,7 +167,8 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings /// /// Gets the player name. /// - public string PlayerName { get; internal set; } + [Obsolete("Universalis Compatibility, contains a fake value", false)] + internal string PlayerName { get; set; } = string.Empty; /// /// Gets the price per unit. @@ -207,7 +198,18 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings /// /// Gets the stain or applied dye of the item. /// - public int StainId { get; internal set; } + [Obsolete("Universalis Compatibility, use Stain1Id and Stain2Id", false)] + internal int StainId => (this.Stain2Id << 8) | this.Stain1Id; + + /// + /// Gets the first stain or applied dye of the item. + /// + public int Stain1Id { get; internal set; } + + /// + /// Gets the second stain or applied dye of the item. + /// + public int Stain2Id { get; internal set; } /// /// Gets the total tax. diff --git a/Dalamud/Game/Network/Structures/MarketBoardHistory.cs b/Dalamud/Game/Network/Structures/MarketBoardHistory.cs index 7d427336e..adcd0f06a 100644 --- a/Dalamud/Game/Network/Structures/MarketBoardHistory.cs +++ b/Dalamud/Game/Network/Structures/MarketBoardHistory.cs @@ -21,11 +21,6 @@ public class MarketBoardHistory : IMarketBoardHistory /// public uint CatalogId { get; private set; } - /// - /// Gets the second catalog ID. - /// - public uint CatalogId2 { get; private set; } - /// /// Gets the ID (for EXD) for the item being sold. /// @@ -39,51 +34,44 @@ public class MarketBoardHistory : IMarketBoardHistory /// /// Gets or sets a list of individual item listings. /// - internal List InternalHistoryListings { get; set; } = new List(); + internal List InternalHistoryListings { get; set; } = []; /// /// Read a object from memory. /// /// Address to read. /// A new object. - public static unsafe MarketBoardHistory Read(IntPtr dataPtr) + public static unsafe MarketBoardHistory Read(nint dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); - var output = new MarketBoardHistory - { - CatalogId = reader.ReadUInt32(), - CatalogId2 = reader.ReadUInt32(), - }; - - if (output.CatalogId2 == 0) - { - // No items found in the resulting packet - just return the empty history. - return output; - } + var output = new MarketBoardHistory { CatalogId = reader.ReadUInt32() }; var historyListings = new List(); for (var i = 0; i < 20; i++) { + var price = reader.ReadUInt32(); + if (price == 0) + { + // no price means we reached the end of available listings + break; + } + var listingEntry = new MarketBoardHistoryListing { - SalePrice = reader.ReadUInt32(), + SalePrice = price, PurchaseTime = DateTimeOffset.FromUnixTimeSeconds(reader.ReadUInt32()).UtcDateTime, Quantity = reader.ReadUInt32(), IsHq = reader.ReadBoolean(), + OnMannequin = reader.ReadBoolean(), + BuyerName = Encoding.UTF8.GetString(reader.ReadBytes(0x20)).TrimEnd('\u0000'), }; - reader.ReadBoolean(); - - listingEntry.OnMannequin = reader.ReadBoolean(); - listingEntry.BuyerName = Encoding.UTF8.GetString(reader.ReadBytes(33)).TrimEnd('\u0000'); - listingEntry.NextCatalogId = reader.ReadUInt32(); + // Skip padding + reader.ReadBytes(0x2); historyListings.Add(listingEntry); - - if (listingEntry.NextCatalogId == 0) - break; } output.InternalHistoryListings = historyListings; @@ -108,11 +96,6 @@ public class MarketBoardHistory : IMarketBoardHistory /// public string BuyerName { get; internal set; } - /// - /// Gets the next entry's catalog ID. - /// - public uint NextCatalogId { get; internal set; } - /// /// Gets a value indicating whether the item is HQ. /// diff --git a/Dalamud/Game/Network/Structures/MarketBoardPurchase.cs b/Dalamud/Game/Network/Structures/MarketBoardPurchase.cs index f432f00e2..45e376e28 100644 --- a/Dalamud/Game/Network/Structures/MarketBoardPurchase.cs +++ b/Dalamud/Game/Network/Structures/MarketBoardPurchase.cs @@ -27,7 +27,7 @@ public class MarketBoardPurchase : IMarketBoardPurchase /// /// A pointer to a struct containing market board purchase information from the server. /// An object representing the data read. - public static unsafe MarketBoardPurchase Read(IntPtr dataPtr) + public static unsafe MarketBoardPurchase Read(nint dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); @@ -35,7 +35,7 @@ public class MarketBoardPurchase : IMarketBoardPurchase var output = new MarketBoardPurchase(); output.CatalogId = reader.ReadUInt32(); - stream.Position += 4; + reader.ReadBytes(0x4); // Padding output.ItemQuantity = reader.ReadUInt32(); return output; diff --git a/Dalamud/Game/Network/Structures/MarketBoardPurchaseHandler.cs b/Dalamud/Game/Network/Structures/MarketBoardPurchaseHandler.cs index 3f9f36ce9..f4ef4b6b1 100644 --- a/Dalamud/Game/Network/Structures/MarketBoardPurchaseHandler.cs +++ b/Dalamud/Game/Network/Structures/MarketBoardPurchaseHandler.cs @@ -37,24 +37,45 @@ public class MarketBoardPurchaseHandler : IMarketBoardPurchaseHandler /// public uint PricePerUnit { get; private set; } + /// + /// Gets a value indicating whether the item is HQ. + /// + public bool IsHq { get; private set; } + + /// + /// Gets the total tax. + /// + public uint TotalTax { get; private set; } + + /// + /// Gets the city ID of the retainer selling the item. + /// + public int RetainerCityId { get; private set; } + /// /// Reads market board purchase information from the struct at the provided pointer. /// /// A pointer to a struct containing market board purchase information from the client. /// An object representing the data read. - public static unsafe MarketBoardPurchaseHandler Read(IntPtr dataPtr) + public static unsafe MarketBoardPurchaseHandler Read(nint dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); - var output = new MarketBoardPurchaseHandler - { - RetainerId = reader.ReadUInt64(), - ListingId = reader.ReadUInt64(), - CatalogId = reader.ReadUInt32(), - ItemQuantity = reader.ReadUInt32(), - PricePerUnit = reader.ReadUInt32(), - }; + var output = new MarketBoardPurchaseHandler(); + + output.RetainerId = reader.ReadUInt64(); + output.ListingId = reader.ReadUInt64(); + + output.CatalogId = reader.ReadUInt32(); + output.ItemQuantity = reader.ReadUInt32(); + output.PricePerUnit = reader.ReadUInt32(); + output.TotalTax = reader.ReadUInt32(); + + reader.ReadUInt16(); // Slot + + output.IsHq = reader.ReadBoolean(); + output.RetainerCityId = reader.ReadByte(); return output; } diff --git a/Dalamud/Game/Network/Structures/MarketTaxRates.cs b/Dalamud/Game/Network/Structures/MarketTaxRates.cs index 00c3c1582..21622daac 100644 --- a/Dalamud/Game/Network/Structures/MarketTaxRates.cs +++ b/Dalamud/Game/Network/Structures/MarketTaxRates.cs @@ -48,16 +48,26 @@ public class MarketTaxRates : IMarketTaxRates public uint CrystariumTax { get; private set; } /// - /// Gets the tax rate in the Crystarium. + /// Gets the tax rate in Sharlayan. /// public uint SharlayanTax { get; private set; } + /// + /// Gets the tax rate in Tuliyollal. + /// + public uint TuliyollalTax { get; private set; } + + /// + /// Gets until when these values are valid. + /// + public DateTime ValidUntil { get; private set; } + /// /// Read a object from memory. /// /// Address to read. /// A new object. - public static unsafe MarketTaxRates Read(IntPtr dataPtr) + public static unsafe MarketTaxRates Read(nint dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); @@ -73,23 +83,26 @@ public class MarketTaxRates : IMarketTaxRates output.KuganeTax = reader.ReadUInt32(); output.CrystariumTax = reader.ReadUInt32(); output.SharlayanTax = reader.ReadUInt32(); + output.TuliyollalTax = reader.ReadUInt32(); + + output.ValidUntil = DateTime.Now; // Dalamud never reads this packet, so setting it to Now just to be safe return output; } - + /// /// Generate a MarketTaxRates wrapper class from information located in a CustomTalk packet. /// /// The pointer to the relevant CustomTalk data. /// Returns a wrapped and ready-to-go MarketTaxRates record. - public static unsafe MarketTaxRates ReadFromCustomTalk(IntPtr dataPtr) + public static unsafe MarketTaxRates ReadFromCustomTalk(nint dataPtr) { using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544); using var reader = new BinaryReader(stream); return new MarketTaxRates { - Category = 0xb0009, // shim + Category = 0xB0009, // shim LimsaLominsaTax = reader.ReadUInt32(), GridaniaTax = reader.ReadUInt32(), UldahTax = reader.ReadUInt32(), @@ -97,6 +110,8 @@ public class MarketTaxRates : IMarketTaxRates KuganeTax = reader.ReadUInt32(), CrystariumTax = reader.ReadUInt32(), SharlayanTax = reader.ReadUInt32(), + TuliyollalTax = reader.ReadUInt32(), + ValidUntil = DateTimeOffset.FromUnixTimeSeconds(reader.ReadUInt32()).UtcDateTime, }; } } diff --git a/Dalamud/Interface/Internal/Windows/Data/Widgets/MarketBoardWidget.cs b/Dalamud/Interface/Internal/Windows/Data/Widgets/MarketBoardWidget.cs index 98d4c29e3..b209e2d9e 100644 --- a/Dalamud/Interface/Internal/Windows/Data/Widgets/MarketBoardWidget.cs +++ b/Dalamud/Interface/Internal/Windows/Data/Widgets/MarketBoardWidget.cs @@ -54,7 +54,7 @@ internal class MarketBoardWidget : IDataWindowWidget public void Load() { this.trackMarketBoard = false; - this.trackedEvents = 0; + this.trackedEvents = 1; this.marketBoardHistoryQueue.Clear(); this.marketBoardPurchaseRequestsQueue.Clear(); this.marketBoardPurchasesQueue.Clear(); @@ -114,7 +114,7 @@ internal class MarketBoardWidget : IDataWindowWidget { if (tabItem) { - ImGuiTable.DrawTable(string.Empty, this.marketBoardCurrentOfferingsQueue, this.DrawMarketBoardCurrentOfferings, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Item ID", "Quantity", "Is HQ?", "Price Per Unit", "Buyer Name", "Retainer Name", "Last Review Time"); + ImGuiTable.DrawTable(string.Empty, this.marketBoardCurrentOfferingsQueue, this.DrawMarketBoardCurrentOfferings, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Item ID", "Quantity", "Is HQ?", "Price Per Unit", "Retainer Name"); } } @@ -130,7 +130,7 @@ internal class MarketBoardWidget : IDataWindowWidget { if (tabItem) { - ImGuiTable.DrawTable(string.Empty, this.marketBoardPurchaseRequestsQueue, this.DrawMarketBoardPurchaseRequests, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Item ID", "Quantity", "Price Per Unit", "Listing ID", "Retainer ID"); + ImGuiTable.DrawTable(string.Empty, this.marketBoardPurchaseRequestsQueue, this.DrawMarketBoardPurchaseRequests, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Item ID", "Is HQ?", "Quantity", "Price Per Unit", "Total Tax", "City ID", "Listing ID", "Retainer ID"); } } @@ -138,7 +138,7 @@ internal class MarketBoardWidget : IDataWindowWidget { if (tabItem) { - ImGuiTable.DrawTable(string.Empty, this.marketTaxRatesQueue, this.DrawMarketTaxRates, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Uldah", "Limsa Lominsa", "Gridania", "Ishgard", "Kugane", "Crystarium", "Sharlayan"); + ImGuiTable.DrawTable(string.Empty, this.marketTaxRatesQueue, this.DrawMarketTaxRates, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.RowBg, "Uldah", "Limsa Lominsa", "Gridania", "Ishgard", "Kugane", "Crystarium", "Sharlayan", "Tuliyollal", "Valid Until"); } } } @@ -236,14 +236,8 @@ internal class MarketBoardWidget : IDataWindowWidget ImGui.TableNextColumn(); ImGui.TextUnformatted(data.Listing.PricePerUnit.ToString()); - ImGui.TableNextColumn(); - ImGui.TextUnformatted(data.Listing.PlayerName); - ImGui.TableNextColumn(); ImGui.TextUnformatted(data.Listing.RetainerName); - - ImGui.TableNextColumn(); - ImGui.TextUnformatted(data.Listing.LastReviewTime.ToString(CultureInfo.InvariantCulture)); } private void DrawMarketBoardPurchases(IMarketBoardPurchase data) @@ -260,12 +254,21 @@ internal class MarketBoardWidget : IDataWindowWidget ImGui.TableNextColumn(); ImGui.TextUnformatted(data.CatalogId.ToString()); + ImGui.TableNextColumn(); + ImGui.TextUnformatted(data.IsHq.ToString()); + ImGui.TableNextColumn(); ImGui.TextUnformatted(data.ItemQuantity.ToString()); ImGui.TableNextColumn(); ImGui.TextUnformatted(data.PricePerUnit.ToString()); + ImGui.TableNextColumn(); + ImGui.TextUnformatted(data.TotalTax.ToString()); + + ImGui.TableNextColumn(); + ImGui.TextUnformatted(data.RetainerCityId.ToString()); + ImGui.TableNextColumn(); ImGui.TextUnformatted(data.ListingId.ToString()); @@ -295,5 +298,11 @@ internal class MarketBoardWidget : IDataWindowWidget ImGui.TableNextColumn(); ImGui.TextUnformatted(data.SharlayanTax.ToString()); + + ImGui.TableNextColumn(); + ImGui.TextUnformatted(data.TuliyollalTax.ToString()); + + ImGui.TableNextColumn(); + ImGui.TextUnformatted(data.ValidUntil.ToString(CultureInfo.InvariantCulture)); } }