mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-26 00:40:15 +00:00
Restructure inventory UI, add vendor selling, camera intro on all spawns, and quest log
Split inventory into bags-only (B key) and character screen (C key). Vendor window auto-opens bags with sell prices on hover and right-click to sell. Add camera intro pan on all login/spawn/teleport/hearthstone events and idle orbit after 2 minutes. Add quest log UI, SMSG_MONSTER_MOVE handling, deferred creature spawn queue, and creature fade-in/movement interpolation for online mode.
This commit is contained in:
parent
bb4c2c25f7
commit
71c3d2ea77
21 changed files with 1092 additions and 149 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "game/inventory.hpp"
|
||||
#include "rendering/world_map.hpp"
|
||||
#include "ui/inventory_screen.hpp"
|
||||
#include "ui/quest_log_screen.hpp"
|
||||
#include "ui/spellbook_screen.hpp"
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
|
|
@ -143,6 +144,7 @@ private:
|
|||
void renderWorldMap(game::GameHandler& gameHandler);
|
||||
|
||||
InventoryScreen inventoryScreen;
|
||||
QuestLogScreen questLogScreen;
|
||||
SpellbookScreen spellbookScreen;
|
||||
rendering::WorldMap worldMap;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,36 @@
|
|||
#pragma once
|
||||
|
||||
#include "game/inventory.hpp"
|
||||
#include "game/world_packets.hpp"
|
||||
#include <imgui.h>
|
||||
#include <functional>
|
||||
|
||||
namespace wowee {
|
||||
namespace game { class GameHandler; }
|
||||
namespace ui {
|
||||
|
||||
class InventoryScreen {
|
||||
public:
|
||||
/// Render bags window (B key). Positioned at bottom of screen.
|
||||
void render(game::Inventory& inventory, uint64_t moneyCopper);
|
||||
|
||||
/// Render character screen (C key). Standalone equipment window.
|
||||
void renderCharacterScreen(game::Inventory& inventory);
|
||||
|
||||
bool isOpen() const { return open; }
|
||||
void toggle() { open = !open; }
|
||||
void setOpen(bool o) { open = o; }
|
||||
|
||||
bool isCharacterOpen() const { return characterOpen; }
|
||||
void toggleCharacter() { characterOpen = !characterOpen; }
|
||||
void setCharacterOpen(bool o) { characterOpen = o; }
|
||||
|
||||
/// Enable vendor mode: right-clicking bag items sells them.
|
||||
void setVendorMode(bool enabled, game::GameHandler* handler) {
|
||||
vendorMode_ = enabled;
|
||||
gameHandler_ = handler;
|
||||
}
|
||||
|
||||
/// Returns true if equipment changed since last call, and clears the flag.
|
||||
bool consumeEquipmentDirty() { bool d = equipmentDirty; equipmentDirty = false; return d; }
|
||||
/// Returns true if any inventory slot changed since last call, and clears the flag.
|
||||
|
|
@ -20,10 +38,16 @@ public:
|
|||
|
||||
private:
|
||||
bool open = false;
|
||||
bool characterOpen = false;
|
||||
bool bKeyWasDown = false;
|
||||
bool cKeyWasDown = false;
|
||||
bool equipmentDirty = false;
|
||||
bool inventoryDirty = false;
|
||||
|
||||
// Vendor sell mode
|
||||
bool vendorMode_ = false;
|
||||
game::GameHandler* gameHandler_ = nullptr;
|
||||
|
||||
// Drag-and-drop held item state
|
||||
bool holdingItem = false;
|
||||
game::ItemDef heldItem;
|
||||
|
|
|
|||
21
include/ui/quest_log_screen.hpp
Normal file
21
include/ui/quest_log_screen.hpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include "game/game_handler.hpp"
|
||||
#include <imgui.h>
|
||||
|
||||
namespace wowee { namespace ui {
|
||||
|
||||
class QuestLogScreen {
|
||||
public:
|
||||
void render(game::GameHandler& gameHandler);
|
||||
bool isOpen() const { return open; }
|
||||
void toggle() { open = !open; }
|
||||
void setOpen(bool o) { open = o; }
|
||||
|
||||
private:
|
||||
bool open = false;
|
||||
bool lKeyWasDown = false;
|
||||
int selectedIndex = -1;
|
||||
};
|
||||
|
||||
}} // namespace wowee::ui
|
||||
Loading…
Add table
Add a link
Reference in a new issue