diff --git a/src/engine/local_engine/tools.cpp b/src/engine/local_engine/tools.cpp
index df6471c4..b1b9da49 100755
--- a/src/engine/local_engine/tools.cpp
+++ b/src/engine/local_engine/tools.cpp
@@ -90,3 +90,9 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
}
}
+
+double* Tools::calcCardsChance()
+{
+ double array[10] = { 30.12, 11.11, 100.00, 0.00, 0.00, 99.22, 78.56, 34.22, 67.22, 21.00 };
+ return array;
+}
diff --git a/src/engine/local_engine/tools.h b/src/engine/local_engine/tools.h
index fa6b268b..9e73ec22 100755
--- a/src/engine/local_engine/tools.h
+++ b/src/engine/local_engine/tools.h
@@ -24,7 +24,7 @@
class Tools{
public:
static void getRandNumber(int, int, int, int*, bool);
-
+ static double* calcCardsChance();
};
#endif
diff --git a/src/gui/qt/gametable.ui b/src/gui/qt/gametable.ui
index a16f0fb3..24a376b8 100644
--- a/src/gui/qt/gametable.ui
+++ b/src/gui/qt/gametable.ui
@@ -2571,7 +2571,7 @@
Qt::NoFocus
- 0
+ 2
@@ -2664,7 +2664,7 @@
0
-
-
+
@@ -3144,9 +3144,9 @@
- MyChanceLable
+ MyChanceLabel
QLabel
-
+
diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp
index d700e172..0735b1d3 100755
--- a/src/gui/qt/gametable/gametableimpl.cpp
+++ b/src/gui/qt/gametable/gametableimpl.cpp
@@ -591,6 +591,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalStartVoteOnKick(int, int)), this, SLOT(startVoteOnKick(int, int)));
connect(this, SIGNAL(signalEndVoteOnKick()), this, SLOT(endVoteOnKick()));
+ refreshCardsChance();
}
gameTableImpl::~gameTableImpl() {
@@ -3124,3 +3125,8 @@ void gameTableImpl::refreshVotesMonitor()
label_votesMonitor->setText(tr("Player %1 has %2 votes against him.").arg(QString::fromUtf8(info.playerName.c_str())));
}
+void gameTableImpl::refreshCardsChance()
+{
+ label_chance->refreshChance(Tools::calcCardsChance());
+}
+
diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h
index 0a3f72b5..4cfe0ed2 100755
--- a/src/gui/qt/gametable/gametableimpl.h
+++ b/src/gui/qt/gametable/gametableimpl.h
@@ -230,6 +230,8 @@ public slots:
void postRiverRunAnimation5();
void postRiverRunAnimation6();
+ void refreshCardsChance();
+
void blinkingStartButtonAnimationAction();
void flipHolecardsAllIn();
diff --git a/src/gui/qt/gametable/mychancelabel.cpp b/src/gui/qt/gametable/mychancelabel.cpp
index a4050ea8..577224c7 100644
--- a/src/gui/qt/gametable/mychancelabel.cpp
+++ b/src/gui/qt/gametable/mychancelabel.cpp
@@ -22,3 +22,101 @@ MyChanceLabel::MyChanceLabel(QWidget* parent)
MyChanceLabel::~MyChanceLabel()
{
}
+
+void MyChanceLabel::refreshChance(double *chance)
+{
+ RFChance = chance[9];
+ SFChance = chance[8];
+ FOAKChance = chance[7];
+ FHChance = chance[6];
+ FLChance = chance[5];
+ STRChance = chance[4];
+ TOAKChance = chance[3];
+ TPChance = chance[2];
+ OPChance = chance[1];
+ HCChance = chance[0];
+
+ update();
+}
+
+void MyChanceLabel::paintEvent(QPaintEvent * event) {
+
+ QPainter painter(this);
+
+
+#ifdef _WIN32
+ QString font1String = "font-family: \"Arial\";";
+#else
+ #ifdef __APPLE__
+ QString font1String = "font-family: \"Lucida Grande\";";
+ #else
+ QString font1String = "font-family: \"Nimbus Sans L\";";
+ #endif
+#endif
+ QFont font;
+ font.setFamily(font1String);
+ font.setPixelSize(10);
+ painter.setFont(font);
+
+ //Draw Texts
+ if(RFChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,0), QPointF(76,13)),Qt::AlignRight,"Royal Flush");
+ painter.drawText(QRectF(QPointF(196,0), QPointF(236,13)),Qt::AlignRight,QString("%1%").arg(RFChance, 0, 'f', 2));
+ if(SFChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,13), QPointF(76,26)),Qt::AlignRight,"Straight Flush");
+ painter.drawText(QRectF(QPointF(196,13), QPointF(236,26)),Qt::AlignRight,QString("%1%").arg(SFChance, 0, 'f', 2));
+ if(FOAKChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,26), QPointF(76,39)),Qt::AlignRight,"Four of a Kind");
+ painter.drawText(QRectF(QPointF(196,26), QPointF(236,39)),Qt::AlignRight,QString("%1%").arg(FOAKChance, 0, 'f', 2));
+ if(FHChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,39), QPointF(76,52)),Qt::AlignRight,"Full House");
+ painter.drawText(QRectF(QPointF(196,39), QPointF(236,52)),Qt::AlignRight,QString("%1%").arg(FHChance, 0, 'f', 2));
+ if(FLChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,52), QPointF(76,65)),Qt::AlignRight,"Flush");
+ painter.drawText(QRectF(QPointF(196,52), QPointF(236,65)),Qt::AlignRight,QString("%1%").arg(FLChance, 0, 'f', 2));
+ if(STRChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,65), QPointF(76,78)),Qt::AlignRight,"Straight");
+ painter.drawText(QRectF(QPointF(196,65), QPointF(236,78)),Qt::AlignRight,QString("%1%").arg(STRChance, 0, 'f', 2));
+ if(TOAKChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,78), QPointF(76,91)),Qt::AlignRight,"Three of a Kind");
+ painter.drawText(QRectF(QPointF(196,78), QPointF(236,91)),Qt::AlignRight,QString("%1%").arg(TOAKChance, 0, 'f', 2));
+ if(TPChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,91), QPointF(76,104)),Qt::AlignRight,"Two Pairs");
+ painter.drawText(QRectF(QPointF(196,91), QPointF(236,104)),Qt::AlignRight,QString("%1%").arg(TPChance, 0, 'f', 2));
+ if(OPChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,104), QPointF(76,117)),Qt::AlignRight,"One Pair");
+ painter.drawText(QRectF(QPointF(196,104), QPointF(236,117)),Qt::AlignRight,QString("%1%").arg(OPChance, 0, 'f', 2));
+ if(HCChance == 0.00) { painter.setPen(QColor(85,99,47)); }
+ else { painter.setPen(QColor(156,213,0)); }
+ painter.drawText(QRectF(QPointF(2,117), QPointF(76,130)),Qt::AlignRight,"Highest Card");
+ painter.drawText(QRectF(QPointF(196,117), QPointF(236,130)),Qt::AlignRight,QString("%1%").arg(HCChance, 0, 'f', 2));
+
+ //Draw gfx
+ painter.setPen(QColor(0,0,0));
+
+ QLinearGradient linearGrad(QPointF(80,3), QPointF(180,10));
+ linearGrad.setColorAt(0, Qt::blue);
+ linearGrad.setColorAt(0.5, Qt::yellow);
+ linearGrad.setColorAt(1, Qt::red);
+ painter.setBrush(linearGrad);
+
+ if(RFChance != 0.00) painter.drawRect(80,3,(107*RFChance)/100,7);
+ if(SFChance != 0.00) painter.drawRect(80,16,(107*SFChance)/100,7);
+ if(FOAKChance != 0.00) painter.drawRect(80,29,(107*FOAKChance)/100,7);
+ if(FHChance != 0.00) painter.drawRect(80,42,(107*FHChance)/100,7);
+ if(FLChance != 0.00) painter.drawRect(80,55,(107*FLChance)/100,7);
+ if(STRChance != 0.00) painter.drawRect(80,68,(107*STRChance)/100,7);
+ if(TOAKChance != 0.00) painter.drawRect(80,81,(107*TOAKChance)/100,7);
+ if(TPChance != 0.00) painter.drawRect(80,94,(107*TPChance)/100,7);
+ if(OPChance != 0.00) painter.drawRect(80,107,(107*OPChance)/100,7);
+ if(HCChance != 0.00) painter.drawRect(80,120,(107*HCChance)/100,7);
+}
diff --git a/src/gui/qt/gametable/mychancelabel.h b/src/gui/qt/gametable/mychancelabel.h
index 328b9630..4a8a7591 100644
--- a/src/gui/qt/gametable/mychancelabel.h
+++ b/src/gui/qt/gametable/mychancelabel.h
@@ -28,12 +28,22 @@ public:
~MyChanceLabel();
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
-
+ void paintEvent(QPaintEvent * event);
+ void refreshChance(double*);
private:
gameTableImpl *myW;
-
+ double RFChance;
+ double SFChance;
+ double FOAKChance;
+ double FHChance;
+ double FLChance;
+ double STRChance;
+ double TOAKChance;
+ double TPChance;
+ double OPChance;
+ double HCChance;
};
#endif