This commit is contained in:
@@ -90,7 +90,7 @@ void LocalFlop::flopRun() {
|
|||||||
|
|
||||||
myHand->getGuiInterface()->refreshSet();
|
myHand->getGuiInterface()->refreshSet();
|
||||||
myHand->getGuiInterface()->refreshCash();
|
myHand->getGuiInterface()->refreshCash();
|
||||||
myHand->getGuiInterface()->refreshAction();
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ void LocalRiver::riverRun() {
|
|||||||
|
|
||||||
myHand->getGuiInterface()->refreshSet();
|
myHand->getGuiInterface()->refreshSet();
|
||||||
myHand->getGuiInterface()->refreshCash();
|
myHand->getGuiInterface()->refreshCash();
|
||||||
myHand->getGuiInterface()->refreshAction();
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
|
||||||
|
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ void LocalTurn::turnRun() {
|
|||||||
|
|
||||||
myHand->getGuiInterface()->refreshSet();
|
myHand->getGuiInterface()->refreshSet();
|
||||||
myHand->getGuiInterface()->refreshCash();
|
myHand->getGuiInterface()->refreshCash();
|
||||||
myHand->getGuiInterface()->refreshAction();
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
|
||||||
|
|
||||||
myHand->switchRounds();
|
myHand->switchRounds();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1063,6 +1063,10 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
|
|||||||
holeCardsArray[playerID][1]->setPixmap(onePix, FALSE);
|
holeCardsArray[playerID][1]->setPixmap(onePix, FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//play sounds if exist
|
||||||
|
mySDLPlayer->playSound(actionArray[playerAction].toStdString());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1217,9 +1221,13 @@ void mainWindowImpl::refreshGameLabels(int round) {
|
|||||||
|
|
||||||
void mainWindowImpl::refreshAll() {
|
void mainWindowImpl::refreshAll() {
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
refreshSet();
|
refreshSet();
|
||||||
refreshButton();
|
refreshButton();
|
||||||
refreshAction();
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
refreshAction( i, mySession->getCurrentGame()->getPlayerArray()[i]->getMyAction());
|
||||||
|
}
|
||||||
refreshCash();
|
refreshCash();
|
||||||
refreshGroupbox();
|
refreshGroupbox();
|
||||||
refreshPlayerName();
|
refreshPlayerName();
|
||||||
@@ -1228,8 +1236,12 @@ void mainWindowImpl::refreshAll() {
|
|||||||
|
|
||||||
void mainWindowImpl::refreshChangePlayer() {
|
void mainWindowImpl::refreshChangePlayer() {
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
refreshSet();
|
refreshSet();
|
||||||
refreshAction();
|
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
refreshAction( i, mySession->getCurrentGame()->getPlayerArray()[i]->getMyAction());
|
||||||
|
}
|
||||||
refreshCash();
|
refreshCash();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2499,7 +2511,9 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
if (event->key() == Qt::Key_F11) { switchRightToolBox(); }
|
if (event->key() == Qt::Key_F11) { switchRightToolBox(); }
|
||||||
if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //f
|
if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //f
|
||||||
if (event->key() == Qt::Key_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f
|
if (event->key() == Qt::Key_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f
|
||||||
if (event->key() == Qt::Key_S) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("dealtwocards"); } //s
|
if (event->key() == Qt::Key_S) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("call"); } //s
|
||||||
|
if (event->key() == Qt::Key_A) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("raise"); } //s
|
||||||
|
if (event->key() == Qt::Key_X) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound(""); } //s
|
||||||
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
|
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
|
||||||
if (event->key() == 16777249) {
|
if (event->key() == 16777249) {
|
||||||
pushButton_break->click();
|
pushButton_break->click();
|
||||||
|
|||||||
@@ -75,6 +75,8 @@
|
|||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/sounds" >
|
<qresource prefix="/sounds" >
|
||||||
<file>resources/sounds/dealtwocards.wav</file>
|
<file>resources/sounds/dealtwocards.wav</file>
|
||||||
|
<file>resources/sounds/call.wav</file>
|
||||||
|
<file>resources/sounds/raise.wav</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/fonts" >
|
<qresource prefix="/fonts" >
|
||||||
<file>resources/fonts/VeraBd.ttf</file>
|
<file>resources/fonts/VeraBd.ttf</file>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -43,20 +43,27 @@ void SDLPlayer::initAudio() {
|
|||||||
|
|
||||||
void SDLPlayer::playSound(string audioString) {
|
void SDLPlayer::playSound(string audioString) {
|
||||||
|
|
||||||
|
// QFile myFile(":sounds/resources/sounds/"+QString::fromStdString(audioString)+".wav");
|
||||||
|
// if(myFile.open(QIODevice::ReadOnly)) {
|
||||||
|
//
|
||||||
|
// audioDone();
|
||||||
|
//
|
||||||
|
// QDataStream in(&myFile);
|
||||||
|
// Uint8 *myMem = new Uint8[(int)myFile.size()];
|
||||||
|
// in.readRawData( (char*)myMem, (int)myFile.size() );
|
||||||
|
//
|
||||||
|
// sound = Mix_QuickLoad_WAV( myMem );
|
||||||
|
//
|
||||||
|
// currentChannel = Mix_PlayChannel(-1, sound,0);
|
||||||
|
//
|
||||||
|
// delete[] myMem;
|
||||||
|
// }
|
||||||
|
// else cout << "could not load " << audioString << ".wav" << endl;
|
||||||
|
|
||||||
|
//test
|
||||||
audioDone();
|
audioDone();
|
||||||
|
sound = Mix_LoadWAV( QString(QString::fromStdString(audioString)+QString(".wav")).toStdString().c_str() );
|
||||||
QFile myFile(":sounds/resources/sounds/"+QString::fromStdString(audioString)+".wav");
|
currentChannel = Mix_PlayChannel(-1, sound,0);
|
||||||
if(!myFile.open(QIODevice::ReadOnly)) cout << "could not load wav" << endl;
|
|
||||||
|
|
||||||
QDataStream in(&myFile);
|
|
||||||
Uint8 *myMem = new Uint8[(int)myFile.size()];
|
|
||||||
in.readRawData( (char*)myMem, (int)myFile.size() );
|
|
||||||
|
|
||||||
sound = Mix_QuickLoad_WAV( myMem );
|
|
||||||
|
|
||||||
currentChannel = Mix_PlayChannel(0, sound,0);
|
|
||||||
|
|
||||||
delete[] myMem;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user