SuperTuxKart
track_info_screen.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2009-2015 Marianne Gagnon
3 // (C) 2014-2015 Joerg Henrichs
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 3
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 
20 #ifndef HEADER_TRACK_INFO_SCREEN_HPP
21 #define HEADER_TRACK_INFO_SCREEN_HPP
22 
23 #include "guiengine/screen.hpp"
24 #include "guiengine/widgets.hpp"
25 
26 namespace GUIEngine
27 {
28  class CheckBoxWidget;
29  class IconButtonWidget;
30  class LabelWidget;
31  class SpinnerWidget;
32  class Widget;
33 }
34 class Track;
35 
41  public GUIEngine::ScreenSingleton<TrackInfoScreen>
42 {
43  static const int HIGHSCORE_COUNT = 5;
44 
47 
48  bool m_record_this_race;
49 
50  bool m_is_soccer;
51 
52  bool m_is_lap_trial;
53 
54  bool m_show_ffa_spinner;
55 
56  // When there is no need to tab through / click on images/labels, we can add directly
57  // irrlicht labels (more complicated uses require the use of our widget set)
58 
61 
64 
67 
70 
71  /* The div that contains the blue ai spinner and label */
72  GUIEngine::Widget* m_ai_blue_div;
73 
74  /* The div that contains the target type spinner and label */
75  GUIEngine::Widget* m_target_type_div;
76 
79 
82 
85 
88 
91 
94 
97 
100 
101  irr::gui::STKModifiedSpriteBank* m_icon_bank;
102 
103  int m_icon_unknown_kart;
104 
105  void updateHighScores();
106  void setSoccerWidgets(bool has_AI);
107  void setSoccerTarget(bool time_limit);
108  void soccerSpinnerUpdate(bool blue_spinner);
109 
110 public:
111  TrackInfoScreen();
112  virtual ~TrackInfoScreen();
113 
114  virtual void init() OVERRIDE;
115  virtual void beforeAddingWidget() OVERRIDE;
116  virtual void loadedFromFile() OVERRIDE;
117  virtual void tearDown() OVERRIDE;
118  virtual void unloaded() OVERRIDE;
119  virtual void eventCallback(GUIEngine::Widget *,const std::string &name ,
120  const int player_id) OVERRIDE;
121 
122  void onEnterPressedInternal();
123  void setTrack(Track *track);
124 };
125 
126 #endif
A spinner or gauge widget (to select numbers / percentages).
Definition: spinner_widget.hpp:40
Track * m_track
A pointer to the track of which the info is shown.
Definition: track_info_screen.hpp:46
GUIEngine::LabelWidget * m_target_value_label
The label besides the target value spinner.
Definition: track_info_screen.hpp:81
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
GUIEngine::LabelWidget * m_highscore_label
The label of the highscore list.
Definition: track_info_screen.hpp:96
GUIEngine::SpinnerWidget * m_target_type_spinner
Spinner for target types.
Definition: track_info_screen.hpp:60
GUIEngine::ListWidget * m_highscore_entries
The actual highscore text values shown.
Definition: track_info_screen.hpp:99
A checkbox widget.
Definition: check_box_widget.hpp:33
GUIEngine::SpinnerWidget * m_ai_blue_spinner
Spinner for number of blue AI karts.
Definition: track_info_screen.hpp:66
GUIEngine::LabelWidget * m_ai_blue_label
The label besides the blue AI karts spinner.
Definition: track_info_screen.hpp:69
GUIEngine::CheckBoxWidget * m_option
Check box for reverse mode or random item in arena.
Definition: track_info_screen.hpp:90
Dialog that shows the information about a given track.
Definition: track_info_screen.hpp:40
GUIEngine::LabelWidget * m_ai_kart_label
The label besides the AI karts spinner.
Definition: track_info_screen.hpp:87
GUIEngine::SpinnerWidget * m_target_value_spinner
Spinner for target value e.g.
Definition: track_info_screen.hpp:78
A vertical list widget with text entries.
Definition: list_widget.hpp:49
A simple label widget.
Definition: label_widget.hpp:35
Definition: script_track.cpp:52
Represents a single GUI screen.
Definition: screen.hpp:96
Declares a class to be a singleton.
Definition: screen.hpp:58
GUIEngine::SpinnerWidget * m_ai_kart_spinner
Spinner for number of AI karts.
Definition: track_info_screen.hpp:84
GUIEngine::CheckBoxWidget * m_record_race
Check box for record race.
Definition: track_info_screen.hpp:93
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:142
GUIEngine::LabelWidget * m_target_type_label
The label besides the target types spinner.
Definition: track_info_screen.hpp:63