From f1a9459fc6fcdac289ca3663fd750e01beb7d702 Mon Sep 17 00:00:00 2001 From: doitux Date: Thu, 16 Oct 2008 09:55:48 +0000 Subject: [PATCH] gui cardchancemonitor --- src/gui/qt/gametable/gametableimpl.cpp | 20 +++++++++++++------- src/gui/qt/gametable/mychancelabel.cpp | 17 +++++++++++++++++ src/gui/qt/gametable/mychancelabel.h | 1 + 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index e62bac56..89a77e32 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -3148,13 +3148,19 @@ void gameTableImpl::refreshVotesMonitor() void gameTableImpl::refreshCardsChance(GameState bero) { 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)); + + if((*myStartWindow->getSession()->getCurrentGame()->getSeatsList()->begin())->getMyActiveStatus() && (*myStartWindow->getSession()->getCurrentGame()->getSeatsList()->begin())->getMyAction() != PLAYER_ACTION_FOLD) { + 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)); + } + else { + label_chance->resetChance(); + } } } diff --git a/src/gui/qt/gametable/mychancelabel.cpp b/src/gui/qt/gametable/mychancelabel.cpp index 47d15944..efdf01c4 100644 --- a/src/gui/qt/gametable/mychancelabel.cpp +++ b/src/gui/qt/gametable/mychancelabel.cpp @@ -120,3 +120,20 @@ void MyChanceLabel::paintEvent(QPaintEvent * event) { if(OPChance != 0) painter.drawRect(80,107,(117*OPChance)/100,7); if(HCChance != 0) painter.drawRect(80,120,(117*HCChance)/100,7); } + + +void MyChanceLabel::resetChance() +{ + RFChance = 0; + SFChance = 0; + FOAKChance = 0; + FHChance = 0; + FLChance = 0; + STRChance = 0; + TOAKChance = 0; + TPChance = 0; + OPChance = 0; + HCChance = 0; + + update(); +} \ No newline at end of file diff --git a/src/gui/qt/gametable/mychancelabel.h b/src/gui/qt/gametable/mychancelabel.h index 47a33c2b..5e9aa992 100644 --- a/src/gui/qt/gametable/mychancelabel.h +++ b/src/gui/qt/gametable/mychancelabel.h @@ -30,6 +30,7 @@ public: void setMyW ( gameTableImpl* theValue ) { myW = theValue; } void paintEvent(QPaintEvent * event); void refreshChance(int*); + void resetChance(); private: