Colobot
mainui.h
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2015, 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 }
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  void Create();
68 
69  CMainDialog* GetDialog();
70 
71  void ShowLoadingScreen(bool show);
72  CScreenLoading* GetLoadingScreen();
73 
74  bool EventProcess(const Event &event);
75  void ChangePhase(Phase phase);
76 
77  bool GetSceneSoluce();
78 
79  void UpdateChapterPassed();
80  void NextMission();
81 
82  bool GetGamerOnlyHead();
83  float GetPersoAngle();
84 
85  void AllMissionUpdate();
86  void ShowSoluceUpdate();
87 
88  void UpdateCustomLevelList();
89  std::string GetCustomLevelName(int id);
90  const std::vector<std::string>& GetCustomLevelList();
91 
92 protected:
93  void GlintMove();
94  void FrameParticle(float rTime);
95  void NiceParticle(Math::Point mouse, bool bPress);
96 
97  CScreenSetup* GetSetupScreen(Phase phase);
98 
99 protected:
100  CApplication* m_app;
101  CRobotMain* m_main;
102  Gfx::CEngine* m_engine;
103  Gfx::CParticle* m_particle;
104  CInterface* m_interface;
105  CSoundInterface* m_sound;
106  CSettings* m_settings;
107 
108  std::unique_ptr<CMainDialog> m_dialog;
109 
110  CScreen* m_currentScreen;
111  std::unique_ptr<CScreenApperance> m_screenAppearance;
112  std::unique_ptr<CScreenIORead> m_screenIORead;
113  std::unique_ptr<CScreenIOWrite> m_screenIOWrite;
114  std::unique_ptr<CScreenLevelList> m_screenLevelList;
115  std::unique_ptr<CScreenLoading> m_screenLoading;
116  std::unique_ptr<CScreenMainMenu> m_screenMainMenu;
117  std::unique_ptr<CScreenPlayerSelect> m_screenPlayerSelect;
118  std::unique_ptr<CScreenQuit> m_screenQuit;
119  std::unique_ptr<CScreenSetupControls> m_screenSetupControls;
120  std::unique_ptr<CScreenSetupDisplay> m_screenSetupDisplay;
121  std::unique_ptr<CScreenSetupGame> m_screenSetupGame;
122  std::unique_ptr<CScreenSetupGraphics> m_screenSetupGraphics;
123  std::unique_ptr<CScreenSetupSound> m_screenSetupSound;
124  std::unique_ptr<CScreenWelcome> m_screenWelcome;
125 
126  Phase m_phase; // copy of CRobotMain
127 
128  int m_shotDelay; // number of frames before copy
129  std::string m_shotName; // generate a file name
130 
131  Math::Point m_glintMouse;
132  float m_glintTime;
133 
134  struct Particle
135  {
136  int phase = 0;
137  float time = 0.0f;
138  Math::Point pos;
139  };
140  std::array<Particle, 10> m_particles;
141 };
142 
143 } // namespace Ui
Definition: maindialog.h:44
Definition: robotmain.h:107
Definition: mainui.h:134
CRobotMain - main class of Colobot game engine.
Definition: screen_setup.h:36
Definition: robotmain.h:151
Particle engine.
Definition: particle.h:223
Definition: settings.h:31
2D point
Definition: point.h:50
Main application.
Definition: app.h:191
Definition: screen.h:42
Namespace for (new) graphics code.
Definition: app.h:49
The graphics engine.
Definition: engine.h:620
Definition: screen_loading.h:29
Definition: mainui.h:62
Event sent by system, interface or game.
Definition: event.h:709
Definition: interface.h:58
Sound plugin interface.
Definition: sound.h:57