2011-01-20 16:56:30 +01:00
|
|
|
// ==============================================================
|
|
|
|
// This file is part of Glest (www.glest.org)
|
|
|
|
//
|
2011-12-14 08:40:48 +01:00
|
|
|
// Copyright (C) 2001-2008 Martiño Figueroa
|
2011-01-20 16:56:30 +01:00
|
|
|
//
|
|
|
|
// You can redistribute this code and/or modify it under
|
|
|
|
// the terms of the GNU General Public License as published
|
|
|
|
// by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version
|
|
|
|
// ==============================================================
|
|
|
|
|
|
|
|
#ifndef _GLEST_GAME_BATTLEEND_H_
|
|
|
|
#define _GLEST_GAME_BATTLEEND_H_
|
|
|
|
|
2012-04-20 03:04:05 +02:00
|
|
|
#ifdef WIN32
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <winsock.h>
|
|
|
|
#endif
|
|
|
|
|
2011-01-20 16:56:30 +01:00
|
|
|
#include "program.h"
|
|
|
|
#include "stats.h"
|
|
|
|
#include "leak_dumper.h"
|
|
|
|
|
2012-09-25 02:23:25 +02:00
|
|
|
namespace Shared { namespace Graphics {
|
|
|
|
class VideoPlayer;
|
|
|
|
}}
|
|
|
|
|
2011-01-20 16:56:30 +01:00
|
|
|
namespace Glest{ namespace Game{
|
|
|
|
|
2012-09-25 02:23:25 +02:00
|
|
|
class GameSettings;
|
2011-01-20 16:56:30 +01:00
|
|
|
// =====================================================
|
|
|
|
// class BattleEnd
|
|
|
|
//
|
|
|
|
/// ProgramState representing the end of the game
|
|
|
|
// =====================================================
|
|
|
|
|
|
|
|
class BattleEnd: public ProgramState{
|
|
|
|
private:
|
|
|
|
Stats stats;
|
|
|
|
|
|
|
|
GraphicButton buttonExit;
|
|
|
|
int mouse2d;
|
|
|
|
GraphicMessageBox mainMessageBox;
|
2011-06-12 07:54:54 +02:00
|
|
|
Texture2D *renderToTexture;
|
2013-03-16 07:55:16 +01:00
|
|
|
uint64 renderToTextureCount;
|
2011-10-21 21:52:55 +02:00
|
|
|
ProgramState *originState;
|
2011-10-25 20:39:11 +02:00
|
|
|
const char *containerName;
|
2011-01-20 16:56:30 +01:00
|
|
|
|
2013-11-19 22:57:28 +01:00
|
|
|
::Shared::Graphics::VideoPlayer *menuBackgroundVideo;
|
2012-09-25 02:23:25 +02:00
|
|
|
GameSettings *gameSettings;
|
2012-09-25 03:52:09 +02:00
|
|
|
StrSound battleEndMusic;
|
2012-09-25 02:23:25 +02:00
|
|
|
|
2011-01-20 16:56:30 +01:00
|
|
|
void showMessageBox(const string &text, const string &header, bool toggle);
|
|
|
|
|
|
|
|
public:
|
2011-10-21 21:52:55 +02:00
|
|
|
BattleEnd(Program *program, const Stats *stats, ProgramState *originState);
|
2011-01-20 16:56:30 +01:00
|
|
|
~BattleEnd();
|
2011-09-27 20:44:01 +02:00
|
|
|
|
2011-01-20 16:56:30 +01:00
|
|
|
virtual void update();
|
|
|
|
virtual void render();
|
2011-11-21 20:00:20 +01:00
|
|
|
virtual void keyDown(SDL_KeyboardEvent key);
|
2011-01-20 16:56:30 +01:00
|
|
|
virtual void mouseDownLeft(int x, int y);
|
|
|
|
virtual void mouseMove(int x, int y, const MouseState *ms);
|
2011-07-01 04:50:20 +02:00
|
|
|
//virtual void tick();
|
2011-10-25 20:39:11 +02:00
|
|
|
virtual void reloadUI();
|
2012-09-02 11:04:36 +02:00
|
|
|
|
|
|
|
private:
|
2012-09-25 02:23:25 +02:00
|
|
|
|
|
|
|
void initBackgroundVideo();
|
|
|
|
std::pair<string,string> getBattleEndVideo(bool won);
|
2012-09-25 03:52:09 +02:00
|
|
|
string getBattleEndMusic(bool won);
|
|
|
|
void initBackgroundMusic();
|
2011-01-20 16:56:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}}//end namespace
|
|
|
|
|
|
|
|
#endif
|