mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-04 23:17:41 +02:00
showInfoDialog should be compatible with interfaces other than advmapint.
This commit is contained in:
parent
34f791a0bf
commit
d64dfa0a23
@ -1343,8 +1343,18 @@ void CAdvMapInt::fendTurn()
|
|||||||
LOCPLINT->makingTurn = false;
|
LOCPLINT->makingTurn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAdvMapInt::activate()
|
||||||
|
{
|
||||||
|
//todo - docelowo wartoby rozdzielic czesc odpowiedzialna za wyswietlanie i aktywacje
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
void CAdvMapInt::deactivate()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
void CAdvMapInt::show()
|
void CAdvMapInt::show()
|
||||||
{
|
{
|
||||||
|
LOCPLINT->curint = this;
|
||||||
blitAt(bg,0,0);
|
blitAt(bg,0,0);
|
||||||
|
|
||||||
kingOverview.show();
|
kingOverview.show();
|
||||||
|
@ -193,7 +193,7 @@ public:
|
|||||||
CDefHandler * getAnim(int mode);
|
CDefHandler * getAnim(int mode);
|
||||||
};
|
};
|
||||||
/*****************************/
|
/*****************************/
|
||||||
class CAdvMapInt //adventure map interface
|
class CAdvMapInt : public IActivable //adventure map interface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CAdvMapInt(int Player);
|
CAdvMapInt(int Player);
|
||||||
@ -258,6 +258,9 @@ public:
|
|||||||
void fnextHero();
|
void fnextHero();
|
||||||
void fendTurn();
|
void fendTurn();
|
||||||
|
|
||||||
|
void activate();
|
||||||
|
void deactivate();
|
||||||
|
|
||||||
void show(); //shows and activates adv. map interface
|
void show(); //shows and activates adv. map interface
|
||||||
void hide(); //deactivates advmap interface
|
void hide(); //deactivates advmap interface
|
||||||
void update(); //redraws terrain
|
void update(); //redraws terrain
|
||||||
|
@ -286,6 +286,7 @@ void CCastleInterface::show(SDL_Surface * to)
|
|||||||
}
|
}
|
||||||
void CCastleInterface::activate()
|
void CCastleInterface::activate()
|
||||||
{
|
{
|
||||||
|
LOCPLINT->curint = this;
|
||||||
//for(int i=0;i<buildings.size();i++)
|
//for(int i=0;i<buildings.size();i++)
|
||||||
// buildings[i]->activate();
|
// buildings[i]->activate();
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
void clickRight (tribool down);
|
void clickRight (tribool down);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CCastleInterface : public IShowable
|
class CCastleInterface : public IShowable, public IActivable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SDL_Surface * townInt;
|
SDL_Surface * townInt;
|
||||||
|
@ -343,6 +343,7 @@ void CHeroWindow::quit()
|
|||||||
|
|
||||||
void CHeroWindow::activate()
|
void CHeroWindow::activate()
|
||||||
{
|
{
|
||||||
|
LOCPLINT->curint = this;
|
||||||
quitButton->activate();
|
quitButton->activate();
|
||||||
dismissButton->activate();
|
dismissButton->activate();
|
||||||
questlogButton->activate();
|
questlogButton->activate();
|
||||||
@ -361,6 +362,24 @@ void CHeroWindow::activate()
|
|||||||
//LOCPLINT->lclickable.push_back(artFeet);
|
//LOCPLINT->lclickable.push_back(artFeet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CHeroWindow::deactivate()
|
||||||
|
{
|
||||||
|
quitButton->deactivate();
|
||||||
|
dismissButton->deactivate();
|
||||||
|
questlogButton->deactivate();
|
||||||
|
gar1button->deactivate();
|
||||||
|
gar2button->deactivate();
|
||||||
|
gar3button->deactivate();
|
||||||
|
gar4button->deactivate();
|
||||||
|
leftArtRoll->deactivate();
|
||||||
|
rightArtRoll->deactivate();
|
||||||
|
portraitArea->deactivate();
|
||||||
|
for(int g=0; g<heroList.size(); ++g)
|
||||||
|
{
|
||||||
|
heroList[g]->deactivate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CHeroWindow::dismissCurrent()
|
void CHeroWindow::dismissCurrent()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public:
|
|||||||
void show(SDL_Surface * to = NULL);
|
void show(SDL_Surface * to = NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CHeroWindow: public IShowable, public virtual CIntObject
|
class CHeroWindow: public IActivable, public IShowable, public virtual CIntObject
|
||||||
{
|
{
|
||||||
SDL_Surface * background, * curBack;
|
SDL_Surface * background, * curBack;
|
||||||
const CGHeroInstance * curHero;
|
const CGHeroInstance * curHero;
|
||||||
@ -56,6 +56,7 @@ public:
|
|||||||
~CHeroWindow(); //d-tor
|
~CHeroWindow(); //d-tor
|
||||||
void setHero(const CGHeroInstance * hero); //sets main displayed hero
|
void setHero(const CGHeroInstance * hero); //sets main displayed hero
|
||||||
void activate(); //activates hero window;
|
void activate(); //activates hero window;
|
||||||
|
void deactivate(); //activates hero window;
|
||||||
virtual void show(SDL_Surface * to = NULL); //shows hero window
|
virtual void show(SDL_Surface * to = NULL); //shows hero window
|
||||||
void redrawCurBack(); //redraws curBAck from scratch
|
void redrawCurBack(); //redraws curBAck from scratch
|
||||||
void quit(); //stops displaying hero window
|
void quit(); //stops displaying hero window
|
||||||
|
@ -52,7 +52,7 @@ void CInfoWindow::close()
|
|||||||
SDL_FreeSurface(bitmap);
|
SDL_FreeSurface(bitmap);
|
||||||
bitmap = NULL;
|
bitmap = NULL;
|
||||||
LOCPLINT->removeObjToBlit(this);
|
LOCPLINT->removeObjToBlit(this);
|
||||||
LOCPLINT->adventureInt->show();
|
LOCPLINT->curint->activate();
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
CInfoWindow::~CInfoWindow()
|
CInfoWindow::~CInfoWindow()
|
||||||
@ -250,7 +250,7 @@ void CSelWindow::close()
|
|||||||
SDL_FreeSurface(bitmap);
|
SDL_FreeSurface(bitmap);
|
||||||
bitmap = NULL;
|
bitmap = NULL;
|
||||||
LOCPLINT->removeObjToBlit(this);
|
LOCPLINT->removeObjToBlit(this);
|
||||||
LOCPLINT->adventureInt->show();
|
LOCPLINT->curint->activate();
|
||||||
LOCPLINT->cb->selectionMade(ret,ID);
|
LOCPLINT->cb->selectionMade(ret,ID);
|
||||||
delete this;
|
delete this;
|
||||||
//call owner with selection result
|
//call owner with selection result
|
||||||
@ -1539,7 +1539,7 @@ 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
|
curint->deactivate(); //dezaktywacja starego interfejsu
|
||||||
CInfoWindow * temp = CMessage::genIWindow(text,LOCPLINT->playerID,32,components);
|
CInfoWindow * temp = CMessage::genIWindow(text,LOCPLINT->playerID,32,components);
|
||||||
LOCPLINT->objsToBlit.push_back(temp);
|
LOCPLINT->objsToBlit.push_back(temp);
|
||||||
temp->pos.x=300-(temp->pos.w/2);
|
temp->pos.x=300-(temp->pos.w/2);
|
||||||
|
@ -184,6 +184,7 @@ class CPlayerInterface : public CGameInterface
|
|||||||
public:
|
public:
|
||||||
bool makingTurn;
|
bool makingTurn;
|
||||||
SDL_Event * current;
|
SDL_Event * current;
|
||||||
|
IActivable *curint;
|
||||||
CAdvMapInt * adventureInt;
|
CAdvMapInt * adventureInt;
|
||||||
CCastleInterface * castleInt;
|
CCastleInterface * castleInt;
|
||||||
FPSmanager * mainFPSmng;
|
FPSmanager * mainFPSmng;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user