mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
feat: replace page-text chat-dump with proper book/scroll window
handlePageTextQueryResponse() now collects pages into bookPages_ vector instead of dumping lines to system chat. Multi-page items (nextPageId != 0) are automatically chained by requesting subsequent pages. The book window opens automatically when pages arrive, shows formatted text in a parchment- styled ImGui window with Prev/Next page navigation and a Close button. SMSG_READ_ITEM_OK clears bookPages_ so each item read starts fresh; handleGameObjectPageText() does the same before querying the first page. Closes the long-standing issue where reading scrolls and tattered notes spammed many separate chat messages instead of showing a readable UI.
This commit is contained in:
parent
218d68e275
commit
5883654e1e
4 changed files with 114 additions and 11 deletions
|
|
@ -1462,6 +1462,13 @@ public:
|
|||
uint32_t getTempEnchantRemainingMs(uint32_t slot) const;
|
||||
static constexpr const char* kTempEnchantSlotNames[] = { "Main Hand", "Off Hand", "Ranged" };
|
||||
|
||||
// ---- Readable text (books / scrolls / notes) ----
|
||||
// Populated by handlePageTextQueryResponse(); multi-page items chain via nextPageId.
|
||||
struct BookPage { uint32_t pageId = 0; std::string text; };
|
||||
const std::vector<BookPage>& getBookPages() const { return bookPages_; }
|
||||
bool hasBookOpen() const { return !bookPages_.empty(); }
|
||||
void clearBook() { bookPages_.clear(); }
|
||||
|
||||
// Other player level-up callback — fires when another player gains a level
|
||||
using OtherPlayerLevelUpCallback = std::function<void(uint64_t guid, uint32_t newLevel)>;
|
||||
void setOtherPlayerLevelUpCallback(OtherPlayerLevelUpCallback cb) { otherPlayerLevelUpCallback_ = std::move(cb); }
|
||||
|
|
@ -2820,6 +2827,7 @@ private:
|
|||
LevelUpCallback levelUpCallback_;
|
||||
LevelUpDeltas lastLevelUpDeltas_;
|
||||
std::vector<TempEnchantTimer> tempEnchantTimers_;
|
||||
std::vector<BookPage> bookPages_; // pages collected for the current readable item
|
||||
OtherPlayerLevelUpCallback otherPlayerLevelUpCallback_;
|
||||
AchievementEarnedCallback achievementEarnedCallback_;
|
||||
AreaDiscoveryCallback areaDiscoveryCallback_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue