1 #ifndef GAME_STATES_STORAGESYSTEM_HPP
2 #define GAME_STATES_STORAGESYSTEM_HPP
4 #include <BLIB/Interfaces/Menu.hpp>
21 ,
public bl::input::Listener {
39 virtual const char*
name()
const override;
46 virtual void activate(bl::engine::Engine& engine)
override;
53 virtual void deactivate(bl::engine::Engine& engine)
override;
61 virtual void update(bl::engine::Engine& engine,
float dt,
float)
override;
64 enum struct MenuState {
78 WaitingContextMessage,
79 WaitingReleaseConfirm,
89 sf::Vector2i selectPos;
90 bool closeMenuAfterMessage;
91 bl::rc::Scene* overlay;
93 bl::rc::res::TextureRef backgroundTxtr;
94 bl::gfx::Sprite background;
104 bl::audio::AudioSystem::Handle cursorMoveSound;
105 bl::audio::AudioSystem::Handle pageSlideSound;
106 bl::audio::AudioSystem::Handle pageSlideFailSound;
108 bl::rc::res::TextureRef leftArrowTxtr;
109 bl::rc::res::TextureRef rightArrowTxtr;
110 bl::gfx::Sprite leftArrow;
111 bl::gfx::Sprite rightArrow;
112 bl::gfx::Text boxTitle;
114 bl::rc::res::TextureRef thumbTxtr;
115 bl::gfx::Sprite thumbnail;
116 bl::gfx::Text nickname;
118 bl::gfx::Text itemLabel;
120 bl::menu::Menu actionMenu;
121 bl::menu::Item::Ptr withdrawActionItem;
122 bl::menu::Menu contextMenu;
124 int depositedPeoplemon;
125 sf::Vector2i ogMovePos;
135 void onCursor(
const sf::Vector2i& pos);
137 void onSelect(
const sf::Vector2i& position);
146 void onCloseContextMenu();
148 virtual bool observe(
const bl::input::Actor&,
unsigned int activatedControl,
149 bl::input::DispatchType,
bool eventTriggered)
override;
151 void enterState(MenuState state);
152 void finishBoxChange();
153 void onReleaseConfirm(
const std::string& choice);
154 void onMessageDone();
156 void showPeoplemonInfo(
bool show);
157 void updateThumbnail(
const std::string& src);
158 void showContextMessage(
const std::string& msg,
bool closeMenu =
true);
159 void positionContextMenu();
bl::menu::TriggerDriver< Control::MoveUp, Control::MoveRight, Control::MoveDown, Control::MoveLeft, Control::Interact > MenuDriver
Helper typedef for Peoplemon specific menu driving.
Parent namespace for all functionality unique to the game.
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon....
Represents a Peoplemon in storage.
Owns all primary systems and a reference to the engine.
Cursor that is used to navigate the storage system boxes.
Renderer for the grid of peoplemon in a storage box.
Parent to all game states. Provides some commonly required data like core game systems.
core::system::Systems & systems
Game state for the peoplemon storage system menu.
virtual ~StorageSystem()=default
Destroy the Storage System object.
virtual const char * name() const override
Returns "StorageSystem".
virtual void update(bl::engine::Engine &engine, float dt, float) override
Updates the menu state.
virtual void activate(bl::engine::Engine &engine) override
Initializes the menu and subscribes to event buses.
virtual void deactivate(bl::engine::Engine &engine) override
Unsubscribes from event buses and fires a StorageSystemClosed event.
static bl::engine::State::Ptr create(core::system::Systems &systems)
Create a new storage system menu.