1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

* first part of Thieves' Guild window

This commit is contained in:
mateuszb
2010-01-31 18:41:22 +00:00
parent 6d6fe748d0
commit 0f21d9c762
3 changed files with 124 additions and 4 deletions

View File

@@ -3041,7 +3041,7 @@ CTavernWindow::CTavernWindow(const CGHeroInstance *H1, const CGHeroInstance *H2,
cancel = new AdventureMapButton(CGI->generaltexth->tavernInfo[7],"", boost::bind(&CTavernWindow::close, this), pos.x+310,pos.y+428, "ICANCEL.DEF", SDLK_ESCAPE); cancel = new AdventureMapButton(CGI->generaltexth->tavernInfo[7],"", boost::bind(&CTavernWindow::close, this), pos.x+310,pos.y+428, "ICANCEL.DEF", SDLK_ESCAPE);
recruit = new AdventureMapButton("", "", boost::bind(&CTavernWindow::recruitb, this), pos.x+272, pos.y+355, "TPTAV01.DEF", SDLK_RETURN); recruit = new AdventureMapButton("", "", boost::bind(&CTavernWindow::recruitb, this), pos.x+272, pos.y+355, "TPTAV01.DEF", SDLK_RETURN);
thiefGuild = new AdventureMapButton(CGI->generaltexth->tavernInfo[5],"",0,pos.x+22,pos.y+428,"TPTAV02.DEF",SDLK_t); thiefGuild = new AdventureMapButton(CGI->generaltexth->tavernInfo[5],"", boost::bind(&CTavernWindow::thievesguildb, this), pos.x+22, pos.y+428, "TPTAV02.DEF", SDLK_t);
if(LOCPLINT->cb->getResourceAmount(6) < 2500) //not enough gold if(LOCPLINT->cb->getResourceAmount(6) < 2500) //not enough gold
{ {
@@ -3079,6 +3079,11 @@ void CTavernWindow::recruitb()
LOCPLINT->cb->recruitHero(LOCPLINT->castleInt->town,toBuy); LOCPLINT->cb->recruitHero(LOCPLINT->castleInt->town,toBuy);
} }
void CTavernWindow::thievesguildb()
{
GH.pushInt(new CThievesGuildWindow());
}
CTavernWindow::~CTavernWindow() CTavernWindow::~CTavernWindow()
{ {
CGI->videoh->close(); CGI->videoh->close();
@@ -4671,3 +4676,98 @@ void CArtMerchantWindow::activate() {}
void CArtMerchantWindow::deactivate() {} void CArtMerchantWindow::deactivate() {}
void CArtMerchantWindow::show(SDL_Surface * to) {} void CArtMerchantWindow::show(SDL_Surface * to) {}
void CArtMerchantWindow::Buy() {} void CArtMerchantWindow::Buy() {}
void CThievesGuildWindow::activate()
{
statusBar->activate();
exitb->activate();
resdatabar->activate();
LOCPLINT->statusbar = statusBar;
}
void CThievesGuildWindow::deactivate()
{
statusBar->deactivate();
exitb->deactivate();
resdatabar->deactivate();
}
void CThievesGuildWindow::show(SDL_Surface * to)
{
blitAt(background, pos.x, pos.y, to);
statusBar->show(to);
exitb->show(to);
resdatabar->show(to);
//showing border around window
if(screen->w != 800 || screen->h !=600)
{
CMessage::drawBorder(LOCPLINT->playerID, to, pos.w + 28, pos.h + 28, pos.x-14, pos.y-15);
}
}
void CThievesGuildWindow::bexitf()
{
GH.popIntTotally(this);
}
CThievesGuildWindow::CThievesGuildWindow()
{
pos = Rect( (conf.cc.resx - 800) / 2, (conf.cc.resy - 600) / 2, 800, 600 );
//loading backround and converting to more bpp form
SDL_Surface * bg = background = BitmapHandler::loadBitmap("TpRank.bmp", false);
background = newSurface(bg->w, bg->h);
blitAt(bg, 0, 0, background);
SDL_FreeSurface(bg);
exitb = new AdventureMapButton (std::string(), std::string(), boost::bind(&CThievesGuildWindow::bexitf,this), 748 + pos.x, 556 + pos.y, "HSBTNS.def", SDLK_RETURN);
statusBar = new CStatusBar(pos.x + 3, pos.y + 555, "TStatBar.bmp", 742);
resdatabar = new CResDataBar("ZRESBAR.bmp", pos.x+3, pos.y+575, 32, 2, 85, 85);
//printing texts & descriptions to background
for(int g=0; g<12; ++g)
{
int y;
if(g == 9)
{
y = 400;
}
else if(g == 10)
{
y = 460;
}
else if(g == 11)
{
y = 510;
}
else
{
y = 52 + 32*g;
}
printAtMiddle(CGI->generaltexth->jktexts[24+g], 135, y, EFonts::FONT_MEDIUM, tytulowy, background);
}
for(int g=0; g<8; ++g)
{
printAtMiddle(CGI->generaltexth->jktexts[16+g], 283 + 66*g, 20, EFonts::FONT_MEDIUM, tytulowy, background);
}
}
CThievesGuildWindow::~CThievesGuildWindow()
{
SDL_FreeSurface(background);
delete exitb;
delete statusBar;
delete resdatabar;
}

View File

@@ -557,6 +557,7 @@ public:
void recruitb(); void recruitb();
void close(); void close();
void thievesguildb();
void activate(); void activate();
void deactivate(); void deactivate();
void show(SDL_Surface * to); void show(SDL_Surface * to);
@@ -818,4 +819,23 @@ class CFreelancersWindow : public CShopWindow
{}; {};
class CHillFortWindow : public CIntObject //garrison dialog? shop? class CHillFortWindow : public CIntObject //garrison dialog? shop?
{}; {};
class CThievesGuildWindow : public CIntObject
{
CStatusBar * statusBar;
AdventureMapButton * exitb;
SDL_Surface * background;
CResDataBar * resdatabar;
public:
void activate();
void deactivate();
void show(SDL_Surface * to);
void bexitf();
CThievesGuildWindow();
~CThievesGuildWindow();
};
#endif //__GUICLASSES_H__ #endif //__GUICLASSES_H__