2007-06-26 15:38:58 +03:00
|
|
|
#ifndef CPREGAME_H
|
|
|
|
#define CPREGAME_H
|
|
|
|
|
2007-06-10 06:53:29 +03:00
|
|
|
#include "SDL.h"
|
|
|
|
#include "CSemiDefHandler.h"
|
|
|
|
#include "CSemiLodHandler.h"
|
2007-06-13 17:02:43 +03:00
|
|
|
#include "CPreGameTextHandler.h"
|
2007-06-19 18:25:42 +03:00
|
|
|
#include "CMessage.h"
|
|
|
|
#include "map.h"
|
2007-06-20 15:00:18 +03:00
|
|
|
#include "CMusicHandler.h"
|
2007-06-13 17:02:43 +03:00
|
|
|
class CPreGame;
|
|
|
|
extern CPreGame * CPG;
|
2007-06-19 18:25:42 +03:00
|
|
|
class ScenSel
|
2007-06-13 17:02:43 +03:00
|
|
|
{
|
2007-06-19 18:25:42 +03:00
|
|
|
public:
|
|
|
|
SDL_Surface * background, *scenInf, *scenList, *randMap, *options ;
|
|
|
|
Button<> bScens, bOptions, bRandom, bBegin, bBack;
|
|
|
|
IntSelBut<> bEasy, bNormal, bHard, bExpert, bImpossible;
|
|
|
|
Button<> * pressed;
|
|
|
|
CPoinGroup<> * difficulty;
|
|
|
|
std::vector<Mapa> maps;
|
|
|
|
void genScenList();
|
|
|
|
int selectedDiff;
|
|
|
|
~ScenSel(){delete difficulty;};
|
|
|
|
} ;
|
2007-06-10 06:53:29 +03:00
|
|
|
class CPreGame
|
|
|
|
{
|
2007-06-19 18:25:42 +03:00
|
|
|
public:
|
2007-06-20 15:00:18 +03:00
|
|
|
CMusicHandler * mush;
|
2007-06-19 18:25:42 +03:00
|
|
|
CSemiLodHandler * slh ;
|
|
|
|
std::vector<Button<> *> btns;
|
2007-06-13 17:02:43 +03:00
|
|
|
CPreGameTextHandler * preth ;
|
|
|
|
SDL_Rect * currentMessage;
|
|
|
|
SDL_Surface * behindCurMes;
|
2007-06-14 13:14:26 +03:00
|
|
|
CSemiDefHandler *ok, *cancel;
|
2007-06-10 06:53:29 +03:00
|
|
|
enum EState { //where are we?
|
2007-06-14 13:14:26 +03:00
|
|
|
mainMenu, newGame, loadGame, ScenarioList
|
2007-06-10 06:53:29 +03:00
|
|
|
} state;
|
|
|
|
struct menuItems {
|
|
|
|
SDL_Surface * background;
|
2007-06-14 13:14:26 +03:00
|
|
|
CSemiDefHandler *newGame, *loadGame, *highScores,*credits, *quit;
|
2007-06-10 06:53:29 +03:00
|
|
|
SDL_Rect lNewGame, lLoadGame, lHighScores, lCredits, lQuit;
|
2007-06-14 16:13:04 +03:00
|
|
|
ttt fNewGame, fLoadGame, fHighScores, fCredits, fQuit;
|
2007-06-11 04:38:07 +03:00
|
|
|
int highlighted;//0=none; 1=new game; 2=load game; 3=high score; 4=credits; 5=quit
|
2007-06-14 16:13:04 +03:00
|
|
|
} * ourMainMenu, * ourNewMenu;
|
2007-06-19 18:25:42 +03:00
|
|
|
ScenSel * ourScenSel;
|
2007-06-10 06:53:29 +03:00
|
|
|
std::string map; //selected map
|
|
|
|
std::vector<CSemiLodHandler *> handledLods;
|
|
|
|
CPreGame(); //c-tor
|
2007-06-14 16:13:04 +03:00
|
|
|
std::string buttonText(int which);
|
|
|
|
menuItems * currentItems();
|
2007-06-19 18:25:42 +03:00
|
|
|
void(CPreGame::*handleOther)(SDL_Event&);
|
|
|
|
void scenHandleEv(SDL_Event& sEvent);
|
2007-06-14 16:13:04 +03:00
|
|
|
void quitAskBox();
|
2007-06-13 17:02:43 +03:00
|
|
|
void quit(){exit(0);};
|
2007-06-19 18:25:42 +03:00
|
|
|
void initScenSel();
|
|
|
|
void showScenSel();
|
|
|
|
void showScenList();
|
|
|
|
void showOptions();
|
2007-06-14 16:13:04 +03:00
|
|
|
void initNewMenu();
|
|
|
|
void showNewMenu();
|
2007-06-10 06:53:29 +03:00
|
|
|
void showMainMenu();
|
|
|
|
void runLoop(); // runs mainloop of PreGame
|
|
|
|
void initMainMenu(); //loads components for main menu
|
2007-06-11 04:38:07 +03:00
|
|
|
void highlightButton(int which, int on);
|
2007-06-13 17:02:43 +03:00
|
|
|
void showCenBox (std::string data);
|
|
|
|
void showAskBox (std::string data, void(*f1)(),void(*f2)());
|
|
|
|
void hideBox ();
|
2007-06-26 15:38:58 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //CPREGAME_H
|