19#ifndef KART_SELECTION_INCLUDED
20#define KART_SELECTION_INCLUDED
22#include "guiengine/screen.hpp"
23#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
24#include "guiengine/widgets/player_kart_widget.hpp"
25#include "states_screens/state_manager.hpp"
31 enum EventPropagation;
53 friend class PlayerNameSpinner;
70 bool m_go_to_overworld_next;
109 void playerConfirm(
const int playerID);
111 void updateKartStats(uint8_t widget_id,
112 const std::string& selection);
117 const std::string& selection,
118 const irr::core::stringw& selectionText,
127 virtual bool isIgnored(
const std::string& ident)
const {
return false; }
133 const std::string& selected_kart_group);
134 bool useContinueButton()
const;
142 void setMultiplayer(
bool multiplayer);
147 void setGoToOverworldNext() { m_go_to_overworld_next =
true; }
161 virtual void init() OVERRIDE;
170 const
int playerID) OVERRIDE;
173 virtual
void onUpdate(
float dt) OVERRIDE;
199 bool m_is_initialised;
208 void setRootID(
const int reservedID);
215 virtual GUIEngine::EventPropagation focused(
const int playerID);
233 const std::string& selectionID,
234 const irr::core::stringw& selectionText,
Currently, navigation for multiple players at the same time is implemented in a somewhat clunky way.
Definition: kart_selection.hpp:194
Even if you have a ribbon that only acts on click/enter, you may wish to know which item is currently...
Definition: dynamic_ribbon_widget.hpp:41
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:97
unsigned int m_magic_number
to catch errors as early as possible, for debugging purposes only
Definition: screen.hpp:121
Definition: kart_selection.hpp:221
screen where players can choose their kart
Definition: kart_selection.hpp:51
virtual void allPlayersDone()
Called when all players selected their kart.
Definition: kart_selection.cpp:1225
PtrVector< GUIEngine::PlayerKartWidget, REF > m_kart_widgets
Contains the custom widget shown for every player.
Definition: kart_selection.hpp:60
void addMultiplayerMessage()
Adds a message to the screen which indicates that players must press fire to join.
Definition: kart_selection.cpp:1039
virtual void beforeAddingWidget() OVERRIDE
Optional callback invoked very early, before widgets have been added (contrast with init(),...
Definition: kart_selection.cpp:276
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:346
bool m_from_overworld
Whether this screen is being visited from overworld or not.
Definition: kart_selection.hpp:68
static KartSelectionScreen * getRunningInstance()
Returns the current instance.
Definition: kart_selection.cpp:254
GUIEngine::BubbleWidget * m_multiplayer_message
Message shown in multiplayer mode.
Definition: kart_selection.hpp:82
virtual void unloaded() OVERRIDE
implement optional callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:491
bool m_must_delete_on_back
To delete the screen if back is pressed.
Definition: kart_selection.hpp:72
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:261
void setKartsFromCurrentGroup()
Fill the ribbon with the karts from the currently selected group.
Definition: kart_selection.cpp:1558
void updateKartWidgetModel(int widget_id, const std::string &selection, const irr::core::stringw &selectionText, float kart_color)
updates model of a kart widget, to have the good selection when the user validates
Definition: kart_selection.cpp:909
static KartSelectionScreen * m_instance_ptr
Stores a pointer to the current selection screen.
Definition: kart_selection.hpp:130
bool m_game_master_confirmed
Stores whether any player confirmed their choice; then, some things are "frozen", for instance the se...
Definition: kart_selection.hpp:77
bool validateIdentChoices()
Checks identities chosen by players, making sure no duplicates are used.
Definition: kart_selection.cpp:1360
virtual bool onEscapePressed() OVERRIDE
implement optional callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:1202
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:455
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:1090
virtual bool playerQuit(StateManager::ActivePlayer *player)
Called when a player hits 'rescue'/'cancel' on his device to leave the game.
Definition: kart_selection.cpp:639
bool validateKartChoices()
Checks karts chosen by players, making sure no duplicates are used.
Definition: kart_selection.cpp:1441
void removeMultiplayerMessage()
Remove the multiplayer message.
Definition: kart_selection.cpp:1074
void setFromOverworld(bool from_overworld)
Set whether this screen is being visited from overworld or not.
Definition: kart_selection.hpp:145
virtual void onUpdate(float dt) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:765
void renumberKarts()
Called when number/order of karts changed, so that all will keep an up-to-date ID.
Definition: kart_selection.cpp:1519
bool joinPlayer(InputDevice *device, PlayerProfile *p)
Called when a player hits 'fire'/'select' on his device to join the game.
Definition: kart_selection.cpp:499
Class for managing player profiles (name, usage frequency, etc.).
Definition: player_profile.hpp:54
Definition: ptr_vector.hpp:44
Represents a player that is currently playing.
Definition: state_manager.hpp:76
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33