From e4483eca01b48b943cd0461e24a74ae1a3139ed4 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 12 Feb 2025 21:57:46 +1100 Subject: Update to most recent version (old initial commit) --- src/client/window/inventory_window.hh | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/client/window/inventory_window.hh (limited to 'src/client/window/inventory_window.hh') diff --git a/src/client/window/inventory_window.hh b/src/client/window/inventory_window.hh new file mode 100644 index 0000000..a77ae2f --- /dev/null +++ b/src/client/window/inventory_window.hh @@ -0,0 +1,40 @@ +#ifndef CLIENT_WINDOW_INVENTORY_WINDOW_HH_ +#define CLIENT_WINDOW_INVENTORY_WINDOW_HH_ + +#include +#include + +#include "client/item/item.hh" +#include "client/render/draw.hh" +#include "client/state/state.hh" +#include "client/window/basic_window.hh" + +namespace client { +namespace window { + +class inventory_window : public basic_window { +private: + std::optional grabbed; + +private: + std::optional + maybe_get_inventory_index(const glm::vec2& pos) const noexcept; + +private: + bool maybe_handle_mousebuttondown(const SDL_Event& event) noexcept; + bool maybe_handle_mousebuttonup(const SDL_Event& event) noexcept; + +public: + template + inventory_window(Args&&... args) noexcept + : basic_window(std::forward(args)...) {} + virtual ~inventory_window() noexcept {} + + virtual bool maybe_handle_event(const SDL_Event& event) noexcept override; + virtual void draw() noexcept override; +}; + +} // namespace window +} // namespace client + +#endif -- cgit v1.2.3