SuperTuxKart
create_server_screen.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2013-2015 Glenn De Jonghe
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 #ifndef HEADER_CREATE_SERVER_SCREEN_HPP
19 #define HEADER_CREATE_SERVER_SCREEN_HPP
20 
21 #include "guiengine/screen.hpp"
22 #include "guiengine/widgets.hpp"
23 
24 
25 namespace GUIEngine { class Widget; class ListWidget; }
26 
32  public GUIEngine::ScreenSingleton<CreateServerScreen>
33 {
34 private:
35  int m_prev_mode, m_prev_value;
36 
37  bool m_supports_ai;
38 
40 
42 
43  GUIEngine::TextBoxWidget * m_name_widget;
44  GUIEngine::SpinnerWidget * m_max_players_widget;
45  GUIEngine::SpinnerWidget* m_more_options_spinner;
46 
47  GUIEngine::LabelWidget * m_more_options_text;
48  GUIEngine::LabelWidget * m_info_widget;
49 
50  GUIEngine::RibbonWidget * m_game_mode_widget;
51  GUIEngine::RibbonWidget * m_options_widget;
52  GUIEngine::IconButtonWidget * m_create_widget;
53  GUIEngine::IconButtonWidget * m_cancel_widget;
54 
55  void createServer();
56  void updateMoreOption(int game_mode);
57 
58 public:
59 
60  virtual void onUpdate(float delta) OVERRIDE;
61 
63  virtual void loadedFromFile() OVERRIDE;
64 
66  virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
67  const int playerID) OVERRIDE;
68 
70  virtual void init() OVERRIDE;
71 
73  virtual void tearDown() OVERRIDE;
74 
75 }; // class CreateServerScreen
76 
77 #endif
A spinner or gauge widget (to select numbers / percentages).
Definition: spinner_widget.hpp:39
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:31
void createServer()
In case of WAN it adds the server to the list of servers.
Definition: create_server_screen.cpp:258
A text field widget.
Definition: text_box_widget.hpp:52
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:86
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:50
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:43
virtual void onUpdate(float delta) OVERRIDE
Called once per framce to check if the server creation request has finished.
Definition: create_server_screen.cpp:245
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:59
A simple label widget.
Definition: label_widget.hpp:35
Represents a single GUI screen.
Definition: screen.hpp:94
Handles the main menu.
Definition: create_server_screen.hpp:31
Declares a class to be a singleton.
Definition: screen.hpp:57
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:121
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:138
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:420