1 #ifndef CORE_BATTLES_VIEW_PLAYERMENU_HPP
2 #define CORE_BATTLES_VIEW_PLAYERMENU_HPP
4 #include <BLIB/Events.hpp>
5 #include <BLIB/Graphics.hpp>
6 #include <BLIB/Interfaces/Menu.hpp>
7 #include <BLIB/Render/Scenes/CodeScene.hpp>
8 #include <BLIB/Resources.hpp>
37 PlayerMenu(bl::engine::Engine& engine,
bool canRun);
44 void init(bl::rc::scene::CodeScene* scene);
115 void render(bl::rc::scene::CodeScene::RenderContext& ctx);
127 bl::engine::Engine& engine;
133 int chosenMoveOrPeoplemon;
135 int currentPeoplemon;
137 bl::menu::Menu actionMenu;
138 bl::menu::TextItem::Ptr fightItem;
139 bl::menu::TextItem::Ptr switchItem;
140 bl::menu::TextItem::Ptr bagItem;
141 bl::menu::TextItem::Ptr runItem;
143 bl::menu::Menu moveMenu;
144 bl::menu::TextItem::Ptr moveItems[4];
147 bl::rc::res::TextureRef moveTxtr;
148 bl::gfx::Sprite moveBox;
149 bl::gfx::Text movePP;
150 bl::gfx::Text movePwr;
151 bl::gfx::Text moveAcc;
157 void moveChosen(
int i);
158 void syncMove(
int i);
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.
Core classes and functionality for both the editor and game.
TurnAction
Represents an action that a battler may take on their turn.
std::underlying_type_t< Control::EntityControl > EntityControl
Helper typedef to avoid too much casting boilerplate.
The player menu for battles.
void handleInput(input::EntityControl input, bool ignoreDebounce)
Processes player input to update the menu state.
TurnAction selectedAction() const
The selected turn action.
void chooseMoveToForget()
Initiates the process of choosing the move to forget.
int selectedPeoplemon() const
Returns the selected peoplemon index.
PlayerMenu(bl::engine::Engine &engine, bool canRun)
Construct a new Player Menu.
void setPeoplemon(int i, const pplmn::BattlePeoplemon &ppl)
Updates the menu for the given peoplemon.
void render(bl::rc::scene::CodeScene::RenderContext &ctx)
Renders the menu.
void choosePeoplemonMidTurn(bool fromFaint, bool fromRevive)
Opens the menu to select a peoplemon to send out.
item::Id selectedItem() const
Returns the selected item.
void beginTurn()
Resets the menu to the turn start state.
int selectedMove() const
Returns the selected move index.
void init(bl::rc::scene::CodeScene *scene)
Creates UI elements and adds them to the scene.
void refresh()
Polls state from opened peoplemon or bag menu.
bool ready() const
Returns true when the player's choice has been made.
Represents a Peoplemon in battle. Stores some extra state that only exists in battle....
Represents a move owned by a peoplemon.