HoverRace  2.0
StatusOverlayScene.h
Go to the documentation of this file.
1 
2 // StatusOverlayScene.h
3 //
4 // Copyright (c) 2014-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 "UiScene.h"
27 
28 namespace HoverRace {
29  namespace Client {
30  class Announcement;
31  class BulletinBoard;
32  class PlayerBar;
33  }
34  namespace Display {
35  class Display;
36  }
37  namespace Player {
38  class Player;
39  }
40 }
41 
42 namespace HoverRace {
43 namespace Client {
44 
50 {
51  using SUPER = UiScene;
52 
53 public:
55  virtual ~StatusOverlayScene();
56 
57 public:
58  bool IsMouseCursorEnabled() const override { return true; }
59 
60 public:
61  void PresentInitialState();
62  void Announce(std::shared_ptr<Announcement> ann);
63 
64 public:
65  void AttachController(Control::InputEventController &controller,
66  ConnList &conns) override;
67 
68 private:
69  void OnDisplayConfigChanged();
70  void OnMouseMoved(const Vec2 &pos);
71  bool OnMousePressed(const Control::Mouse::Click &click);
72  bool OnMouseReleased(const Control::Mouse::Click &click);
73 
74 public:
75  void Layout() override;
76  void Advance(Util::OS::timestamp_t tick) override;
77  void PrepareRender() override;
78  void Render() override;
79 
80 private:
84  std::unique_ptr<BulletinBoard> bulletinBoard;
85  std::unique_ptr<PlayerBar> playerBar;
86  boost::signals2::scoped_connection displayConfigChangedConn;
87 };
88 
89 } // namespace HoverScript
90 } // namespace Client
Interface for game client shells.
Definition: GameDirector.h:57
Base class for UI-centric scenes.
Definition: UiScene.h:42
Display::Display & display
Definition: StatusOverlayScene.h:81
Mouse click events.
Definition: Action.h:67
GameDirector & director
Definition: TestLabScene.cpp:160
std::array< boost::signals2::scoped_connection, 2 > conns
Definition: ProfileEditScene.cpp:152
Definition: Vec.h:38
Base class for display managers.
Definition: Display.h:73
std::unique_ptr< PlayerBar > playerBar
Definition: StatusOverlayScene.h:85
bool IsMouseCursorEnabled() const override
Determine if the mouse cursor is enabled for this scene.
Definition: StatusOverlayScene.h:58
bool presentedInitialState
Definition: StatusOverlayScene.h:83
std::unique_ptr< BulletinBoard > bulletinBoard
Definition: StatusOverlayScene.h:84
Tracks connections as a group.
Definition: Scene.h:69
boost::signals2::scoped_connection displayConfigChangedConn
Definition: StatusOverlayScene.h:86
Overlay for showing connected players, pop-up messages, etc.
Definition: StatusOverlayScene.h:49
Definition: Announcement.h:24
GameDirector & director
Definition: StatusOverlayScene.h:82
std::shared_ptr< Announcement > ann
Definition: ClientApp.cpp:110
Translates input events into actions.
Definition: Controller.h:106
MR_Int64 timestamp_t
Definition: OS.h:55