Browse Source

Several fixes for pregame:
Fixed #240, #255, #397, #411

Michał W. Urbańczyk 15 years ago
parent
commit
85f463e479
3 changed files with 11 additions and 5 deletions
  1. 6 2
      client/AdventureMapButton.cpp
  2. 1 0
      client/CMT.cpp
  3. 4 3
      client/CPreGame.cpp

+ 6 - 2
client/AdventureMapButton.cpp

@@ -296,11 +296,14 @@ void CHighlightableButton::clickLeft(tribool down, bool previousState)
 {
 	if(blocked)
 		return;
-	if (down) {
+	if (down) 
+	{
 		CGI->soundh->playSound(soundBase::button);
 		state = 1;
-	} else
+	} 
+	else
 		state = selected ? 3 : 0;
+
 	show(screenBuf);
 	if(previousState  &&  down == false)
 	{
@@ -336,6 +339,7 @@ CHighlightableButton::CHighlightableButton( const std::string &Name, const std::
 void CHighlightableButtonsGroup::addButton(CHighlightableButton* bt)
 {
 	bt->callback += boost::bind(&CHighlightableButtonsGroup::selectionChanged,this,bt->ID);
+	bt->onlyOn = true;
 	buttons.push_back(bt);
 }
 

+ 1 - 0
client/CMT.cpp

@@ -495,6 +495,7 @@ static void listenForEvents()
 			delete ev;
 
 			GH.curInt = CGP;
+			GH.defActionsDef = 63;
 			continue;
 		}
 

+ 4 - 3
client/CPreGame.cpp

@@ -401,16 +401,17 @@ void CSelectionScreen::toggleTab(CIntObject *tab)
 void CSelectionScreen::changeSelection( const CMapInfo *to )
 {
 	curMap = current = to;;
+
 	if(to && type == CMenuScreen::loadGame)
 		curOpts->difficulty = to->scenarioOpts->difficulty;
 	if(type != CMenuScreen::campaignList)
 	{
-		updateStartInfo(to, sInfo, to->mapHeader);
+		updateStartInfo(to, sInfo, to ? to->mapHeader : NULL);
 	}
 	card->changeSelection(to);
 	if(type != CMenuScreen::campaignList)
 	{
-		opt->changeSelection(to->mapHeader);
+		opt->changeSelection(to ? to->mapHeader : NULL);
 	}
 }
 
@@ -1516,7 +1517,7 @@ void OptionsTab::changeSelection( const CMapHeader *to )
 	entries.clear();
 	usedHeroes.clear();
 
-	OBJ_CONSTRUCTION;
+	OBJ_CONSTRUCTION_CAPTURING_ALL;
 	for(int i = 0; i < curOpts->playerInfos.size(); i++)
 	{
 		entries.push_back(new PlayerOptionsEntry(this, curOpts->playerInfos[i]));