mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
* code reorganization
* minor stuff for resource <-> infoBar interaction
This commit is contained in:
@ -663,30 +663,6 @@ void CMinimap::draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//draw FoW
|
|
||||||
//for (int i=0; i<mw; i++)
|
|
||||||
//{
|
|
||||||
// for (int j=0; j<mh; j++)
|
|
||||||
// {
|
|
||||||
// int3 pp((((float)i/mw)*CGI->mh->sizes.x), (((float)j/mh)*CGI->mh->sizes.y), LOCPLINT->adventureInt->position.z);
|
|
||||||
// /*pp.x = (((float)i/mw)*CGI->mh->sizes.x);
|
|
||||||
// pp.y = (((float)j/mh)*CGI->mh->sizes.y);
|
|
||||||
// pp.z = LOCPLINT->adventureInt->position.z;*/
|
|
||||||
// if ( !LOCPLINT->cb->isVisible(pp) )
|
|
||||||
// {
|
|
||||||
// for (int ii=0; ii<wo; ii++)
|
|
||||||
// {
|
|
||||||
// for (int jj=0; jj<ho; jj++)
|
|
||||||
// {
|
|
||||||
// if ((i+ii<pos.w-1) && (j+jj<pos.h-1))
|
|
||||||
// SDL_PutPixelWithoutRefresh(temps,i+ii,j+jj,0,0,0);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//update(temps);
|
|
||||||
blitAt(FoW[LOCPLINT->adventureInt->position.z],0,0,temps);
|
blitAt(FoW[LOCPLINT->adventureInt->position.z],0,0,temps);
|
||||||
|
|
||||||
//draw radar
|
//draw radar
|
||||||
@ -864,14 +840,6 @@ void CTerrainRect::clickLeft(tribool down)
|
|||||||
//bufpos.x-=1;
|
//bufpos.x-=1;
|
||||||
if (mres)
|
if (mres)
|
||||||
currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->getPath(bufpos,mp,currentHero,1);
|
currentPath = LOCPLINT->adventureInt->heroList.items[LOCPLINT->adventureInt->heroList.selected].second = CGI->pathf->getPath(bufpos,mp,currentHero,1);
|
||||||
|
|
||||||
//if (LOCPLINT->objsToBlit.size()==0)
|
|
||||||
//{
|
|
||||||
// CSimpleWindow * temp = CMessage::genWindow(" Tutaj dlugi dlugo test Tutaj dlugi dlugi dlugo test Tutaj dlugi dlugi dlugo test Tutaj dlugi dlugi dlugo test {Tutaj tytul} Tutaj dlugi dlugi dlugo test",0);
|
|
||||||
// temp->pos.x=temp->pos.y=0;temp->ID=3;
|
|
||||||
// LOCPLINT->objsToBlit.push_back(temp);
|
|
||||||
//}
|
|
||||||
//SDL_Delay(5000);
|
|
||||||
}
|
}
|
||||||
void CTerrainRect::clickRight(tribool down)
|
void CTerrainRect::clickRight(tribool down)
|
||||||
{
|
{
|
||||||
@ -900,15 +868,8 @@ void CTerrainRect::hover(bool on)
|
|||||||
if (!on)
|
if (!on)
|
||||||
LOCPLINT->adventureInt->statusbar.clear();
|
LOCPLINT->adventureInt->statusbar.clear();
|
||||||
}
|
}
|
||||||
void CTerrainRect::show()
|
void CTerrainRect::showPath()
|
||||||
{
|
{
|
||||||
SDL_Surface * teren = CGI->mh->terrainRect
|
|
||||||
(LOCPLINT->adventureInt->position.x,LOCPLINT->adventureInt->position.y,
|
|
||||||
tilesw,tilesh,LOCPLINT->adventureInt->position.z,LOCPLINT->adventureInt->anim, LOCPLINT->cb->getVisibilityMap());
|
|
||||||
SDL_BlitSurface(teren,&genRect(pos.h,pos.w,0,0),ekran,&genRect(547,594,7,6));
|
|
||||||
SDL_FreeSurface(teren);
|
|
||||||
if (currentPath && LOCPLINT->adventureInt->position.z==currentPath->startPos().z) //drawing path
|
|
||||||
{
|
|
||||||
for (int i=0;i<currentPath->nodes.size()-1;i++)
|
for (int i=0;i<currentPath->nodes.size()-1;i++)
|
||||||
{
|
{
|
||||||
int pn=-1;//number of picture
|
int pn=-1;//number of picture
|
||||||
@ -1106,7 +1067,18 @@ void CTerrainRect::show()
|
|||||||
|
|
||||||
}
|
}
|
||||||
} //for (int i=0;i<currentPath->nodes.size()-1;i++)
|
} //for (int i=0;i<currentPath->nodes.size()-1;i++)
|
||||||
} // if (currentPath)
|
}
|
||||||
|
void CTerrainRect::show()
|
||||||
|
{
|
||||||
|
SDL_Surface * teren = CGI->mh->terrainRect
|
||||||
|
(LOCPLINT->adventureInt->position.x,LOCPLINT->adventureInt->position.y,
|
||||||
|
tilesw,tilesh,LOCPLINT->adventureInt->position.z,LOCPLINT->adventureInt->anim, LOCPLINT->cb->getVisibilityMap());
|
||||||
|
SDL_BlitSurface(teren,&genRect(pos.h,pos.w,0,0),ekran,&genRect(547,594,7,6));
|
||||||
|
SDL_FreeSurface(teren);
|
||||||
|
if (currentPath && LOCPLINT->adventureInt->position.z==currentPath->startPos().z) //drawing path
|
||||||
|
{
|
||||||
|
showPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int3 CTerrainRect::whichTileIsIt(int x, int y)
|
int3 CTerrainRect::whichTileIsIt(int x, int y)
|
||||||
|
@ -166,6 +166,7 @@ public:
|
|||||||
void mouseMoved (SDL_MouseMotionEvent & sEvent);
|
void mouseMoved (SDL_MouseMotionEvent & sEvent);
|
||||||
void keyPressed (SDL_KeyboardEvent & key);
|
void keyPressed (SDL_KeyboardEvent & key);
|
||||||
void show();
|
void show();
|
||||||
|
void showPath();
|
||||||
int3 whichTileIsIt(int x, int y); //x,y are cursor position
|
int3 whichTileIsIt(int x, int y); //x,y are cursor position
|
||||||
int3 whichTileIsIt(); //uses current cursor pos
|
int3 whichTileIsIt(); //uses current cursor pos
|
||||||
};
|
};
|
||||||
@ -190,6 +191,7 @@ class CInfoBar
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CDefHandler *day, *week1, *week2, *week3, *week4;
|
CDefHandler *day, *week1, *week2, *week3, *week4;
|
||||||
|
SComponent * current;
|
||||||
int mode;
|
int mode;
|
||||||
int pom;
|
int pom;
|
||||||
|
|
||||||
|
@ -454,6 +454,13 @@ void CScriptCallback::giveResource(int player, int which, int val)
|
|||||||
gs->players[player].resources[which]+=val;
|
gs->players[player].resources[which]+=val;
|
||||||
CGI->playerint[gs->players[player].serial]->receivedResource(which,val);
|
CGI->playerint[gs->players[player].serial]->receivedResource(which,val);
|
||||||
}
|
}
|
||||||
|
void CScriptCallback::showCompInfo(int player, SComponent * comp)
|
||||||
|
{
|
||||||
|
CPlayerInterface * i = dynamic_cast<CPlayerInterface*>(CGI->playerint[gs->players[player].serial]);
|
||||||
|
if(i)
|
||||||
|
i->showComp(*comp);
|
||||||
|
}
|
||||||
|
|
||||||
void CLuaCallback::registerFuncs(lua_State * L)
|
void CLuaCallback::registerFuncs(lua_State * L)
|
||||||
{
|
{
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
@ -94,6 +94,7 @@ public:
|
|||||||
static void changePrimSkill(int ID, int which, int val);
|
static void changePrimSkill(int ID, int which, int val);
|
||||||
void showInfoDialog(int player, std::string text, std::vector<SComponent*> * components);
|
void showInfoDialog(int player, std::string text, std::vector<SComponent*> * components);
|
||||||
void giveResource(int player, int which, int val);
|
void giveResource(int player, int which, int val);
|
||||||
|
void showCompInfo(int player, SComponent * comp);
|
||||||
|
|
||||||
//friends
|
//friends
|
||||||
friend void initGameState(CGameInfo * cgi);
|
friend void initGameState(CGameInfo * cgi);
|
||||||
|
6
CLua.cpp
6
CLua.cpp
@ -16,6 +16,8 @@
|
|||||||
#include "hch/CGeneralTextHandler.h"
|
#include "hch/CGeneralTextHandler.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "CPlayerInterface.h"
|
#include "CPlayerInterface.h"
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
|
#include <boost/algorithm/string/replace.hpp>
|
||||||
#pragma warning (disable : 4311)
|
#pragma warning (disable : 4311)
|
||||||
bool getGlobalFunc(lua_State * L, std::string fname)
|
bool getGlobalFunc(lua_State * L, std::string fname)
|
||||||
{
|
{
|
||||||
@ -470,7 +472,11 @@ void CPickable::onHeroVisit(CGObjectInstance *os, int heroID)
|
|||||||
val = 3 + (rand()%3);
|
val = 3 + (rand()%3);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
SComponent ccc(SComponent::resource,os->subID,val);
|
||||||
|
ccc.description = CGI->objh->advobtxt[113];
|
||||||
|
boost::algorithm::replace_first(ccc.description,"%s",CGI->objh->restypes[os->subID]);
|
||||||
cb->giveResource(cb->getHeroOwner(heroID),os->subID,val);
|
cb->giveResource(cb->getHeroOwner(heroID),os->subID,val);
|
||||||
|
cb->showCompInfo(cb->getHeroOwner(heroID),&ccc);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1134,6 +1134,17 @@ void CPlayerInterface::heroCreated(const CGHeroInstance * hero)
|
|||||||
heroWins.insert(std::pair<int,SDL_Surface*>(hero->subID,infoWin(hero)));
|
heroWins.insert(std::pair<int,SDL_Surface*>(hero->subID,infoWin(hero)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_Surface * CPlayerInterface::drawPrimarySkill(const CGHeroInstance *curh, SDL_Surface *ret, int from, int to)
|
||||||
|
{
|
||||||
|
char * buf = new char[10];
|
||||||
|
for (int i=from;i<to;i++)
|
||||||
|
{
|
||||||
|
itoa(curh->primSkills[i],buf,10);
|
||||||
|
printAtMiddle(buf,84+28*i,68,GEOR13,zwykly,ret);
|
||||||
|
}
|
||||||
|
delete buf;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
||||||
{
|
{
|
||||||
char * buf = new char[10];
|
char * buf = new char[10];
|
||||||
@ -1141,11 +1152,7 @@ SDL_Surface * CPlayerInterface::drawHeroInfoWin(const CGHeroInstance * curh)
|
|||||||
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format,0,255,255));
|
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format,0,255,255));
|
||||||
blueToPlayersAdv(ret,playerID,1);
|
blueToPlayersAdv(ret,playerID,1);
|
||||||
printAt(curh->name,75,15,GEOR13,zwykly,ret);
|
printAt(curh->name,75,15,GEOR13,zwykly,ret);
|
||||||
for (int i=0;i<PRIMARY_SKILLS;i++)
|
drawPrimarySkill(curh, ret);
|
||||||
{
|
|
||||||
itoa(curh->primSkills[i],buf,10);
|
|
||||||
printAtMiddle(buf,84+28*i,68,GEOR13,zwykly,ret);
|
|
||||||
}
|
|
||||||
for (std::map<int,std::pair<CCreature*,int> >::const_iterator i=curh->army.slots.begin(); i!=curh->army.slots.end();i++)
|
for (std::map<int,std::pair<CCreature*,int> >::const_iterator i=curh->army.slots.begin(); i!=curh->army.slots.end();i++)
|
||||||
{
|
{
|
||||||
blitAt(CGI->creh->smallImgs[(*i).second.first->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret);
|
blitAt(CGI->creh->smallImgs[(*i).second.first->idNumber],slotsPos[(*i).first].first+1,slotsPos[(*i).first].second+1,ret);
|
||||||
@ -1183,123 +1190,26 @@ SDL_Surface * CPlayerInterface::infoWin(const CGObjectInstance * specific) //spe
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (adventureInt->selection.type == HEROI_TYPE)
|
switch (adventureInt->selection.type)
|
||||||
|
{
|
||||||
|
case HEROI_TYPE:
|
||||||
{
|
{
|
||||||
const CGHeroInstance * curh = (const CGHeroInstance *)adventureInt->selection.selected;
|
const CGHeroInstance * curh = (const CGHeroInstance *)adventureInt->selection.selected;
|
||||||
return drawHeroInfoWin(curh);
|
return drawHeroInfoWin(curh);
|
||||||
}
|
}
|
||||||
else if (adventureInt->selection.type == TOWNI_TYPE)
|
case TOWNI_TYPE:
|
||||||
{
|
{
|
||||||
char * buf = new char[10];
|
return drawTownInfoWin((const CGTownInstance *)adventureInt->selection.selected);
|
||||||
SDL_Surface * ret = copySurface(hInfo);
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
else
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayerInterface::handleEvent(SDL_Event *sEvent)
|
void CPlayerInterface::handleMouseMotion(SDL_Event *sEvent)
|
||||||
{
|
{
|
||||||
current = sEvent;
|
|
||||||
|
|
||||||
if(sEvent->type == SDL_MOUSEMOTION)
|
|
||||||
{
|
|
||||||
CGI->curh->cursorMove(sEvent->motion.x, sEvent->motion.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sEvent->type==SDL_QUIT)
|
|
||||||
exit(0);
|
|
||||||
else if (sEvent->type==SDL_KEYDOWN)
|
|
||||||
{
|
|
||||||
switch (sEvent->key.keysym.sym)
|
|
||||||
{
|
|
||||||
case SDLK_LEFT:
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingLeft = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_RIGHT):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingRight = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_UP):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingUp = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_DOWN):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingDown = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_q):
|
|
||||||
{
|
|
||||||
exit(0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_u):
|
|
||||||
{
|
|
||||||
adventureInt->underground.clickLeft(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_m):
|
|
||||||
{
|
|
||||||
adventureInt->moveHero.clickLeft(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_e):
|
|
||||||
{
|
|
||||||
adventureInt->endTurn.clickLeft(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} //keydown end
|
|
||||||
else if(sEvent->type==SDL_KEYUP)
|
|
||||||
{
|
|
||||||
switch (sEvent->key.keysym.sym)
|
|
||||||
{
|
|
||||||
case SDLK_LEFT:
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingLeft = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_RIGHT):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingRight = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_UP):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingUp = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_DOWN):
|
|
||||||
{
|
|
||||||
LOCPLINT->adventureInt->scrollingDown = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_u):
|
|
||||||
{
|
|
||||||
adventureInt->underground.clickLeft(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_m):
|
|
||||||
{
|
|
||||||
adventureInt->moveHero.clickLeft(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case (SDLK_e):
|
|
||||||
{
|
|
||||||
adventureInt->endTurn.clickLeft(false);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}//keyup end
|
|
||||||
else if(sEvent->type==SDL_MOUSEMOTION)
|
|
||||||
{
|
|
||||||
for (int i=0; i<hoverable.size();i++)
|
for (int i=0; i<hoverable.size();i++)
|
||||||
{
|
{
|
||||||
if (isItIn(&hoverable[i]->pos,sEvent->motion.x,sEvent->motion.y))
|
if (isItIn(&hoverable[i]->pos,sEvent->motion.x,sEvent->motion.y))
|
||||||
@ -1351,6 +1261,116 @@ void CPlayerInterface::handleEvent(SDL_Event *sEvent)
|
|||||||
{
|
{
|
||||||
LOCPLINT->adventureInt->scrollingDown = false;
|
LOCPLINT->adventureInt->scrollingDown = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
void CPlayerInterface::handleKeyUp(SDL_Event *sEvent)
|
||||||
|
{
|
||||||
|
switch (sEvent->key.keysym.sym)
|
||||||
|
{
|
||||||
|
case SDLK_LEFT:
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingLeft = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_RIGHT):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingRight = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_UP):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingUp = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_DOWN):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingDown = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_u):
|
||||||
|
{
|
||||||
|
adventureInt->underground.clickLeft(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_m):
|
||||||
|
{
|
||||||
|
adventureInt->moveHero.clickLeft(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_e):
|
||||||
|
{
|
||||||
|
adventureInt->endTurn.clickLeft(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void CPlayerInterface::handleKeyDown(SDL_Event *sEvent)
|
||||||
|
{
|
||||||
|
switch (sEvent->key.keysym.sym)
|
||||||
|
{
|
||||||
|
case SDLK_LEFT:
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingLeft = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_RIGHT):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingRight = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_UP):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingUp = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_DOWN):
|
||||||
|
{
|
||||||
|
LOCPLINT->adventureInt->scrollingDown = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_q):
|
||||||
|
{
|
||||||
|
exit(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_u):
|
||||||
|
{
|
||||||
|
adventureInt->underground.clickLeft(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_m):
|
||||||
|
{
|
||||||
|
adventureInt->moveHero.clickLeft(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case (SDLK_e):
|
||||||
|
{
|
||||||
|
adventureInt->endTurn.clickLeft(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void CPlayerInterface::handleEvent(SDL_Event *sEvent)
|
||||||
|
{
|
||||||
|
current = sEvent;
|
||||||
|
|
||||||
|
if(sEvent->type == SDL_MOUSEMOTION)
|
||||||
|
{
|
||||||
|
CGI->curh->cursorMove(sEvent->motion.x, sEvent->motion.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sEvent->type==SDL_QUIT)
|
||||||
|
exit(0);
|
||||||
|
else if (sEvent->type==SDL_KEYDOWN)
|
||||||
|
{
|
||||||
|
handleKeyDown(sEvent);
|
||||||
|
} //keydown end
|
||||||
|
else if(sEvent->type==SDL_KEYUP)
|
||||||
|
{
|
||||||
|
handleKeyUp(sEvent);
|
||||||
|
}//keyup end
|
||||||
|
else if(sEvent->type==SDL_MOUSEMOTION)
|
||||||
|
{
|
||||||
|
handleMouseMotion(sEvent);
|
||||||
} //mousemotion end
|
} //mousemotion end
|
||||||
|
|
||||||
else if ((sEvent->type==SDL_MOUSEBUTTONDOWN) && (sEvent->button.button == SDL_BUTTON_LEFT))
|
else if ((sEvent->type==SDL_MOUSEBUTTONDOWN) && (sEvent->button.button == SDL_BUTTON_LEFT))
|
||||||
@ -1427,6 +1447,12 @@ void CPlayerInterface::receivedResource(int type, int val)
|
|||||||
{
|
{
|
||||||
adventureInt->resdatabar.draw();
|
adventureInt->resdatabar.draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlayerInterface::showComp(SComponent comp)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void CPlayerInterface::showInfoDialog(std::string text, std::vector<SComponent*> & components)
|
void CPlayerInterface::showInfoDialog(std::string text, std::vector<SComponent*> & components)
|
||||||
{
|
{
|
||||||
adventureInt->hide(); //dezaktywacja starego interfejsu
|
adventureInt->hide(); //dezaktywacja starego interfejsu
|
||||||
|
@ -206,13 +206,20 @@ public:
|
|||||||
void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val);
|
void heroPrimarySkillChanged(const CGHeroInstance * hero, int which, int val);
|
||||||
void receivedResource(int type, int val);
|
void receivedResource(int type, int val);
|
||||||
|
|
||||||
|
void showComp(SComponent comp);
|
||||||
|
|
||||||
SDL_Surface * infoWin(const CGObjectInstance * specific); //specific=0 => draws info about selected town/hero //TODO - gdy sie dorobi sensowna hierarchie klas ins. to wywalic tego brzydkiego void*
|
SDL_Surface * infoWin(const CGObjectInstance * specific); //specific=0 => draws info about selected town/hero //TODO - gdy sie dorobi sensowna hierarchie klas ins. to wywalic tego brzydkiego void*
|
||||||
void handleEvent(SDL_Event * sEvent);
|
void handleEvent(SDL_Event * sEvent);
|
||||||
|
void handleKeyDown(SDL_Event *sEvent);
|
||||||
|
void handleKeyUp(SDL_Event *sEvent);
|
||||||
|
void handleMouseMotion(SDL_Event *sEvent);
|
||||||
void init(ICallback * CB);
|
void init(ICallback * CB);
|
||||||
int3 repairScreenPos(int3 pos);
|
int3 repairScreenPos(int3 pos);
|
||||||
void showInfoDialog(std::string text, std::vector<SComponent*> & components);
|
void showInfoDialog(std::string text, std::vector<SComponent*> & components);
|
||||||
void removeObjToBlit(IShowable* obj);
|
void removeObjToBlit(IShowable* obj);
|
||||||
SDL_Surface * drawHeroInfoWin(const CGHeroInstance * curh);
|
SDL_Surface * drawHeroInfoWin(const CGHeroInstance * curh);
|
||||||
|
SDL_Surface * drawPrimarySkill(const CGHeroInstance *curh, SDL_Surface *ret, int from=0, int to=PRIMARY_SKILLS);
|
||||||
|
|
||||||
SDL_Surface * drawTownInfoWin(const CGTownInstance * curh);
|
SDL_Surface * drawTownInfoWin(const CGTownInstance * curh);
|
||||||
|
|
||||||
CPlayerInterface(int Player, int serial);
|
CPlayerInterface(int Player, int serial);
|
||||||
|
Reference in New Issue
Block a user