1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

* new files (CAdvmapInterface.h and CAdvmapInterface.cpp)

* more player interface (but it's still beginning)
* int3 members public
* more usage of int3
* adjusted animation speed
* reversed changes from rev.165 in CPreGame - it wasn't bug, it just works so. That change was breaking a few things in CPreGame and was needless - Player ID == Player's Color. I thought it was obvious.
* minor stuff
This commit is contained in:
Michał W. Urbańczyk
2007-08-03 21:47:34 +00:00
parent 9b5686b40c
commit 0ea7a46309
16 changed files with 307 additions and 42 deletions

116
CAdvmapInterface.h Normal file
View File

@@ -0,0 +1,116 @@
#ifndef CADVENTUREMAPINTERFACE_H
#define CADVENTUREMAPINTERFACE_H
#include "SDL.h"
#include "CDefHandler.h"
#include "SDL_Extensions.h"
#include "CGameInterface.h"
#include "CGameInfo.h"
#include "SDL_Extensions.h"
#include <boost/logic/tribool.hpp>
#define CGI (CGameInfo::mainObj)
using namespace boost::logic;
using namespace CSDL_Ext;
class AdventureMapButton
: public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public CButtonBase
{
public:
std::string name; //for status bar
std::string helpBox; //for right-click help
char key; //key shortcut
void (CAdvMapInt::*function)(); //function in CAdvMapInt called when this button is pressed, different for each button
void clickRight (tribool down);
void clickLeft (tribool down);
void hover (bool on);
void keyPressed (SDL_KeyboardEvent & key);
void activate(); // makes button active
void deactivate(); // makes button inactive (but don't deletes)
AdventureMapButton(); //c-tor
AdventureMapButton( std::string Name, std::string HelpBox, void(CAdvMapInt::*Function)() );//c-tor
};
/*****************************/
class CList
: public ClickableL, public ClickableR, public Hoverable, public KeyInterested, public CIntObject
{
SDL_Surface * bg;
//arrow up, arrow down
int posw, posh; //position width/height
void clickLeft(tribool down);
void activate();
void deactivate();
virtual void select(int which)=0;
};
class CHeroList
: public CList
{
void select(int which);
void clickRight(tribool down);
};
class CTownList
: public CList
{
void select(int which);
void clickRight(tribool down);
};
class CResourceBar
:public ClickableR, public CIntObject
{
SDL_Surface * bg;
void clickRight(tribool down);
void refresh();
};
class CDataBar
:public ClickableR, public CIntObject
{
SDL_Surface * bg;
void clickRight(tribool down);
void refresh();
};
class CStatusBar
{
SDL_Surface * bg;
std::string current;
void print(std::string text);
};
class CMinimap
: public ClickableL, public ClickableR, public Hoverable, public CIntObject
{
SDL_Surface * radar; //radar.def
SDL_Surface * terrainMap;
SDL_Surface * undTerrainMap; //underground
//TODO flagged buildings
bool underground;
int3 position; //top left corner of visible map part
};
/*****************************/
class CAdvMapInt : public CGameInterface //adventure map interface
{
CAdvMapInt(int Player);
~CAdvMapInt();
int player;
SDL_Surface * bg;
AdventureMapButton kingOverview,//- kingdom overview
undeground,//- underground switch
questlog,//- questlog
sleepWake, //- sleep/wake hero
moveHero, //- move hero
spellbook,//- spellbook
advOptions, //- adventure options
sysOptions,//- system options
nextHero, //- next hero
endTurn;//- end turn
//CHeroList herolist;
void show();
};
#endif //CADVENTUREMAPINTERFACE_H