20 :
State(s,
bl::engine::StateMask::Paused)
24 using bl::menu::TextItem;
27 s.
engine().renderer().getObserver(),
28 bl::menu::ArrowSelector::create(14.f, sf::Color::Black));
31 resume->getSignal(Item::Activated).willCall([
this]() { this->
systems.
engine().popState(); });
34 ppldex->getSignal(Item::Activated).willCall([
this]() {
39 pplmon->getSignal(Item::Activated).willCall([
this]() {
45 bag->getSignal(Item::Activated).willCall([
this]() {
51 map->getSignal(Item::Activated).willCall([
this]() {
56 save->getSignal(Item::Activated).willCall([
this]() {
61 settings->getSignal(Item::Activated).willCall([
this]() {
66 quit->getSignal(Item::Activated).willCall([
this]() {
67 this->
systems.
engine().flags().set(bl::engine::Flags::Terminate);
70 menu.setRootItem(resume);
71 menu.addItem(ppldex, resume.get(), Item::Bottom);
73 menu.addItem(pplmon, ppldex.get(), Item::Bottom);
74 menu.addItem(bag, pplmon.get(), Item::Bottom);
76 else { menu.addItem(bag, ppldex.get(), Item::Bottom); }
78 menu.addItem(map, bag.get(), Item::Bottom);
79 menu.addItem(save, map.get(), Item::Bottom);
81 else { menu.addItem(save, bag.get(), Item::Bottom); }
82 menu.addItem(settings, save.get(), Item::Bottom);
83 menu.addItem(quit, settings.get(), Item::Bottom);
84 menu.attachExisting(resume.get(), quit.get(), Item::Bottom);
87 menu.setMinHeight(38.f);
88 menu.setSelectedItem(resume.get());
89 menu.configureBackground(sf::Color::White, sf::Color::Black, 4.f, {24.f, 8.f, 8.f, 8.f});
91 {scr.x - menu.visibleSize().x - 32.f, scr.y * 0.5f - menu.visibleSize().y * 0.5f});
98 inputDriver.drive(&menu);
99 inputDriver.resetDebounce();
109 menu.removeFromScene();
110 systems.
engine().inputSystem().getActor().removeListener(*
this);
111 inputDriver.drive(
nullptr);
122 bool PauseMenu::observe(
const bl::input::Actor&,
unsigned int ctrl, bl::input::DispatchType,
124 inputDriver.sendControl(ctrl, fromEvent);
Parent namespace for all functionality unique to the game.
bool hasItem(item::Id item) const
Returns true if at least one of the given items is owned.
std::vector< pplmn::OwnedPeoplemon > peoplemon
static const sf::VulkanFont & MenuFont()
static bl::audio::AudioSystem::Handle MenuBackSound()
static bl::audio::AudioSystem::Handle MenuMoveSound()
static int WindowHeight()
void hideEntryCard()
Hides the entry card.
player::State & state()
Returns the state of the player.
Owns all primary systems and a reference to the engine.
const bl::engine::Engine & engine() const
Const accessor for the Engine.
Player & player()
Returns the player system.
HUD & hud()
Returns the HUD.
static bl::engine::State::Ptr create(core::system::Systems &systems, Context ctx, core::item::Id *result=nullptr, int outNow=-1, int *chosenPeoplemon=nullptr, bool *unpause=nullptr)
Creates a new BagMenu.
static bl::engine::State::Ptr create(core::system::Systems &systems, bool &unpause)
Creates the fly map state.
Game state for the pause menu.
virtual void update(bl::engine::Engine &, float dt, float) override
Updates systems that are not paused.
virtual void deactivate(bl::engine::Engine &) override
Unsubscribes from event buses.
virtual void activate(bl::engine::Engine &) override
Subscribes to event buses.
virtual const char * name() const override
Returns "PauseMenu".
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates a new pause menu state.
static bl::engine::State::Ptr create(core::system::Systems &systems)
Create a new Peopledex state.
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.
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates the save game state.
static bl::engine::State::Ptr create(core::system::Systems &systems)
Creates the settings menu state.
Parent to all game states. Provides some commonly required data like core game systems.
core::system::Systems & systems