gui cardchancemonitor

This commit is contained in:
doitux
2008-10-15 19:49:39 +00:00
parent d66a496115
commit d8e70d997d
5 changed files with 34 additions and 17 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
}
int* Tools::calcCardsChance(int* playerCards, int* boardCards, GameState beRoID)
int* Tools::calcCardsChance(GameState beRoID, int* playerCards, int* boardCards)
{
// int playerCards[2];
+1 -1
View File
@@ -25,7 +25,7 @@
class Tools{
public:
static void getRandNumber(int, int, int, int*, bool);
static int* calcCardsChance(int*,int*,GameState);
static int* calcCardsChance(GameState, int*, int*);
};
#endif
+20 -3
View File
@@ -1182,6 +1182,9 @@ void gameTableImpl::dealHoleCards() {
//fix press mouse button during bankrupt with anti-peek-mode
this->mouseOverFlipCards(FALSE);
//refresh CardsChanceMonitor Tool
refreshCardsChance(GAME_STATE_PREFLOP);
}
void gameTableImpl::dealBeRoCards(int myBeRoID) {
@@ -1289,6 +1292,9 @@ void gameTableImpl::dealFlopCards6() {
updateMyButtonsState(0); //mode 0 == called from dealberocards
dealFlopCards6Timer->start(postDealCardsSpeed);
}
//refresh CardsChanceMonitor Tool
refreshCardsChance(GAME_STATE_FLOP);
}
void gameTableImpl::dealTurnCards0() { dealTurnCards0Timer->start(preDealCardsSpeed); }
@@ -1323,8 +1329,9 @@ void gameTableImpl::dealTurnCards2() {
else {
updateMyButtonsState(0); //mode 0 == called from dealberocards
dealTurnCards2Timer->start(postDealCardsSpeed);
}
//refresh CardsChanceMonitor Tool
refreshCardsChance(GAME_STATE_TURN);
}
void gameTableImpl::dealRiverCards0() { dealRiverCards0Timer->start(preDealCardsSpeed); }
@@ -1361,6 +1368,8 @@ void gameTableImpl::dealRiverCards2() {
updateMyButtonsState(0); //mode 0 == called from dealberocards
dealRiverCards2Timer->start(postDealCardsSpeed);
}
//refresh CardsChanceMonitor Tool
refreshCardsChance(GAME_STATE_RIVER);
}
void gameTableImpl::provideMyActions(int mode) {
@@ -3136,8 +3145,16 @@ void gameTableImpl::refreshVotesMonitor()
label_votesMonitor->setText(tr("Player <b>%1</b> has %2 votes against him.").arg(QString::fromUtf8(info.playerName.c_str())));
}
void gameTableImpl::refreshCardsChance()
void gameTableImpl::refreshCardsChance(GameState bero)
{
label_chance->refreshChance(Tools::calcCardsChance());
if(myConfig->readConfigInt("ShowCardsChanceMonitor")) {
int boardCards[5];
int holeCards[2];
(*myStartWindow->getSession()->getCurrentGame()->getSeatsList()->begin())->getMyCards(holeCards);
myStartWindow->getSession()->getCurrentGame()->getCurrentHand()->getBoard()->getMyCards(boardCards);
label_chance->refreshChance(Tools::calcCardsChance(bero, holeCards, boardCards));
}
}
+1 -1
View File
@@ -230,7 +230,7 @@ public slots:
void postRiverRunAnimation5();
void postRiverRunAnimation6();
void refreshCardsChance();
void refreshCardsChance(GameState);
void blinkingStartButtonAnimationAction();
+11 -11
View File
@@ -103,20 +103,20 @@ void MyChanceLabel::paintEvent(QPaintEvent * event) {
//Draw gfx
painter.setPen(QColor(0,0,0));
QLinearGradient linearGrad(QPointF(80,3), QPointF(180,10));
QLinearGradient linearGrad(QPointF(80,3), QPointF(190,10));
linearGrad.setColorAt(0, Qt::blue);
linearGrad.setColorAt(0.5, Qt::yellow);
linearGrad.setColorAt(1, Qt::red);
painter.setBrush(linearGrad);
if(RFChance != 0) painter.drawRect(80,3,(107*RFChance)/100,7);
if(SFChance != 0) painter.drawRect(80,16,(107*SFChance)/100,7);
if(FOAKChance != 0) painter.drawRect(80,29,(107*FOAKChance)/100,7);
if(FHChance != 0) painter.drawRect(80,42,(107*FHChance)/100,7);
if(FLChance != 0) painter.drawRect(80,55,(107*FLChance)/100,7);
if(STRChance != 0) painter.drawRect(80,68,(107*STRChance)/100,7);
if(TOAKChance != 0) painter.drawRect(80,81,(107*TOAKChance)/100,7);
if(TPChance != 0) painter.drawRect(80,94,(107*TPChance)/100,7);
if(OPChance != 0) painter.drawRect(80,107,(107*OPChance)/100,7);
if(HCChance != 0) painter.drawRect(80,120,(107*HCChance)/100,7);
if(RFChance != 0) painter.drawRect(80,3,(117*RFChance)/100,7);
if(SFChance != 0) painter.drawRect(80,16,(117*SFChance)/100,7);
if(FOAKChance != 0) painter.drawRect(80,29,(117*FOAKChance)/100,7);
if(FHChance != 0) painter.drawRect(80,42,(117*FHChance)/100,7);
if(FLChance != 0) painter.drawRect(80,55,(117*FLChance)/100,7);
if(STRChance != 0) painter.drawRect(80,68,(117*STRChance)/100,7);
if(TOAKChance != 0) painter.drawRect(80,81,(117*TOAKChance)/100,7);
if(TPChance != 0) painter.drawRect(80,94,(117*TPChance)/100,7);
if(OPChance != 0) painter.drawRect(80,107,(117*OPChance)/100,7);
if(HCChance != 0) painter.drawRect(80,120,(117*HCChance)/100,7);
}