1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-07 07:10:04 +02:00

* version changed to 0.58

* splitting stacks in hero window
* minor fixes
This commit is contained in:
Michał W. Urbańczyk 2008-04-20 12:39:33 +00:00
parent d7b5099b6f
commit 4ff5788e51
6 changed files with 17 additions and 13 deletions

View File

@ -479,8 +479,8 @@ void CSlider<T>::clickLeft (tribool down)
{
float pw = LOCPLINT->current->motion.x-pos.x-16;
float rw = pw / ((float)(pos.w-32));
if (rw>1) rw=1;
if (rw<0) rw=0;
if (rw>1) return;
if (rw<0) return;
moveTo(rw*amount);
return;
}

View File

@ -578,7 +578,7 @@ int CCallback::splitStack(const CGObjectInstance *s1, const CGObjectInstance *s2
if(!val)
return -1;
CCreatureSet *S1 = const_cast<CCreatureSet*>(getGarrison(s1)), *S2 = const_cast<CCreatureSet*>(getGarrison(s2));
if ((S1->slots[p1].second<p2) && (true /*we are allowed to*/))
if ((S1->slots[p1].second<=val) && (true /*we are allowed to*/))
{
return -1;
}

View File

@ -327,13 +327,16 @@ void CCastleInterface::buildingClicked(int building)
CRecrutationWindow *rw = new CRecrutationWindow(crs,this);
rw->activate();
}
switch(building)
else
{
case 10: case 11: case 12: case 13:
enterHall();
break;
default:
std::cout<<"This building isn't handled...\n";
switch(building)
{
case 10: case 11: case 12: case 13:
enterHall();
break;
default:
std::cout<<"This building isn't handled...\n";
}
}
}
void CCastleInterface::enterHall()

View File

@ -41,7 +41,7 @@ CHeroWindow::CHeroWindow(int playerColor):
gar1button = new AdventureMapButton<CHeroWindow>(CGI->generaltexth->heroscrn[23], CGI->generaltexth->heroscrn[29], &CHeroWindow::gar1, 546, 491, "hsbtns6.def", this, false, NULL, false);
gar2button = new AdventureMapButton<CHeroWindow>(std::string(), std::string(), &CHeroWindow::gar2, 604, 491, "hsbtns8.def", this, false, NULL, false);
gar3button = new AdventureMapButton<CHeroWindow>(CGI->generaltexth->heroscrn[24], CGI->generaltexth->heroscrn[30], &CHeroWindow::gar3, 546, 527, "hsbtns7.def", this, false, NULL, false);
gar4button = new AdventureMapButton<CHeroWindow>(std::string(), CGI->generaltexth->heroscrn[32], &CHeroWindow::gar4, 604, 527, "hsbtns9.def", this, false, NULL, false);
gar4button = new AdventureMapButton<CGarrisonInt>(std::string(), CGI->generaltexth->heroscrn[32], &CGarrisonInt::splitClick, 604, 527, "hsbtns9.def", garInt, false, NULL, false);
leftArtRoll = new AdventureMapButton<CHeroWindow>(std::string(), std::string(), &CHeroWindow::leftArtRoller, 379, 364, "hsbtns3.def", this, false, NULL, false);
rightArtRoll = new AdventureMapButton<CHeroWindow>(std::string(), std::string(), &CHeroWindow::rightArtRoller, 632, 364, "hsbtns5.def", this, false, NULL, false);
@ -202,7 +202,7 @@ void CHeroWindow::setHero(const CGHeroInstance *hero)
portraitArea->text = hero->biography;
delete garInt;
garInt = new CGarrisonInt(80, 493, 8, 0, curBack, 13, 482, curHero);
gar4button->owner = garInt = new CGarrisonInt(80, 493, 8, 0, curBack, 13, 482, curHero);
garInt->update = false;
for(int g=0; g<primSkillAreas.size(); ++g)
{

View File

@ -92,8 +92,9 @@ class CHeroWindow: public IActivable, public IShowable, public virtual CIntObjec
//buttons
AdventureMapButton<CHeroWindow> * quitButton, * dismissButton, * questlogButton, //general
* gar1button, * gar2button, * gar3button, * gar4button, //garrison / formation handling
* gar1button, * gar2button, * gar3button, //garrison / formation handling
* leftArtRoll, * rightArtRoll;
AdventureMapButton<CGarrisonInt> * gar4button; //splitting
//std::vector< AdventureMapButton<CHeroWindow> * > heroList; //list of heroes
std::vector<LClickableAreaHero *> heroListMi; //new better list of heroes

View File

@ -62,7 +62,7 @@
CGameInfo* CGI;
#endif
#define CHUNK 16384
const char * NAME = "VCMI pre-0.6";
const char * NAME = "VCMI 0.58";
SDL_Color playerColorPalette[256]; //palette to make interface colors good