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

Several fixes for pregame:

Fixed #240, #255, #397, #411
This commit is contained in:
Michał W. Urbańczyk
2010-03-05 22:51:09 +00:00
parent c4ae0c4cf2
commit 85f463e479
3 changed files with 11 additions and 5 deletions

View File

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

View File

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

View File

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