mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
36 lines
1 KiB
C++
36 lines
1 KiB
C++
#pragma once
|
|
|
|
#include "game/game_handler.hpp"
|
|
#include <imgui.h>
|
|
#include <cstdint>
|
|
#include <unordered_set>
|
|
|
|
namespace wowee { namespace ui {
|
|
|
|
class InventoryScreen;
|
|
|
|
class QuestLogScreen {
|
|
public:
|
|
void render(game::GameHandler& gameHandler, InventoryScreen& invScreen);
|
|
bool isOpen() const { return open; }
|
|
void toggle() { open = !open; }
|
|
void setOpen(bool o) { open = o; }
|
|
// Open the log and scroll to the given quest (by questId)
|
|
void openAndSelectQuest(uint32_t questId) {
|
|
open = true;
|
|
pendingSelectQuestId_ = questId;
|
|
scrollToSelected_ = true;
|
|
}
|
|
|
|
private:
|
|
bool open = false;
|
|
bool lKeyWasDown = false;
|
|
int selectedIndex = -1;
|
|
uint32_t pendingSelectQuestId_ = 0; // non-zero: select this quest on next render
|
|
bool scrollToSelected_ = false; // true: call SetScrollHereY once after selection
|
|
uint32_t lastDetailRequestQuestId_ = 0;
|
|
double lastDetailRequestAt_ = 0.0;
|
|
std::unordered_set<uint32_t> questDetailQueryNoResponse_;
|
|
};
|
|
|
|
}} // namespace wowee::ui
|