HoverRace  2.0
MainMenuScene.h
Go to the documentation of this file.
1 
2 // MainMenuScene.h
3 //
4 // Copyright (c) 2013-2016 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include "GameDirector.h"
25 
26 #include "FormScene.h"
27 
28 namespace HoverRace {
29  namespace Display {
30  class Button;
31  class Container;
32  class Display;
33  }
34 }
35 
36 namespace HoverRace {
37 namespace Client {
38 
43 class MainMenuScene : public FormScene
44 {
45  using SUPER = FormScene;
46 
47 public:
49  RulebookLibrary &rulebookLibrary);
50  virtual ~MainMenuScene();
51 
52 private:
53  std::shared_ptr<Display::Button> AddButton(const std::string &text,
54  bool enabled = true, bool focused = false);
55 
56 private:
57  void OnPracticeClicked();
58  void OnMultiplayerClicked();
59  void OnSettingsClicked();
60  void OnMutedClicked();
61 
62 public:
63  // Scene
64  void OnStateChanged(State oldState) override;
65  void OnStateTransition(double interval) override;
66  void Layout() override;
67  void PrepareRender() override;
68  void Render() override;
69 
70 private:
74 
75  std::unique_ptr<Display::FillBox> letterUpBox;
76  std::unique_ptr<Display::FillBox> letterDownBox;
77  std::shared_ptr<Display::Container> titleContainer;
78  std::shared_ptr<Display::Container> menuContainer;
79  std::vector<std::shared_ptr<Display::Button>> menuButtons;
80  boost::signals2::scoped_connection displayConfigChangedConn;
81 };
82 
83 } // namespace Client
84 } // namespace HoverRace
RulebookLibrary & rulebookLibrary
Definition: MainMenuScene.h:73
The title scene.
Definition: MainMenuScene.h:43
std::shared_ptr< Display::Container > menuContainer
Definition: MainMenuScene.h:78
Interface for game client shells.
Definition: GameDirector.h:57
Display::Display & display
Definition: MainMenuScene.h:71
Base class for UI-centric scenes.
Definition: UiScene.h:42
GameDirector & director
Definition: TestLabScene.cpp:160
GameDirector & director
Definition: MainMenuScene.h:72
std::unique_ptr< Display::FillBox > letterDownBox
Definition: MainMenuScene.h:76
Base class for display managers.
Definition: Display.h:73
State
Definition: Scene.h:54
Base class for full-scene menus and the like.
Definition: FormScene.h:48
std::unique_ptr< Display::FillBox > letterUpBox
Definition: MainMenuScene.h:75
boost::signals2::scoped_connection displayConfigChangedConn
Definition: MainMenuScene.h:80
The collection of all registered rulebooks.
Definition: RulebookLibrary.h:40
std::shared_ptr< Display::Container > titleContainer
Definition: MainMenuScene.h:77
Definition: Announcement.h:24
std::vector< std::shared_ptr< Display::Button > > menuButtons
Definition: MainMenuScene.h:79