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 "guiengine/widgets/text_box_widget.hpp"
26 #include "states_screens/state_manager.hpp"
32 enum EventPropagation;
71 bool m_go_to_overworld_next;
116 void playerConfirm(
const int playerID);
118 void updateKartStats(uint8_t widget_id,
119 const std::string& selection);
124 const std::string& selection,
125 const irr::core::stringw& selectionText,
134 virtual bool isIgnored(
const std::string& ident)
const {
return false; }
140 const std::string& selected_kart_group);
141 bool useContinueButton()
const;
142 void configureChooseKarts(
bool enable);
150 void setMultiplayer(
bool multiplayer);
155 void setGoToOverworldNext() { m_go_to_overworld_next =
true; }
169 virtual void init() OVERRIDE;
178 const
int playerID) OVERRIDE;
181 virtual
void onUpdate(
float dt) OVERRIDE;
222 bool m_is_initialised;
231 void setRootID(
const int reservedID);
238 virtual GUIEngine::EventPropagation
focused(
const int playerID);
256 const std::string& selectionID,
257 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:217
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
Definition: text_box_widget.hpp:42
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:94
unsigned int m_magic_number
to catch errors as early as possible, for debugging purposes only
Definition: screen.hpp:114
A text field widget.
Definition: text_box_widget.hpp:53
virtual EventPropagation focused(const int playerID)
override in children if you need to know when the widget is focused.
Definition: text_box_widget.cpp:178
Definition: kart_selection.hpp:244
screen where players can choose their kart
Definition: kart_selection.hpp:53
virtual void allPlayersDone()
Called when all players selected their kart.
Definition: kart_selection.cpp:1304
PtrVector< GUIEngine::PlayerKartWidget, REF > m_kart_widgets
Contains the custom widget shown for every player.
Definition: kart_selection.hpp:61
void addMultiplayerMessage()
Adds a message to the screen which indicates that players must press fire to join.
Definition: kart_selection.cpp:1095
virtual void beforeAddingWidget() OVERRIDE
Optional callback invoked very early, before widgets have been added (contrast with init(),...
Definition: kart_selection.cpp:274
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:382
bool m_from_overworld
Whether this screen is being visited from overworld or not.
Definition: kart_selection.hpp:69
static KartSelectionScreen * getRunningInstance()
Returns the current instance.
Definition: kart_selection.cpp:252
GUIEngine::BubbleWidget * m_multiplayer_message
Message shown in multiplayer mode.
Definition: kart_selection.hpp:85
virtual void unloaded() OVERRIDE
implement optional callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:536
bool m_must_delete_on_back
To delete the screen if back is pressed.
Definition: kart_selection.hpp:73
virtual void onResize() OVERRIDE
optional callback you can override to be notified at every resize.
Definition: kart_selection.cpp:1790
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:259
virtual void onTextUpdated() OVERRIDE
Rebuild the list of tracks based on search text.
Definition: kart_selection.hpp:184
void handleKartListFocus()
When kart list has been changed, make sure all players have valid focus.
Definition: kart_selection.cpp:1439
void setKartsFromCurrentGroup()
Fill the ribbon with the karts from the currently selected group.
Definition: kart_selection.cpp:1718
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:965
static KartSelectionScreen * m_instance_ptr
Stores a pointer to the current selection screen.
Definition: kart_selection.hpp:137
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:78
bool validateIdentChoices()
Checks identities chosen by players, making sure no duplicates are used.
Definition: kart_selection.cpp:1501
virtual bool onEscapePressed() OVERRIDE
implement optional callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:1248
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:498
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:1146
virtual bool playerQuit(StateManager::ActivePlayer *player)
Called when a player hits 'rescue'/'cancel' on his device to leave the game.
Definition: kart_selection.cpp:689
bool validateKartChoices()
Checks karts chosen by players, making sure no duplicates are used.
Definition: kart_selection.cpp:1584
void removeMultiplayerMessage()
Remove the multiplayer message.
Definition: kart_selection.cpp:1130
void setFromOverworld(bool from_overworld)
Set whether this screen is being visited from overworld or not.
Definition: kart_selection.hpp:153
virtual void onUpdate(float dt) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: kart_selection.cpp:815
void renumberKarts()
Called when number/order of karts changed, so that all will keep an up-to-date ID.
Definition: kart_selection.cpp:1662
virtual void onFocusChanged(GUIEngine::Widget *previous, GUIEngine::Widget *focus, int playerID) OVERRIDE
Callback called when focus changes.
Definition: kart_selection.cpp:1266
bool joinPlayer(InputDevice *device, PlayerProfile *p)
Called when a player hits 'fire'/'select' on his device to join the game.
Definition: kart_selection.cpp:544
Class for managing player profiles (name, usage frequency, etc.).
Definition: player_profile.hpp:55
Represents a player that is currently playing.
Definition: state_manager.hpp:76
static const int PLAYER_ID_GAME_MASTER
the player ID of the "game master" player the game master is the player that can perform the game set...
Definition: state_manager.hpp:52
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33