Tinman  1.0
menu.h
Go to the documentation of this file.
1 // -*- coding:utf-8; tab-width:4; mode:cpp -*-
2 // Tinman author: Isaac Lacoba Molina
3 // Copyright (C) 2014 ISAAC LACOBA MOLINA
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (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, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef MENU_H
19 #define MENU_H
20 #include "state.h"
21 #include <Ice/Ice.h>
22 
23 class Car;
24 
25 class Menu: public State {
26  CEGUI::Window* menu_window_, *credits_window_,
28  Ice::AsyncResultPtr login_;
29  bool autologin_;
30  Ogre::OverlayElement *background_;
31  std::shared_ptr<Car> expose_car_;
32 
33  public:
34  typedef std::shared_ptr<Menu> shared;
35  Menu(std::shared_ptr<Game> game);
36  virtual ~Menu();
37 
38  void enter();
39  void update(float delta);
40 
41  void hide_waiting_screen();
42 
43  private:
44  bool show_login(const CEGUI::EventArgs &event);
45  bool show_menu(const CEGUI::EventArgs &event);
46  bool show_credits(const CEGUI::EventArgs &event);
47  bool show_mode_window(const CEGUI::EventArgs &event);
48  bool change_bots_mode(const CEGUI::EventArgs &event);
49 
50  void add_hooks();
51  void add_hooks(CEGUI::Window* window, const std::string& button,
52  const CEGUI::Event::Subscriber& callback);
53  void add_gui_hooks();
54  void init_gui();
55  void load_window();
56 
57  void autologin();
58  bool login(const CEGUI::EventArgs &event);
59 
60  void create_scene();
61  void complete_login();
62 };
63 #endif
bool show_mode_window(const CEGUI::EventArgs &event)
Definition: menu.cpp:140
void create_scene()
Definition: menu.cpp:220
std::shared_ptr< Car > expose_car_
Definition: menu.h:31
void add_gui_hooks()
Definition: menu.cpp:177
void add_hooks()
Definition: menu.cpp:171
void init_gui()
Definition: menu.cpp:40
bool change_bots_mode(const CEGUI::EventArgs &event)
Definition: menu.cpp:200
bool autologin_
Definition: menu.h:29
CEGUI::Window * config_window_
Definition: menu.h:26
void complete_login()
Definition: menu.cpp:210
void update(float delta)
Definition: menu.cpp:162
Definition: car.h:42
CEGUI::Window * waiting_window_
Definition: menu.h:26
void hide_waiting_screen()
Definition: menu.cpp:120
bool show_login(const CEGUI::EventArgs &event)
Definition: menu.cpp:92
Definition: state.h:28
CEGUI::Window * menu_window_
Definition: menu.h:26
void autologin()
Definition: menu.cpp:47
Definition: menu.h:25
bool login(const CEGUI::EventArgs &event)
Definition: menu.cpp:156
CEGUI::Window * mode_window_
Definition: menu.h:26
CEGUI::Window * credits_window_
Definition: menu.h:26
void enter()
Definition: menu.cpp:30
bool show_menu(const CEGUI::EventArgs &event)
Definition: menu.cpp:105
virtual ~Menu()
Definition: menu.cpp:25
Menu(std::shared_ptr< Game > game)
Definition: menu.cpp:21
bool show_credits(const CEGUI::EventArgs &event)
Definition: menu.cpp:127
void load_window()
Definition: menu.cpp:72
Ice::AsyncResultPtr login_
Definition: menu.h:28
Ogre::OverlayElement * background_
Definition: menu.h:30
std::shared_ptr< Menu > shared
Definition: menu.h:34