Forráskód Böngészése

* version changed to 0.58
* splitting stacks in hero window
* minor fixes

Michał W. Urbańczyk 17 éve
szülő
commit
4ff5788e51
6 módosított fájl, 17 hozzáadás és 13 törlés
  1. 2 2
      AdventureMapButton.h
  2. 1 1
      CCallback.cpp
  3. 9 6
      CCastleInterface.cpp
  4. 2 2
      CHeroWindow.cpp
  5. 2 1
      CHeroWindow.h
  6. 1 1
      CMT.cpp

+ 2 - 2
AdventureMapButton.h

@@ -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;
 	}

+ 1 - 1
CCallback.cpp

@@ -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;
 	}

+ 9 - 6
CCastleInterface.cpp

@@ -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()

+ 2 - 2
CHeroWindow.cpp

@@ -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)
 	{

+ 2 - 1
CHeroWindow.h

@@ -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
 

+ 1 - 1
CMT.cpp

@@ -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