starts human player input filed redesign - PART III (checkable buttons)

This commit is contained in:
doitux
2007-10-17 23:26:57 +00:00
parent a878827c84
commit b03ac19e2f
4 changed files with 721 additions and 608 deletions
@@ -300,7 +300,7 @@ void gameLobbyDialogImpl::refreshGameStats() {
void gameLobbyDialogImpl::refreshPlayerStats() { void gameLobbyDialogImpl::refreshPlayerStats() {
label_nickListCounter->setText("| "+tr("nicks in chat: %1").arg(treeWidget_NickList->topLevelItemCount())); label_nickListCounter->setText("| "+tr("players in chat: %1").arg(treeWidget_NickList->topLevelItemCount()));
label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0)); label_connectedPlayersCounter->setText(tr("connected players: %1").arg(0));
} }
+200 -166
View File
@@ -1842,24 +1842,15 @@
<property name="title" > <property name="title" >
<string/> <string/>
</property> </property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>28</number>
</property>
<property name="topMargin" >
<number>26</number>
</property>
<property name="rightMargin" >
<number>15</number>
</property>
<property name="bottomMargin" >
<number>26</number>
</property>
<property name="horizontalSpacing" >
<number>14</number>
</property>
<item rowspan="2" row="0" column="0" >
<widget class="QLabel" name="textLabel_Button0" > <widget class="QLabel" name="textLabel_Button0" >
<property name="geometry" >
<rect>
<x>30</x>
<y>33</y>
<width>40</width>
<height>40</height>
</rect>
</property>
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
<width>40</width> <width>40</width>
@@ -1879,9 +1870,15 @@
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item>
<item row="0" column="1" >
<widget class="MySetLabel" name="textLabel_Set0" > <widget class="MySetLabel" name="textLabel_Set0" >
<property name="geometry" >
<rect>
<x>94</x>
<y>28</y>
<width>118</width>
<height>20</height>
</rect>
</property>
<property name="maximumSize" > <property name="maximumSize" >
<size> <size>
<width>16777215</width> <width>16777215</width>
@@ -1892,20 +1889,158 @@
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> <widget class="QFrame" name="frame_Cards0" >
<item rowspan="5" row="0" column="2" > <property name="geometry" >
<layout class="QVBoxLayout" > <rect>
<property name="spacing" > <x>94</x>
<y>53</y>
<width>118</width>
<height>111</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>118</width>
<height>111</height>
</size>
</property>
<widget class="MyStatusLabel" name="textLabel_Status0" >
<property name="geometry" >
<rect>
<x>9</x>
<y>35</y>
<width>100</width>
<height>40</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags" >
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</widget>
<widget class="QFrame" name="frame_6" >
<property name="geometry" >
<rect>
<x>30</x>
<y>90</y>
<width>50</width>
<height>34</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>50</width>
<height>34</height>
</size>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <property name="topMargin" >
<layout class="QHBoxLayout" > <number>0</number>
<property name="spacing" > </property>
<property name="rightMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="bottomMargin" > <property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="textLabel_Cash0" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="textLabel_TopCash0" />
</item>
</layout>
</widget>
<widget class="QLabel" name="label_Avatar0" >
<property name="geometry" >
<rect>
<x>30</x>
<y>130</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="label_PlayerName0" >
<property name="geometry" >
<rect>
<x>94</x>
<y>160</y>
<width>118</width>
<height>23</height>
</rect>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>23</height>
</size>
</property>
<property name="alignment" >
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
<widget class="QWidget" name="layoutWidget" >
<property name="geometry" >
<rect>
<x>227</x>
<y>30</y>
<width>144</width>
<height>160</height>
</rect>
</property>
<layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>0</number>
</property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
@@ -1923,14 +2058,16 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<layout class="QGridLayout" > <layout class="QVBoxLayout" >
<property name="horizontalSpacing" > <property name="spacing" >
<number>0</number> <number>3</number>
</property> </property>
<property name="verticalSpacing" > <item>
<number>0</number> <layout class="QHBoxLayout" >
<property name="spacing" >
<number>2</number>
</property> </property>
<item row="0" column="0" colspan="2" > <item>
<widget class="QSpinBox" name="spinBox_set" > <widget class="QSpinBox" name="spinBox_set" >
<property name="minimumSize" > <property name="minimumSize" >
<size> <size>
@@ -2011,9 +2148,36 @@
<property name="singleStep" > <property name="singleStep" >
<number>10</number> <number>10</number>
</property> </property>
<property name="value" >
<number>99999</number>
</property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item>
<widget class="QPushButton" name="pushButton_AllIn" >
<property name="minimumSize" >
<size>
<width>40</width>
<height>21</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>40</width>
<height>21</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="text" >
<string>All In</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSlider" name="horizontalSlider_bet" > <widget class="QSlider" name="horizontalSlider_bet" >
<property name="palette" > <property name="palette" >
<palette> <palette>
@@ -2120,22 +2284,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>1</width>
<height>25</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@@ -2187,7 +2335,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_CallCheckSet" > <widget class="QPushButton" name="pushButton_CallCheck" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -2212,7 +2360,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButton_FoldAllin" > <widget class="QPushButton" name="pushButton_Fold" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" > <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -2255,123 +2403,9 @@
</layout> </layout>
</item> </item>
</layout> </layout>
</item>
<item rowspan="3" row="1" column="1" >
<widget class="QFrame" name="frame_Cards0" >
<property name="minimumSize" >
<size>
<width>118</width>
<height>111</height>
</size>
</property>
<widget class="MyStatusLabel" name="textLabel_Status0" >
<property name="geometry" >
<rect>
<x>9</x>
<y>35</y>
<width>100</width>
<height>40</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text" >
<string/>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
<property name="textInteractionFlags" >
<set>Qt::NoTextInteraction</set>
</property>
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="2" column="0" >
<widget class="QFrame" name="frame_6" >
<property name="minimumSize" >
<size>
<width>50</width>
<height>34</height>
</size>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<property name="horizontalSpacing" >
<number>0</number>
</property>
<property name="verticalSpacing" >
<number>0</number>
</property>
<item row="1" column="0" >
<widget class="QLabel" name="textLabel_Cash0" >
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="textLabel_TopCash0" />
</item>
</layout>
</widget>
</item>
<item rowspan="2" row="3" column="0" >
<widget class="QLabel" name="label_Avatar0" >
<property name="minimumSize" >
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>50</width>
<height>50</height>
</size>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="1" >
<widget class="QLabel" name="label_PlayerName0" >
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>23</height>
</size>
</property>
<property name="alignment" >
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
@@ -2468,7 +2502,7 @@
<number>1</number> <number>1</number>
</property> </property>
<property name="verticalSpacing" > <property name="verticalSpacing" >
<number>1</number> <number>2</number>
</property> </property>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="MyRightTabWidget" name="tabWidget_Right" > <widget class="MyRightTabWidget" name="tabWidget_Right" >
+157 -82
View File
@@ -204,13 +204,14 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
// userWidgetsArray init // userWidgetsArray init
userWidgetsArray[0] = pushButton_BetRaise; userWidgetsArray[0] = pushButton_BetRaise;
userWidgetsArray[1] = pushButton_CallCheckSet; userWidgetsArray[1] = pushButton_CallCheck;
userWidgetsArray[2] = pushButton_FoldAllin; userWidgetsArray[2] = pushButton_Fold;
userWidgetsArray[3] = spinBox_set; userWidgetsArray[3] = spinBox_set;
userWidgetsArray[4] = horizontalSlider_bet; userWidgetsArray[4] = horizontalSlider_bet;
userWidgetsArray[5] = pushButton_AllIn;
//hide userWidgets //hide userWidgets
for(i=0; i<5; i++) { for(i=0; i<6; i++) {
userWidgetsArray[i]->hide(); userWidgetsArray[i]->hide();
} }
@@ -483,11 +484,12 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
//Human player button //Human player button
pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }"); pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }");
pushButton_CallCheckSet->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
pushButton_FoldAllin->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
spinBox_set->setStyleSheet("QSpinBox { "+ font2String +" font-size: 10px; font-weight: bold; background-color: #1D3B00; color: #F0F0F0; } QSpinBox:disabled { background-color: #316300; color: #6d7b5f }"); spinBox_set->setStyleSheet("QSpinBox { "+ font2String +" font-size: 10px; font-weight: bold; background-color: #1D3B00; color: #F0F0F0; } QSpinBox:disabled { background-color: #316300; color: #6d7b5f }");
pushButton_AllIn->setStyleSheet("QPushButton { background-color: #145300; color: white;}");
// away radiobuttons // away radiobuttons
QString radioButtonString("QRadioButton { color: #F0F0F0; } QRadioButton::indicator { width: 13px; height: 13px; } QRadioButton::indicator::checked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked.png); }"); QString radioButtonString("QRadioButton { color: #F0F0F0; } QRadioButton::indicator { width: 13px; height: 13px; } QRadioButton::indicator::checked { image: url("+myAppDataPath+"gfx/gui/misc/radiobutton_checked.png); }");
@@ -603,9 +605,10 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect( actionShowHideHelp, SIGNAL( triggered() ), this, SLOT( switchHelpWindow() ) ); connect( actionShowHideHelp, SIGNAL( triggered() ), this, SLOT( switchHelpWindow() ) );
connect( actionShowHideLog, SIGNAL( triggered() ), this, SLOT( switchLogWindow() ) ); connect( actionShowHideLog, SIGNAL( triggered() ), this, SLOT( switchLogWindow() ) );
connect( pushButton_BetRaise, SIGNAL( clicked() ), this, SLOT( mySet() ) ); connect( pushButton_BetRaise, SIGNAL( clicked(bool) ), this, SLOT( pushButtonBetRaiseClicked(bool) ) );
connect( pushButton_FoldAllin, SIGNAL( clicked() ), this, SLOT( myFoldAllin() ) ); connect( pushButton_Fold, SIGNAL( clicked(bool) ), this, SLOT( pushButtonFoldClicked(bool) ) );
connect( pushButton_CallCheckSet, SIGNAL( clicked() ), this, SLOT( myCallCheckSet() ) ); connect( pushButton_CallCheck, SIGNAL( clicked(bool) ), this, SLOT( pushButtonCallCheckClicked(bool) ) );
connect( pushButton_AllIn, SIGNAL( clicked(bool) ), this, SLOT(pushButtonAllInClicked(bool) ) );
connect ( horizontalSlider_speed, SIGNAL( valueChanged(int)), this, SLOT ( setGameSpeed(int) ) ); connect ( horizontalSlider_speed, SIGNAL( valueChanged(int)), this, SLOT ( setGameSpeed(int) ) );
connect ( pushButton_break, SIGNAL( clicked()), this, SLOT ( breakButtonClicked() ) ); // auch wieder starten!!!! connect ( pushButton_break, SIGNAL( clicked()), this, SLOT ( breakButtonClicked() ) ); // auch wieder starten!!!!
@@ -1149,7 +1152,7 @@ void mainWindowImpl::initGui(int speed)
groupBox_LeftToolBox->setDisabled(FALSE); groupBox_LeftToolBox->setDisabled(FALSE);
//show human player buttons //show human player buttons
for(int i=0; i<5; i++) { for(int i=0; i<6; i++) {
userWidgetsArray[i]->show(); userWidgetsArray[i]->show();
} }
@@ -1656,7 +1659,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
if((*it_c)->getMyID()==0) { if((*it_c)->getMyID()==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }");
//show buttons //show buttons
for(j=0; j<5; j++) { for(j=0; j<6; j++) {
userWidgetsArray[j]->show(); userWidgetsArray[j]->show();
} }
} }
@@ -1669,7 +1672,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
if((*it_c)->getMyID()==0) { if((*it_c)->getMyID()==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }"); groupBoxArray[0]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }");
//hide buttons //hide buttons
for(j=0; j<5; j++) { for(j=0; j<6; j++) {
userWidgetsArray[j]->hide(); userWidgetsArray[j]->hide();
} }
} }
@@ -1701,7 +1704,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }");
//hide buttons //hide buttons
for(j=0; j<5; j++) { for(j=0; j<6; j++) {
userWidgetsArray[j]->hide(); userWidgetsArray[j]->hide();
} }
} }
@@ -1715,7 +1718,7 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
if (!playerID) { if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }"); groupBoxArray[playerID]->setStyleSheet("QGroupBox { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playerBoxInactiveGlow_0.6.png) }");
//show buttons //show buttons
for(j=0; j<5; j++) { for(j=0; j<6; j++) {
userWidgetsArray[j]->show(); userWidgetsArray[j]->show();
} }
} }
@@ -2107,22 +2110,22 @@ void mainWindowImpl::provideMyActions() {
pushButton_BetRaise->setText("Raise"); pushButton_BetRaise->setText("Raise");
} }
if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButton_CallCheckSet->setText("Check"); } if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButton_CallCheck->setText("Check"); }
else { pushButton_CallCheckSet->setText("Call "+QString::number(getMyCallAmount())+"$" ); } else { pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" ); }
pushButton_FoldAllin->setText("Fold"); pushButton_Fold->setText("Fold");
} }
break; break;
case 1: { case 1: {
pushButton_FoldAllin->setText("Fold"); pushButton_Fold->setText("Fold");
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
pushButton_CallCheckSet->setText("Check"); pushButton_CallCheck->setText("Check");
pushButton_BetRaise->setText("Bet"); pushButton_BetRaise->setText("Bet");
} }
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
pushButton_CallCheckSet->setText("Call "+QString::number(getMyCallAmount())+"$" ); pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
pushButton_BetRaise->setText("Raise"); pushButton_BetRaise->setText("Raise");
} }
@@ -2131,15 +2134,15 @@ void mainWindowImpl::provideMyActions() {
break; break;
case 2: { case 2: {
pushButton_FoldAllin->setText("Fold"); pushButton_Fold->setText("Fold");
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
pushButton_CallCheckSet->setText("Check"); pushButton_CallCheck->setText("Check");
pushButton_BetRaise->setText("Bet"); pushButton_BetRaise->setText("Bet");
} }
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
pushButton_CallCheckSet->setText("Call "+QString::number(getMyCallAmount())+"$" ); pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
pushButton_BetRaise->setText("Raise"); pushButton_BetRaise->setText("Raise");
} }
@@ -2148,15 +2151,15 @@ void mainWindowImpl::provideMyActions() {
break; break;
case 3: { case 3: {
pushButton_FoldAllin->setText("Fold"); pushButton_Fold->setText("Fold");
// cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl; // cout << "highestSet in meInAction " << currentHand->getCurrentBeRo()->getHighestSet() << endl;
if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { if (currentHand->getCurrentBeRo()->getHighestSet() == 0) {
pushButton_CallCheckSet->setText("Check"); pushButton_CallCheck->setText("Check");
pushButton_BetRaise->setText("Bet"); pushButton_BetRaise->setText("Bet");
} }
if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) {
pushButton_CallCheckSet->setText("Call "+QString::number(getMyCallAmount())+"$" ); pushButton_CallCheck->setText("Call "+QString::number(getMyCallAmount())+"$" );
if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
pushButton_BetRaise->setText("Raise"); pushButton_BetRaise->setText("Raise");
} }
@@ -2183,9 +2186,9 @@ void mainWindowImpl::meInAction() {
if(myConfig->readConfigInt("ShowStatusbarMessages")) { if(myConfig->readConfigInt("ShowStatusbarMessages")) {
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) { if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
statusBar()->showMessage(tr("F1 - Fold/All-In | F2 - Check/Call | F3 - Bet/Raise"), 15000); statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
} else { } else {
statusBar()->showMessage(tr("F1 - Bet/Raise | F2 - Check/Call | F3 - Fold/All-In"), 15000); statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
} }
} }
@@ -2197,10 +2200,10 @@ void mainWindowImpl::meInAction() {
case 0: // Manual mode case 0: // Manual mode
break; break;
case 1: // Auto check / call all case 1: // Auto check / call all
myCallCheckSet(); myCallCheck();
break; break;
case 2: // Auto check / fold all case 2: // Auto check / fold all
if (pushButton_CallCheckSet->text() == "Check") { if (pushButton_CallCheck->text() == "Check") {
myCheck(); myCheck();
} else { } else {
myFold(); myFold();
@@ -2235,8 +2238,8 @@ void mainWindowImpl::disableMyButtons() {
// spinBox_set->hide(); // spinBox_set->hide();
// pushButton_BetRaise->show(); // pushButton_BetRaise->show();
// pushButton_BetRaise->setText(""); // pushButton_BetRaise->setText("");
// pushButton_CallCheckSet->setText(""); // pushButton_CallCheck->setText("");
// pushButton_FoldAllin->setText(""); // pushButton_Fold->setText("");
myButtonsCheckable(TRUE); myButtonsCheckable(TRUE);
@@ -2261,23 +2264,17 @@ void mainWindowImpl::myBetRaise() {
} }
} }
void mainWindowImpl::myFoldAllin() { void mainWindowImpl::myCallCheck() {
if(!pushButton_FoldAllin->isCheckable()) {
if(pushButton_FoldAllin->text() == "Fold") { myFold(); }
}
}
void mainWindowImpl::myCallCheckSet() { if(pushButton_CallCheck->text().startsWith("Call")) { myCall(); }
if(pushButton_CallCheck->text() == "Check") { myCheck(); }
if(!pushButton_CallCheckSet->isCheckable()) {
if(pushButton_CallCheckSet->text().startsWith("Call")) { myCall(); }
if(pushButton_CallCheckSet->text() == "Check") { myCheck(); }
}
} }
void mainWindowImpl::myFold(){ void mainWindowImpl::myFold(){
if(pushButton_Fold->text() == "Fold") {
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
currentHand->getSeatsList()->front()->setMyAction(1); currentHand->getSeatsList()->front()->setMyAction(1);
currentHand->getSeatsList()->front()->setMyTurn(0); currentHand->getSeatsList()->front()->setMyTurn(0);
@@ -2289,6 +2286,7 @@ void mainWindowImpl::myFold(){
//Spiel läuft weiter //Spiel läuft weiter
myActionDone(); myActionDone();
}
} }
void mainWindowImpl::myCheck() { void mainWindowImpl::myCheck() {
@@ -2391,7 +2389,7 @@ void mainWindowImpl::myRaise(){
void mainWindowImpl::mySet(){ void mainWindowImpl::mySet(){
if(!pushButton_BetRaise->isCheckable() && pushButton_BetRaise->text() != "") { if(pushButton_BetRaise->text() != "") {
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
int tempCash = currentHand->getSeatsList()->front()->getMyCash(); int tempCash = currentHand->getSeatsList()->front()->getMyCash();
@@ -2445,31 +2443,92 @@ void mainWindowImpl::mySet(){
void mainWindowImpl::myAllIn(){ void mainWindowImpl::myAllIn(){
// HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
//
// currentHand->getSeatsList()->front()->setMySet(currentHand->getSeatsList()->front()->getMyCash()); currentHand->getSeatsList()->front()->setMySet(currentHand->getSeatsList()->front()->getMyCash());
// currentHand->getSeatsList()->front()->setMyCash(0); currentHand->getSeatsList()->front()->setMyCash(0);
// currentHand->getSeatsList()->front()->setMyAction(6); currentHand->getSeatsList()->front()->setMyAction(6);
//
// if(currentHand->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { if(currentHand->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) {
// currentHand->getCurrentBeRo()->setMinimumRaise(currentHand->getSeatsList()->front()->getMySet() - currentHand->getCurrentBeRo()->getHighestSet()); currentHand->getCurrentBeRo()->setMinimumRaise(currentHand->getSeatsList()->front()->getMySet() - currentHand->getCurrentBeRo()->getHighestSet());
//
// currentHand->getCurrentBeRo()->setHighestSet(currentHand->getSeatsList()->front()->getMySet()); currentHand->getCurrentBeRo()->setHighestSet(currentHand->getSeatsList()->front()->getMySet());
//
// } }
//
// currentHand->getSeatsList()->front()->setMyTurn(0); currentHand->getSeatsList()->front()->setMyTurn(0);
//
// currentHand->getBoard()->collectSets(); currentHand->getBoard()->collectSets();
// refreshPot(); refreshPot();
//
// statusBar()->clearMessage(); statusBar()->clearMessage();
//
// //set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
// currentHand->setLastPlayersTurn(0); currentHand->setLastPlayersTurn(0);
//
// //Spiel läuft weiter //Spiel läuft weiter
// myActionDone(); myActionDone();
}
void mainWindowImpl::pushButtonBetRaiseClicked(bool checked) {
if (pushButton_BetRaise->isCheckable()) {
if(checked) {
pushButton_CallCheck->setChecked(FALSE);
pushButton_Fold->setChecked(FALSE);
pushButton_AllIn->setChecked(FALSE);
}
else {}
}
else {
mySet();
}
}
void mainWindowImpl::pushButtonCallCheckClicked(bool checked) {
if (pushButton_CallCheck->isCheckable()) {
if(checked) {
pushButton_Fold->setChecked(FALSE);
pushButton_BetRaise->setChecked(FALSE);
pushButton_AllIn->setChecked(FALSE);
}
else {}
}
else {
myCallCheck();
}
}
void mainWindowImpl::pushButtonFoldClicked(bool checked) {
if (pushButton_Fold->isCheckable()) {
if(checked) {
pushButton_CallCheck->setChecked(FALSE);
pushButton_BetRaise->setChecked(FALSE);
pushButton_AllIn->setChecked(FALSE);
}
else {}
}
else {
myFold();
}
}
void mainWindowImpl::pushButtonAllInClicked(bool checked) {
if (pushButton_AllIn->isCheckable()) {
if(checked) {
pushButton_CallCheck->setChecked(FALSE);
pushButton_BetRaise->setChecked(FALSE);
pushButton_Fold->setChecked(FALSE);
}
else {}
}
else {
myAllIn();
}
} }
void mainWindowImpl::myActionDone() { void mainWindowImpl::myActionDone() {
@@ -3720,22 +3779,36 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) { if(spinBox_set->hasFocus()) pushButton_BetRaise->click(); } //ENTER if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return ) { if(spinBox_set->hasFocus()) pushButton_BetRaise->click(); } //ENTER
if (event->key() == Qt::Key_F1) { if (event->key() == Qt::Key_F1) {
if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) { if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) {
pushButton_FoldAllin->click(); pushButton_Fold->click();
} else {
pushButton_AllIn->click();
}
}
if (event->key() == Qt::Key_F2) {
if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) {
pushButton_CallCheck->click();
} else { } else {
pushButton_BetRaise->click(); pushButton_BetRaise->click();
} }
} }
if (event->key() == Qt::Key_F2) { pushButton_CallCheckSet->click(); }
if (event->key() == Qt::Key_F3 ) { if (event->key() == Qt::Key_F3 ) {
if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) { if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) {
pushButton_BetRaise->click(); pushButton_BetRaise->click();
} else { } else {
pushButton_FoldAllin->click(); pushButton_CallCheck->click();
} }
} }
if (event->key() == Qt::Key_F4) { radioButton_manualAction->click(); } if (event->key() == Qt::Key_F4) {
if (event->key() == Qt::Key_F5) { radioButton_autoCheckFold->click(); } if (myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0) {
if (event->key() == Qt::Key_F6) { radioButton_autoCheckCallAny->click(); } pushButton_AllIn->click();
} else {
pushButton_Fold->click();
}
}
if (event->key() == Qt::Key_F5) { radioButton_manualAction->click(); }
if (event->key() == Qt::Key_F6) { radioButton_autoCheckFold->click(); }
if (event->key() == Qt::Key_F7) { radioButton_autoCheckCallAny->click(); }
if (event->key() == 16777249) { //CTRL if (event->key() == 16777249) { //CTRL
pushButton_break->click(); pushButton_break->click();
ctrlPressed = TRUE; ctrlPressed = TRUE;
@@ -3926,25 +3999,27 @@ void mainWindowImpl::myButtonsCheckable(bool state) {
//checkable //checkable
pushButton_BetRaise->setCheckable(TRUE); pushButton_BetRaise->setCheckable(TRUE);
pushButton_CallCheckSet->setCheckable(TRUE); pushButton_CallCheck->setCheckable(TRUE);
pushButton_FoldAllin->setCheckable(TRUE); pushButton_Fold->setCheckable(TRUE);
pushButton_AllIn->setCheckable(TRUE);
//design //design
pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #28E74B; }"); pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #28E74B; }");
pushButton_CallCheckSet->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #009DFF; }"); pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #009DFF; }");
pushButton_FoldAllin->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #FF1E1E; }"); pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #FF1E1E; }");
} }
else { else {
//not checkable //not checkable
pushButton_BetRaise->setCheckable(FALSE); pushButton_BetRaise->setCheckable(FALSE);
pushButton_CallCheckSet->setCheckable(FALSE); pushButton_CallCheck->setCheckable(FALSE);
pushButton_FoldAllin->setCheckable(FALSE); pushButton_Fold->setCheckable(FALSE);
pushButton_AllIn->setCheckable(FALSE);
//design //design
pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }"); pushButton_BetRaise->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_03_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; QPushButton }");
pushButton_CallCheckSet->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_CallCheck->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_05_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
pushButton_FoldAllin->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }"); pushButton_Fold->setStyleSheet("QPushButton { border:none; background-image: url(" + myAppDataPath +"gfx/gui/table/default/playeraction_07_0.6.png); "+ font2String +" font-size: 11px; font-weight: bold; color: #F0F0F0; }");
} }
} }
+7 -3
View File
@@ -196,9 +196,13 @@ public slots:
void callGameLobbyDialog(); void callGameLobbyDialog();
void joinGameLobby(); void joinGameLobby();
void pushButtonBetRaiseClicked(bool checked);
void pushButtonCallCheckClicked(bool checked);
void pushButtonFoldClicked(bool checked);
void pushButtonAllInClicked(bool checked);
void myBetRaise(); void myBetRaise();
void myFoldAllin(); void myCallCheck();
void myCallCheckSet();
void myFold(); void myFold();
void myCheck(); void myCheck();
@@ -386,7 +390,7 @@ private:
QTimer *blinkingStartButtonAnimationTimer; QTimer *blinkingStartButtonAnimationTimer;
QWidget *userWidgetsArray[5]; QWidget *userWidgetsArray[6];
QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *buttonLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *cashLabelArray[MAX_NUMBER_OF_PLAYERS];
QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS]; QLabel *cashTopLabelArray[MAX_NUMBER_OF_PLAYERS];