Colobot
mainui.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
20 #pragma once
21 
22 #include "level/robotmain.h"
23 
24 #include <array>
25 #include <string>
26 #include <vector>
27 
28 
29 class CApplication;
30 class CSettings;
31 class CSoundInterface;
32 
33 namespace Gfx
34 {
35 class CEngine;
36 class CParticle;
37 } // namespace Gfx
38 
39 namespace Ui
40 {
41 class CInterface;
42 class CMainDialog;
43 
44 class CScreen;
45 class CScreenApperance;
46 class CScreenIORead;
47 class CScreenIOWrite;
48 class CScreenLevelList;
49 class CScreenLoading;
50 class CScreenMainMenu;
51 class CScreenPlayerSelect;
52 class CScreenQuit;
53 class CScreenSetup;
54 class CScreenSetupControls;
55 class CScreenSetupDisplay;
56 class CScreenSetupGame;
57 class CScreenSetupGraphics;
58 class CScreenSetupSound;
59 class CScreenWelcome;
60 
61 
63 {
64 public:
67 
68  CMainDialog* GetDialog();
69 
70  void ShowLoadingScreen(bool show);
71  CScreenLoading* GetLoadingScreen();
72 
73  bool EventProcess(const Event &event);
74  void ChangePhase(Phase phase);
75 
76  bool GetSceneSoluce();
77 
78  void UpdateChapterPassed();
79  void NextMission();
80 
81  bool GetGamerOnlyHead();
82  float GetPersoAngle();
83 
84  void AllMissionUpdate();
85  void ShowSoluceUpdate();
86 
87  void UpdateCustomLevelList();
88  std::string GetCustomLevelName(int id);
89  const std::vector<std::string>& GetCustomLevelList();
90 
91 protected:
92  void GlintMove();
93  void FrameParticle(float rTime);
94  void NiceParticle(Math::Point mouse, bool bPress);
95 
96  CScreenSetup* GetSetupScreen(Phase phase);
97 
98 protected:
99  CApplication* m_app;
100  CRobotMain* m_main;
101  Gfx::CEngine* m_engine;
102  Gfx::CParticle* m_particle;
103  CInterface* m_interface;
104  CSoundInterface* m_sound;
105  CSettings* m_settings;
106 
107  std::unique_ptr<CMainDialog> m_dialog;
108 
109  CScreen* m_currentScreen;
110  std::unique_ptr<CScreenApperance> m_screenAppearance;
111  std::unique_ptr<CScreenIORead> m_screenIORead;
112  std::unique_ptr<CScreenIOWrite> m_screenIOWrite;
113  std::unique_ptr<CScreenLevelList> m_screenLevelList;
114  std::unique_ptr<CScreenLoading> m_screenLoading;
115  std::unique_ptr<CScreenMainMenu> m_screenMainMenu;
116  std::unique_ptr<CScreenPlayerSelect> m_screenPlayerSelect;
117  std::unique_ptr<CScreenQuit> m_screenQuit;
118  std::unique_ptr<CScreenSetupControls> m_screenSetupControls;
119  std::unique_ptr<CScreenSetupDisplay> m_screenSetupDisplay;
120  std::unique_ptr<CScreenSetupGame> m_screenSetupGame;
121  std::unique_ptr<CScreenSetupGraphics> m_screenSetupGraphics;
122  std::unique_ptr<CScreenSetupSound> m_screenSetupSound;
123  std::unique_ptr<CScreenWelcome> m_screenWelcome;
124 
125  Phase m_phase; // copy of CRobotMain
126 
127  int m_shotDelay; // number of frames before copy
128  std::string m_shotName; // generate a file name
129 
130  Math::Point m_glintMouse;
131  float m_glintTime;
132 
133  struct Particle
134  {
135  int phase = 0;
136  float time = 0.0f;
137  Math::Point pos;
138  };
139  std::array<Particle, 10> m_particles;
140 };
141 
142 } // namespace Ui
Definition: maindialog.h:46
Definition: robotmain.h:108
Definition: mainui.h:133
CRobotMain - main class of Colobot game engine.
Definition: screen_setup.h:36
Definition: robotmain.h:159
Particle engine.
Definition: particle.h:223
Definition: settings.h:32
2D point
Definition: point.h:50
Main application.
Definition: app.h:180
Definition: screen.h:42
Namespace for (new) graphics code.
Definition: app.h:49
The graphics engine.
Definition: engine.h:585
Definition: screen_loading.h:29
Definition: mainui.h:62
Event sent by system, interface or game.
Definition: event.h:735
Definition: interface.h:59
Sound plugin interface.
Definition: sound.h:60