1 #ifndef GAME_STATES_PEOPLEMONMENU_HPP
2 #define GAME_STATES_PEOPLEMONMENU_HPP
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Interfaces/Menu.hpp>
6 #include <BLIB/Resources.hpp>
23 ,
public bl::input::Listener {
37 int outNow = -1,
int* chosen =
nullptr,
46 virtual const char*
name()
const override;
51 virtual void activate(bl::engine::Engine& engine)
override;
56 virtual void deactivate(bl::engine::Engine& engine)
override;
61 virtual void update(bl::engine::Engine&,
float dt,
float)
override;
88 bl::rc::res::TextureRef backgroundTxtr;
89 bl::gfx::Sprite background;
94 bl::menu::ImageItem::Ptr backBut;
96 bl::menu::Menu actionMenu;
97 bl::menu::Item* actionRoot;
103 void connectButtons();
104 bool canCancel()
const;
105 void setSelectable(
unsigned int i);
112 void cleanupMove(
bool completed);
116 void closeActionMenu();
117 void confirmMoveDelete(
const std::string& choice);
118 void delMove(
const std::string& choice);
120 virtual bool observe(
const bl::input::Actor&,
unsigned int activatedControl,
121 bl::input::DispatchType,
bool eventTriggered)
override;
bl::menu::TriggerDriver< Control::MoveUp, Control::MoveRight, Control::MoveDown, Control::MoveLeft, Control::Interact > MenuDriver
Helper typedef for Peoplemon specific menu driving.
Id
Represents an item in its simplist form.
Parent namespace for all functionality unique to the game.
Context
Represents where the menu is being opened from.
Owns all primary systems and a reference to the engine.
std::shared_ptr< PeoplemonButton > Ptr
Provides the menu for viewing and selecting Peoplemon.
virtual void activate(bl::engine::Engine &engine) override
Subscribes the menu to the engine event bus.
virtual const char * name() const override
Returns "PeoplemonMenu".
virtual ~PeoplemonMenu()=default
Cleans up all resources.
core::event::OpenPeoplemonMenu::Context Context
virtual void update(bl::engine::Engine &, float dt, float) override
Does nothing.
virtual void deactivate(bl::engine::Engine &engine) override
Unsubscribes the menu to the engine event bus.
static bl::engine::State::Ptr create(core::system::Systems &systems, Context ctx, int outNow=-1, int *chosen=nullptr, core::item::Id item=core::item::Id::None)
Creates a new PeoplemonMenu state.
Parent to all game states. Provides some commonly required data like core game systems.
core::system::Systems & systems