18#ifndef HEADER_TRACKS_SCREEN_HPP
19#define HEADER_TRACKS_SCREEN_HPP
21#include "guiengine/screen.hpp"
22#include "guiengine/widgets/text_box_widget.hpp"
38 class ProgressBarWidget;
45 class STKModifiedSpriteBank;
61 Track* m_selected_track = NULL;
71 irr::gui::STKModifiedSpriteBank* m_track_icons;
73 bool m_network_tracks, m_quit_server;
75 int m_bottom_box_height;
84 std::deque<std::string> m_random_track_list;
93 m_network_tracks =
false;
94 m_quit_server =
false;
95 m_bottom_box_height = -1;
104 void updateProgressBarText();
117 const std::
string& name,
118 const
int playerID) OVERRIDE;
121 virtual
void init() OVERRIDE;
133 virtual
void onUpdate(
float dt) OVERRIDE;
138 void setFocusOnTrack(const std::
string& trackName);
140 void setNetworkTracks() { m_network_tracks =
true; }
142 void setQuitServer() { m_quit_server =
true; }
152 void updatePlayerVotes();
154 virtual void onTextUpdated() OVERRIDE
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:97
Screen(bool pause_race=true)
Creates a dummy incomplete object; only use to override behaviour in sub-class.
Definition: screen.cpp:68
A text field widget.
Definition: text_box_widget.hpp:53
A simple structure to store a vote from a client: track name, number of laps and reverse or not.
Definition: peer_vote.hpp:30
Definition: track.hpp:114
screen where the user can select a track
Definition: tracks_screen.hpp:56
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:197
void removeVote(uint32_t host_id)
Removes a vote, which is triggered when a client disconnects.
Definition: tracks_screen.cpp:762
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:187
GUIEngine::ProgressBarWidget * m_timer
Pointer to progress bar widget which is used as a timer (going backwards).
Definition: tracks_screen.hpp:69
void buildTrackList()
adds the tracks from the current track group into the tracks ribbon
Definition: tracks_screen.cpp:566
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:59
std::vector< uint32_t > m_index_to_hostid
This stores which vote (hostid) is shown at which index in the vote overview list.
Definition: tracks_screen.hpp:82
virtual void onUpdate(float dt) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:708
virtual void beforeAddingWidget() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:217
void setResult(uint32_t winner_host, const PeerVote &winner_vote)
Received the winning vote.
Definition: tracks_screen.cpp:781
void addVote(uint32_t host_id, const PeerVote &vote)
Selects in which part of the vote list the new host is being shown and stores this information in the...
Definition: tracks_screen.cpp:735
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:382
uint32_t m_winning_index
Id of the winning peer.
Definition: tracks_screen.hpp:78
virtual void unloaded() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:205
virtual bool onEscapePressed() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: tracks_screen.cpp:170
void resetVote()
Called at the beginning of the voting process to reset any previous data fields.
Definition: tracks_screen.hpp:146
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33