From 9d1fb393632329cfa72cb095da32e1325cd5d824 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 05:34:17 -0700 Subject: [PATCH] feat: add "Usable" filter to auction house and query token item names Add a "Usable" checkbox to the AH search UI that filters results to items the player can actually equip/use (server-side filtering via the usableOnly parameter in CMSG_AUCTION_LIST_ITEMS). Also ensure token item names for extended costs are queried from the server via ensureItemInfo() so they display properly instead of "Item#12345". --- include/ui/game_screen.hpp | 1 + src/ui/game_screen.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/ui/game_screen.hpp b/include/ui/game_screen.hpp index 04326e75..4121b974 100644 --- a/include/ui/game_screen.hpp +++ b/include/ui/game_screen.hpp @@ -581,6 +581,7 @@ private: uint32_t auctionBrowseOffset_ = 0; // Pagination offset for browse results int auctionItemClass_ = -1; // Item class filter (-1 = All) int auctionItemSubClass_ = -1; // Item subclass filter (-1 = All) + bool auctionUsableOnly_ = false; // Filter to items usable by current class/level // Guild bank money input int guildBankMoneyInput_[3] = {0, 0, 0}; // gold, silver, copper diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 9de70ce4..464c395c 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -16064,6 +16064,7 @@ std::string GameScreen::formatExtendedCost(uint32_t extendedCostId, game::GameHa for (int j = 0; j < 5; ++j) { if (e.itemId[j] == 0 || e.itemCount[j] == 0) continue; if (!result.empty()) result += ", "; + gameHandler.ensureItemInfo(e.itemId[j]); // query if not cached const auto* itemInfo = gameHandler.getItemInfo(e.itemId[j]); if (itemInfo && itemInfo->valid && !itemInfo->name.empty()) { result += std::to_string(e.itemCount[j]) + "x " + itemInfo->name; @@ -21752,7 +21753,8 @@ void GameScreen::renderAuctionHouseWindow(game::GameHandler& gameHandler) { gameHandler.auctionSearch(auctionSearchName_, static_cast(auctionLevelMin_), static_cast(auctionLevelMax_), - q, getSearchClassId(), getSearchSubClassId(), 0, 0, offset); + q, getSearchClassId(), getSearchSubClassId(), 0, + auctionUsableOnly_ ? 1 : 0, offset); }; // Row 1: Name + Level range @@ -21798,6 +21800,8 @@ void GameScreen::renderAuctionHouseWindow(game::GameHandler& gameHandler) { } } + ImGui::SameLine(); + ImGui::Checkbox("Usable", &auctionUsableOnly_); ImGui::SameLine(); float delay = gameHandler.getAuctionSearchDelay(); if (delay > 0.0f) {