mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
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".
This commit is contained in:
parent
5230815353
commit
9d1fb39363
2 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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<uint8_t>(auctionLevelMin_),
|
||||
static_cast<uint8_t>(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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue