feat: add quest completion toast notification

When a quest is turned in (SMSG_QUESTGIVER_QUEST_COMPLETE), a gold-bordered
toast slides in from the right showing "Quest Complete" header with the quest
title, consistent with the rep change and achievement toast systems.
This commit is contained in:
Kelsi 2026-03-12 04:53:03 -07:00
parent 71df1ccf6f
commit b34bf39746
4 changed files with 90 additions and 0 deletions

View file

@ -1330,6 +1330,10 @@ public:
using RepChangeCallback = std::function<void(const std::string& factionName, int32_t delta, int32_t standing)>;
void setRepChangeCallback(RepChangeCallback cb) { repChangeCallback_ = std::move(cb); }
// Quest turn-in completion callback
using QuestCompleteCallback = std::function<void(uint32_t questId, const std::string& questTitle)>;
void setQuestCompleteCallback(QuestCompleteCallback cb) { questCompleteCallback_ = std::move(cb); }
// Mount state
using MountCallback = std::function<void(uint32_t mountDisplayId)>; // 0 = dismount
void setMountCallback(MountCallback cb) { mountCallback_ = std::move(cb); }
@ -2630,6 +2634,9 @@ private:
// ---- Reputation change callback ----
RepChangeCallback repChangeCallback_;
// ---- Quest completion callback ----
QuestCompleteCallback questCompleteCallback_;
};
} // namespace game

View file

@ -100,6 +100,12 @@ private:
std::vector<RepToastEntry> repToasts_;
bool repChangeCallbackSet_ = false;
static constexpr float kRepToastLifetime = 3.5f;
// Quest completion toast: slide-in when a quest is turned in
struct QuestCompleteToastEntry { uint32_t questId = 0; std::string title; float age = 0.0f; };
std::vector<QuestCompleteToastEntry> questCompleteToasts_;
bool questCompleteCallbackSet_ = false;
static constexpr float kQuestCompleteToastLifetime = 4.0f;
bool showPlayerInfo = false;
bool showSocialFrame_ = false; // O key toggles social/friends list
bool showGuildRoster_ = false;
@ -283,6 +289,7 @@ private:
void renderBossFrames(game::GameHandler& gameHandler);
void renderUIErrors(game::GameHandler& gameHandler, float deltaTime);
void renderRepToasts(float deltaTime);
void renderQuestCompleteToasts(float deltaTime);
void renderGroupInvitePopup(game::GameHandler& gameHandler);
void renderDuelRequestPopup(game::GameHandler& gameHandler);
void renderLootRollPopup(game::GameHandler& gameHandler);