2
0
Эх сурвалжийг харах

Restore 'click' sound when pressing a button.

Frank Zago 16 жил өмнө
parent
commit
6c008d5fea

+ 6 - 4
client/AdventureMapButton.cpp

@@ -126,9 +126,10 @@ void AdventureMapButton::clickLeft(tribool down, bool previousState)
 {
 	if(blocked)
 		return;
-	if (down)
+	if (down) {
+		CGI->soundh->playSound(soundBase::button);
 		state=1;
-	else
+	} else
 		state=0;
 	show(screenBuf);
 	if (actOnDown && down)
@@ -304,9 +305,10 @@ 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)

+ 2 - 3
client/CPreGame.cpp

@@ -608,7 +608,6 @@ void SelectionTab::select( int position )
 	amax(py, 0);
 	amin(py, curItems.size()-1);
 
-	CGI->soundh->playSound(soundBase::button);
 	selectionPos = py;
 
 	if(position < 0)
@@ -787,7 +786,7 @@ void SelectionTab::onDoubleClick()
 {
 	if(getLine() != -1) //double clicked scenarios list
 	{
-		//act as start button was pressed
+		//act as if start button was pressed
 		(static_cast<CSelectionScreen*>(parent))->start->callback();
 	}
 }
@@ -933,7 +932,7 @@ void InfoCard::showAll( SDL_Surface * to )
 		blitAtLoc(sizes->ourImages[temp].bitmap, 318, 22, to);
 		temp = curMap->victoryCondition.condition;
 		if (temp>12) temp=11;
-		blitAtLoc(CGP->victory->ourImages[temp].bitmap, 24, 302, to); //vicotry cond descr
+		blitAtLoc(CGP->victory->ourImages[temp].bitmap, 24, 302, to); //victory cond descr
 		temp=curMap->lossCondition.typeOfLossCon;
 		if (temp>12) temp=3;
 		blitAtLoc(CGP->loss->ourImages[temp].bitmap, 24, 359, to); //loss cond