This commit is contained in:
doitux
2007-01-14 14:08:45 +00:00
parent d97972a473
commit 0a900eb165
3 changed files with 79 additions and 31 deletions
+6 -3
View File
@@ -1567,7 +1567,7 @@
<number>5</number> <number>5</number>
</property> </property>
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QSlider" name="horizontalSlider" > <widget class="QSlider" name="horizontalSlider_speed" >
<property name="palette" > <property name="palette" >
<palette> <palette>
<active> <active>
@@ -1605,6 +1605,9 @@
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="minimum" >
<number>1</number>
</property>
<property name="maximum" > <property name="maximum" >
<number>10</number> <number>10</number>
</property> </property>
@@ -4028,7 +4031,7 @@
<tabstop>pushButton_set</tabstop> <tabstop>pushButton_set</tabstop>
<tabstop>spinBox_set</tabstop> <tabstop>spinBox_set</tabstop>
<tabstop>pushButton_allin</tabstop> <tabstop>pushButton_allin</tabstop>
<tabstop>horizontalSlider</tabstop> <tabstop>horizontalSlider_speed</tabstop>
<tabstop>pushButton</tabstop> <tabstop>pushButton</tabstop>
<tabstop>tabWidget</tabstop> <tabstop>tabWidget</tabstop>
<tabstop>textBrowser_Log</tabstop> <tabstop>textBrowser_Log</tabstop>
@@ -4038,7 +4041,7 @@
</resources> </resources>
<connections> <connections>
<connection> <connection>
<sender>horizontalSlider</sender> <sender>horizontalSlider_speed</sender>
<signal>valueChanged(int)</signal> <signal>valueChanged(int)</signal>
<receiver>label_2</receiver> <receiver>label_2</receiver>
<slot>setNum(int)</slot> <slot>setNum(int)</slot>
+48 -22
View File
@@ -44,7 +44,7 @@ const int maxQuantityPlayersConst = 5;
using namespace std; using namespace std;
mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name) mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
: QMainWindow(parent, name), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(1), debugMode(0) : QMainWindow(parent, name), actualGame(0), actualHand(0), mySession(0), maxQuantityPlayers(maxQuantityPlayersConst), gameSpeed(0), debugMode(0)
{ {
setupUi(this); setupUi(this);
@@ -81,6 +81,26 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
//Timer Objekt erstellen //Timer Objekt erstellen
potDistributeTimer = new QTimer(this); potDistributeTimer = new QTimer(this);
// gameSpeed = new int;
// dealCardsSpeed = new int;
// postRiverRunAnimationSpeed = new int;
// winnerBlinkSpeed = new int;
// newRoundSpeed = new int;
// nextPlayerSpeed1 = new int;
// nextPlayerSpeed2 = new int;
// nextPlayerSpeed3 = new int;
// preflopNextPlayerSpeed = new int;
// nextOpponentSpeed = new int;
// // int *dealCardsSpeed;
// // int *postRiverRunAnimationSpeed;
// // int *winnerBlinkSpeed;
// // int *newRoundSpeed;
// // int *nextPlayerSpeed1;
// // int *nextPlayerSpeed2;
// // int *nextPlayerSpeed3;
// // int *preflopNextPlayerSpeed;
// // int *nextOpponentSpeed;
// buttonLabelArray init // buttonLabelArray init
@@ -166,8 +186,8 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent, const char *name)
connect( pushButton_fold, SIGNAL( clicked() ), this, SLOT( myFold() ) ); connect( pushButton_fold, SIGNAL( clicked() ), this, SLOT( myFold() ) );
connect( pushButton_check, SIGNAL( clicked() ), this, SLOT( myCheck() ) ); connect( pushButton_check, SIGNAL( clicked() ), this, SLOT( myCheck() ) );
connect( pushButton_allin, SIGNAL( clicked() ), this, SLOT( myAllIn() ) ); connect( pushButton_allin, SIGNAL( clicked() ), this, SLOT( myAllIn() ) );
// connect ( horizontalSlider_speed, (SIGNAL( valueChanged(int value), this, SLOT textLabel_speedSlider connect ( horizontalSlider_speed, SIGNAL( valueChanged(int)), this, SLOT ( setGameSpeed(int) ) );
// tabWidget_2->hide(); // tabWidget_2->hide();
} }
@@ -198,15 +218,9 @@ void mainWindowImpl::callNewGameDialog() {
// debugMode = v->checkBox_debugMode->isChecked(); // debugMode = v->checkBox_debugMode->isChecked();
//Speeds //Speeds
dealCardsSpeed = (gameSpeed/2)*10; //milliseconds setSpeeds();
postRiverRunAnimationSpeed = gameSpeed*18;
winnerBlinkSpeed = gameSpeed*3; //milliseconds //Start Game!!!
newRoundSpeed = gameSpeed*35;
nextPlayerSpeed1 = 10; // Zeit zwischen dem Setzen des Spielers und dem Verdunkeln
nextPlayerSpeed2 = 4; // Zeit zwischen Verdunkeln des einen und aufhellen des anderen Spielers
nextPlayerSpeed3 = 7; // Zeit bis zwischen Aufhellen und Aktion
preflopNextPlayerSpeed = 10; // Zeit bis zwischen Aufhellen und Aktion im Preflop (etwas langsamer da nicht gerechnet wird. )
mySession->startGame(v->spinBox_quantityPlayers->value(), v->spinBox_startCash->value(), v->spinBox_smallBlind->value()); mySession->startGame(v->spinBox_quantityPlayers->value(), v->spinBox_startCash->value(), v->spinBox_smallBlind->value());
} }
@@ -934,38 +948,38 @@ void mainWindowImpl::nextPlayerAnimation() {
refreshChangePlayer(); refreshChangePlayer();
//weiter mit switchrounds in Hand //weiter mit switchrounds in Hand
QTimer::singleShot(gameSpeed*nextPlayerSpeed1, this, SLOT( handSwitchRounds() )); QTimer::singleShot(nextPlayerSpeed1, this, SLOT( handSwitchRounds() ));
} }
void mainWindowImpl::preflopAnimation1() { QTimer::singleShot(gameSpeed*nextPlayerSpeed2, this, SLOT(preflopAnimation1Action())); } void mainWindowImpl::preflopAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(preflopAnimation1Action())); }
void mainWindowImpl::preflopAnimation1Action() { actualHand->getPreflop()->preflopRun(); } void mainWindowImpl::preflopAnimation1Action() { actualHand->getPreflop()->preflopRun(); }
void mainWindowImpl::preflopAnimation2() { QTimer::singleShot(gameSpeed*preflopNextPlayerSpeed, this, SLOT(preflopAnimation2Action())); } void mainWindowImpl::preflopAnimation2() { QTimer::singleShot(preflopNextPlayerSpeed, this, SLOT(preflopAnimation2Action())); }
void mainWindowImpl::preflopAnimation2Action() { actualHand->getPreflop()->nextPlayer2(); } void mainWindowImpl::preflopAnimation2Action() { actualHand->getPreflop()->nextPlayer2(); }
void mainWindowImpl::flopAnimation1() { QTimer::singleShot(gameSpeed*nextPlayerSpeed2, this, SLOT(flopAnimation1Action())); } void mainWindowImpl::flopAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(flopAnimation1Action())); }
void mainWindowImpl::flopAnimation1Action() { actualHand->getFlop()->flopRun(); } void mainWindowImpl::flopAnimation1Action() { actualHand->getFlop()->flopRun(); }
void mainWindowImpl::flopAnimation2() { QTimer::singleShot(gameSpeed*nextPlayerSpeed3, this, SLOT(flopAnimation2Action())); } void mainWindowImpl::flopAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(flopAnimation2Action())); }
void mainWindowImpl::flopAnimation2Action() { actualHand->getFlop()->nextPlayer2(); } void mainWindowImpl::flopAnimation2Action() { actualHand->getFlop()->nextPlayer2(); }
void mainWindowImpl::turnAnimation1() { QTimer::singleShot(gameSpeed*nextPlayerSpeed2, this, SLOT(turnAnimation1Action())); } void mainWindowImpl::turnAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(turnAnimation1Action())); }
void mainWindowImpl::turnAnimation1Action() { actualHand->getTurn()->turnRun(); } void mainWindowImpl::turnAnimation1Action() { actualHand->getTurn()->turnRun(); }
void mainWindowImpl::turnAnimation2() { QTimer::singleShot(gameSpeed*nextPlayerSpeed3, this, SLOT(turnAnimation2Action())); } void mainWindowImpl::turnAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(turnAnimation2Action())); }
void mainWindowImpl::turnAnimation2Action() { actualHand->getTurn()->nextPlayer2(); } void mainWindowImpl::turnAnimation2Action() { actualHand->getTurn()->nextPlayer2(); }
void mainWindowImpl::riverAnimation1() { QTimer::singleShot(gameSpeed*nextPlayerSpeed2, this, SLOT(riverAnimation1Action())); } void mainWindowImpl::riverAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(riverAnimation1Action())); }
void mainWindowImpl::riverAnimation1Action() { actualHand->getRiver()->riverRun(); } void mainWindowImpl::riverAnimation1Action() { actualHand->getRiver()->riverRun(); }
void mainWindowImpl::riverAnimation2() { QTimer::singleShot(gameSpeed*nextPlayerSpeed3, this, SLOT(riverAnimation2Action())); } void mainWindowImpl::riverAnimation2() { QTimer::singleShot(nextPlayerSpeed3, this, SLOT(riverAnimation2Action())); }
void mainWindowImpl::riverAnimation2Action() { actualHand->getRiver()->nextPlayer2(); } void mainWindowImpl::riverAnimation2Action() { actualHand->getRiver()->nextPlayer2(); }
void mainWindowImpl::postRiverAnimation1() { QTimer::singleShot(gameSpeed*nextPlayerSpeed2, this, SLOT(postRiverAnimation1Action())); } void mainWindowImpl::postRiverAnimation1() { QTimer::singleShot(nextPlayerSpeed2, this, SLOT(postRiverAnimation1Action())); }
void mainWindowImpl::postRiverAnimation1Action() { actualHand->getRiver()->postRiverRun(); } void mainWindowImpl::postRiverAnimation1Action() { actualHand->getRiver()->postRiverRun(); }
@@ -1229,3 +1243,15 @@ void mainWindowImpl::timerBlockerFalse() {
newRoundTimerBlock=FALSE; newRoundTimerBlock=FALSE;
} }
void mainWindowImpl::setSpeeds() {
dealCardsSpeed = (gameSpeed/2)*10; //milliseconds
postRiverRunAnimationSpeed = gameSpeed*18;
winnerBlinkSpeed = gameSpeed*3; //milliseconds
newRoundSpeed = gameSpeed*35;
nextPlayerSpeed1 = gameSpeed*10; // Zeit zwischen dem Setzen des Spielers und dem Verdunkeln
nextPlayerSpeed2 = gameSpeed*4; // Zeit zwischen Verdunkeln des einen und aufhellen des anderen Spielers
nextPlayerSpeed3 = gameSpeed*7; // Zeit bis zwischen Aufhellen und Aktion
preflopNextPlayerSpeed = gameSpeed*10; // Zeit bis zwischen Aufhellen und Aktion im Preflop (etwas langsamer da nicht gerechnet wird. )
}
+25 -6
View File
@@ -48,12 +48,17 @@ public:
int getMaxQuantityPlayers() const { return maxQuantityPlayers; } int getMaxQuantityPlayers() const { return maxQuantityPlayers; }
int getGameSpeed() const { return gameSpeed; } // int getGameSpeed() const { return gameSpeed; }
int getPreflopNextPlayerSpeed() const { return preflopNextPlayerSpeed; }
int getNextPlayerSpeed1() const { return nextPlayerSpeed1; }
int getNextPlayerSpeed2() const { return nextPlayerSpeed2; }
int getNextPlayerSpeed3() const { return nextPlayerSpeed3; }
// int getPreflopNextPlayerSpeed() const { return preflopNextPlayerSpeed; }
// int getNextPlayerSpeed1() const { return nextPlayerSpeed1; }
// int getNextPlayerSpeed2() const { return nextPlayerSpeed2; }
// int getNextPlayerSpeed3() const { return nextPlayerSpeed3; }
//refresh-Funktionen //refresh-Funktionen
void refreshSet(); void refreshSet();
void refreshButton(); void refreshButton();
@@ -74,8 +79,12 @@ public:
void highlightRoundLabel(std::string); void highlightRoundLabel(std::string);
void setSpeeds();
public slots: public slots:
void setGameSpeed(const int theValue) { gameSpeed = theValue*10; setSpeeds(); } // Achtung Faktor 10!!!
void callNewGameDialog() ; void callNewGameDialog() ;
void callAboutPokerthDialog(); void callAboutPokerthDialog();
void myFold(); void myFold();
@@ -142,7 +151,6 @@ public slots:
void userWidgetsBackgroudColor(); void userWidgetsBackgroudColor();
void timerBlockerFalse(); void timerBlockerFalse();
private: private:
Game *actualGame; Game *actualGame;
@@ -177,6 +185,17 @@ private:
int nextPlayerSpeed3; int nextPlayerSpeed3;
int preflopNextPlayerSpeed; int preflopNextPlayerSpeed;
int nextOpponentSpeed; int nextOpponentSpeed;
/*
int *gameSpeed;
int *dealCardsSpeed;
int *postRiverRunAnimationSpeed;
int *winnerBlinkSpeed;
int *newRoundSpeed;
int *nextPlayerSpeed1;
int *nextPlayerSpeed2;
int *nextPlayerSpeed3;
int *preflopNextPlayerSpeed;
int *nextOpponentSpeed; */
bool firstCallNewGame; bool firstCallNewGame;
bool newRoundTimerBlock; bool newRoundTimerBlock;