2015-08-06 10:59:09 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
2021-09-11 13:52:34 +00:00
|
|
|
* Copyright (C) 2001-2021, Daniel Roux, EPSITEC SA & TerranovaTeam
|
2015-08-22 14:40:02 +00:00
|
|
|
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
|
2015-08-06 10:59:09 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see http://gnu.org/licenses
|
|
|
|
*/
|
2015-08-22 15:51:39 +00:00
|
|
|
|
2015-08-06 10:59:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
2015-08-13 09:47:32 +00:00
|
|
|
#include "level/robotmain.h"
|
2015-08-06 10:59:09 +00:00
|
|
|
|
2020-07-07 19:19:59 +00:00
|
|
|
#include "ui/particles_generator.h"
|
2020-07-07 18:48:52 +00:00
|
|
|
|
2015-08-13 20:47:04 +00:00
|
|
|
#include <array>
|
|
|
|
#include <string>
|
2015-08-06 10:59:09 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
2015-08-07 18:48:55 +00:00
|
|
|
class CApplication;
|
2015-08-06 10:59:09 +00:00
|
|
|
class CSettings;
|
|
|
|
class CSoundInterface;
|
|
|
|
|
|
|
|
namespace Gfx
|
|
|
|
{
|
|
|
|
class CEngine;
|
|
|
|
class CParticle;
|
2015-09-27 14:28:11 +00:00
|
|
|
} // namespace Gfx
|
2015-08-06 10:59:09 +00:00
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class CInterface;
|
|
|
|
class CMainDialog;
|
|
|
|
|
|
|
|
class CScreen;
|
|
|
|
class CScreenApperance;
|
|
|
|
class CScreenIORead;
|
|
|
|
class CScreenIOWrite;
|
|
|
|
class CScreenLevelList;
|
|
|
|
class CScreenLoading;
|
|
|
|
class CScreenMainMenu;
|
2020-07-20 20:12:51 +00:00
|
|
|
class CScreenModList;
|
2015-08-06 10:59:09 +00:00
|
|
|
class CScreenPlayerSelect;
|
|
|
|
class CScreenQuit;
|
|
|
|
class CScreenSetup;
|
|
|
|
class CScreenSetupControls;
|
|
|
|
class CScreenSetupDisplay;
|
|
|
|
class CScreenSetupGame;
|
|
|
|
class CScreenSetupGraphics;
|
|
|
|
class CScreenSetupSound;
|
|
|
|
class CScreenWelcome;
|
|
|
|
|
|
|
|
|
2015-08-06 14:02:59 +00:00
|
|
|
class CMainUserInterface
|
2015-08-06 10:59:09 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMainUserInterface();
|
|
|
|
~CMainUserInterface();
|
|
|
|
|
|
|
|
CMainDialog* GetDialog();
|
|
|
|
|
2015-08-07 18:48:55 +00:00
|
|
|
void ShowLoadingScreen(bool show);
|
|
|
|
CScreenLoading* GetLoadingScreen();
|
|
|
|
|
2015-08-06 10:59:09 +00:00
|
|
|
bool EventProcess(const Event &event);
|
|
|
|
void ChangePhase(Phase phase);
|
|
|
|
|
|
|
|
bool GetSceneSoluce();
|
2020-07-20 16:35:31 +00:00
|
|
|
bool GetPlusTrainer();
|
|
|
|
bool GetPlusResearch();
|
|
|
|
bool GetPlusExplorer();
|
2015-08-06 10:59:09 +00:00
|
|
|
|
|
|
|
void UpdateChapterPassed();
|
|
|
|
void NextMission();
|
|
|
|
|
|
|
|
bool GetGamerOnlyHead();
|
|
|
|
float GetPersoAngle();
|
|
|
|
|
|
|
|
void AllMissionUpdate();
|
|
|
|
void ShowSoluceUpdate();
|
|
|
|
|
|
|
|
void UpdateCustomLevelList();
|
|
|
|
std::string GetCustomLevelName(int id);
|
|
|
|
const std::vector<std::string>& GetCustomLevelList();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void GlintMove();
|
|
|
|
void FrameParticle(float rTime);
|
2020-07-07 18:48:52 +00:00
|
|
|
void CreateMouseParticles(Math::Point mousePosition, bool buttonPressed);
|
2015-08-06 10:59:09 +00:00
|
|
|
CScreenSetup* GetSetupScreen(Phase phase);
|
|
|
|
|
|
|
|
protected:
|
2015-08-07 18:48:55 +00:00
|
|
|
CApplication* m_app;
|
2015-08-06 10:59:09 +00:00
|
|
|
CRobotMain* m_main;
|
|
|
|
Gfx::CEngine* m_engine;
|
2020-07-07 18:48:52 +00:00
|
|
|
Gfx::CParticle* m_particleManager;
|
2015-08-06 10:59:09 +00:00
|
|
|
CInterface* m_interface;
|
|
|
|
CSoundInterface* m_sound;
|
|
|
|
CSettings* m_settings;
|
|
|
|
|
|
|
|
std::unique_ptr<CMainDialog> m_dialog;
|
|
|
|
|
|
|
|
CScreen* m_currentScreen;
|
|
|
|
std::unique_ptr<CScreenApperance> m_screenAppearance;
|
|
|
|
std::unique_ptr<CScreenIORead> m_screenIORead;
|
|
|
|
std::unique_ptr<CScreenIOWrite> m_screenIOWrite;
|
|
|
|
std::unique_ptr<CScreenLevelList> m_screenLevelList;
|
|
|
|
std::unique_ptr<CScreenLoading> m_screenLoading;
|
|
|
|
std::unique_ptr<CScreenMainMenu> m_screenMainMenu;
|
2020-07-20 20:12:51 +00:00
|
|
|
std::unique_ptr<CScreenModList> m_screenModList;
|
2015-08-06 10:59:09 +00:00
|
|
|
std::unique_ptr<CScreenPlayerSelect> m_screenPlayerSelect;
|
|
|
|
std::unique_ptr<CScreenQuit> m_screenQuit;
|
|
|
|
std::unique_ptr<CScreenSetupControls> m_screenSetupControls;
|
|
|
|
std::unique_ptr<CScreenSetupDisplay> m_screenSetupDisplay;
|
|
|
|
std::unique_ptr<CScreenSetupGame> m_screenSetupGame;
|
|
|
|
std::unique_ptr<CScreenSetupGraphics> m_screenSetupGraphics;
|
|
|
|
std::unique_ptr<CScreenSetupSound> m_screenSetupSound;
|
|
|
|
std::unique_ptr<CScreenWelcome> m_screenWelcome;
|
|
|
|
|
|
|
|
Phase m_phase; // copy of CRobotMain
|
|
|
|
|
|
|
|
int m_shotDelay; // number of frames before copy
|
|
|
|
std::string m_shotName; // generate a file name
|
|
|
|
|
|
|
|
Math::Point m_glintMouse;
|
|
|
|
float m_glintTime;
|
|
|
|
|
2015-08-11 20:47:07 +00:00
|
|
|
struct Particle
|
|
|
|
{
|
|
|
|
int phase = 0;
|
|
|
|
float time = 0.0f;
|
|
|
|
Math::Point pos;
|
|
|
|
};
|
|
|
|
std::array<Particle, 10> m_particles;
|
2020-07-07 18:48:52 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::unique_ptr<UI::CParticlesGenerator> m_mouseParticlesGenerator;
|
|
|
|
bool isAllowedToCreateMouseParticles();
|
2015-08-06 10:59:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Ui
|