SuperTuxKart
Loading...
Searching...
No Matches
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
25namespace GUIEngine { class Widget; class ListWidget; }
26
32 public GUIEngine::ScreenSingleton<CreateServerScreen>
33{
34private:
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 GUIEngine::IconButtonWidget * m_back_widget;
55
56 void createServer();
57 void updateMoreOption(int game_mode);
58
59public:
60
61 virtual void onUpdate(float delta) OVERRIDE;
62
64 virtual void loadedFromFile() OVERRIDE;
65
67 virtual void beforeAddingWidget() OVERRIDE;
68
70 virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
71 const int playerID) OVERRIDE;
72
74 virtual void init() OVERRIDE;
75
77 virtual void tearDown() OVERRIDE;
78
79}; // class CreateServerScreen
80
81#endif
Handles the main menu.
Definition: create_server_screen.hpp:33
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:143
virtual void onUpdate(float delta) OVERRIDE
Called once per framce to check if the server creation request has finished.
Definition: create_server_screen.cpp:272
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:53
virtual void beforeAddingWidget() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:131
virtual void tearDown() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:443
void createServer()
In case of WAN it adds the server to the list of servers.
Definition: create_server_screen.cpp:285
virtual void init() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: create_server_screen.cpp:91
A button widget with an icon and optionnaly a label beneath.
Definition: icon_button_widget.hpp:44
A simple label widget.
Definition: label_widget.hpp:36
A static text/icons/tabs bar widget.
Definition: ribbon_widget.hpp:60
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:97
A spinner or gauge widget (to select numbers / percentages).
Definition: spinner_widget.hpp:41
A text field widget.
Definition: text_box_widget.hpp:53
The nearly-abstract base of all widgets (not fully abstract since a bare Widget can be created for th...
Definition: widget.hpp:143
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33