This commit is contained in:
doitux
2007-03-29 22:58:04 +00:00
parent c1f7a257f1
commit 1c7f572fbf
19 changed files with 525 additions and 267 deletions
+3
View File
@@ -71,6 +71,9 @@ public:
virtual void setBettingRoundsPlayed(const int& theValue) =0;
virtual int getBettingRoundsPlayed() const =0;
virtual void setLastPlayersTurn(const int& theValue) =0;
virtual int getLastPlayersTurn() const =0;
virtual void assignButtons() =0;
virtual void highlightRoundLabel() =0;
+6 -3
View File
@@ -76,8 +76,11 @@ void LocalFlop::flopRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
}
@@ -100,7 +103,7 @@ void LocalFlop::flopRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
+5 -2
View File
@@ -25,6 +25,8 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
{
int i, j, k;
lastPlayersTurn = 0;
CardsValue myCardsValue;
myGui->setHand(this);
@@ -47,7 +49,7 @@ LocalHand::LocalHand(EngineFactory *f, GuiInterface *g, BoardInterface *b, Playe
// Dealer, SB, BB bestimmen
assignButtons();
myGui->refreshAll();
// myGui->refreshAll();
// Karten generieren und Board sowie Player zuweisen
Tools myTool;
@@ -237,8 +239,9 @@ void LocalHand::switchRounds() {
actualRound++;
}
//unhighlight actual players groupbox
myGui->refreshGroupbox(lastPlayersTurn,1);
myGui->refreshGroupbox();
highlightRoundLabel();
// /*/*/*/*cout <<*/*/*/*/ "NextPlayerSpeed1 stop" << endl;
//
+6
View File
@@ -81,6 +81,10 @@ public:
void setBettingRoundsPlayed(const int& theValue) { bettingRoundsPlayed = theValue; }
int getBettingRoundsPlayed() const { return bettingRoundsPlayed; }
void setLastPlayersTurn(const int& theValue) { lastPlayersTurn = theValue; }
int getLastPlayersTurn() const { return lastPlayersTurn; }
void assignButtons();
void highlightRoundLabel();
@@ -114,6 +118,8 @@ private:
int startCash;
int activePlayersCounter;
int lastPlayersTurn;
bool allInCondition;
// hier steht bis zu welcher bettingRound der human player gespielt hat: 0 - nur Preflop, 1 - bis Flop, ...
+20 -15
View File
@@ -63,12 +63,15 @@ LocalPlayer::LocalPlayer(BoardInterface *b, int id, std::string name, std::strin
}
LocalPlayer::~LocalPlayer()
{
}
void LocalPlayer::setHand(HandInterface* br) { actualHand = br; }
void LocalPlayer::action() {
ConfigFile myConfig;
@@ -116,6 +119,9 @@ void LocalPlayer::action() {
myTurn = 0;
// cout << "jetzt" << endl;
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(myID);
actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
actualHand->getGuiInterface()->nextPlayerAnimation();
@@ -128,10 +134,11 @@ void LocalPlayer::preflopEngine() {
int bet = 0;
int raise = 0;
// übergang solange preflopValue und flopValue noch nicht bereinigt
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
int players = actualHand->getActualQuantityPlayers();
if(players > 5) players = 5;
// myOdds auslesen
readFile();
// Niveaus setzen + Dude + Anzahl Gegenspieler
@@ -144,9 +151,7 @@ void LocalPlayer::preflopEngine() {
int individualHighestSet = actualHand->getPreflop()->getHighestSet();
if(individualHighestSet > myCash) individualHighestSet = myCash;
// Verhaeltnis Set / Cash
// Verhaeltnis Set / Cash für call
if(myCash/individualHighestSet >= 25) {
myNiveau[0] += (25-myCash/individualHighestSet)/10;
} else {
@@ -158,9 +163,17 @@ void LocalPlayer::preflopEngine() {
myNiveau[2] += (10-myCash/individualHighestSet)/2;
}
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
// Aggresivität des humanPlayers auslesen
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*0.1)/7.0 - 1.0/actualHand->getActualQuantityPlayers())*7.0);
// if(aggValue > 0) {
// myNiveau[0] -= aggValue;
// myNiveau[2] -= aggValue;
// }
// auf Aggresivität des humanPlayers eingehen
// int aggValue = ( (50*(actualHand->getPlayerArray()[0]->getMyAverageSets()-6*actualHand->getSmallBlind())) / (actualHand->getStartQuantityPlayers()*actualHand->getStartCash() - 6*actualHand->getSmallBlind()) );
// if(aggValue > 0) {
@@ -869,7 +882,6 @@ void LocalPlayer::riverEngine() {
}
void LocalPlayer::evaluation(int bet, int raise) {
int highestSet = 0;
@@ -967,10 +979,6 @@ void LocalPlayer::evaluation(int bet, int raise) {
}
int LocalPlayer::preflopCardsValue(int* cards) {
// Code der HoleCards ermitteln
@@ -995,9 +1003,6 @@ int LocalPlayer::preflopCardsValue(int* cards) {
}
int LocalPlayer::flopCardsValue(int* cards) {
int array[5][3];
+5 -2
View File
@@ -83,8 +83,11 @@ void LocalPreflop::preflopRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
}
@@ -101,7 +104,7 @@ void LocalPreflop::preflopRun() {
} while(!(myHand->getPlayerArray()[playersTurn]->getMyActiveStatus()) || myHand->getPlayerArray()[playersTurn]->getMyAction() == 1 || myHand->getPlayerArray()[playersTurn]->getMyAction() == 6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
if(playersTurn == 0) {
// Wir sind dran
+6 -5
View File
@@ -77,7 +77,10 @@ void LocalRiver::riverRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
@@ -100,7 +103,7 @@ void LocalRiver::riverRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
@@ -157,11 +160,9 @@ void LocalRiver::postRiverRun() {
}
}
// prüfen ob nur noch der human player an der verteilung teilnimmt
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
myHand->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1);
cout << "aggressive: " << myHand->getPlayerArray()[0]->getMyAggressive() << endl;
// Pot-Verteilung
distributePot();
+5 -2
View File
@@ -78,7 +78,10 @@ void LocalTurn::turnRun() {
myHand->getBoard()->collectSets();
myHand->getBoard()->collectPot();
myHand->getGuiInterface()->refreshPot();
myHand->getGuiInterface()->refreshAll();
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
myHand->switchRounds();
@@ -101,7 +104,7 @@ void LocalTurn::turnRun() {
} while(!(myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyActiveStatus()) || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==1 || (myHand->getPlayerArray()[activePlayerBeforeSmallBlind]->getMyAction())==6);
myHand->getPlayerArray()[playersTurn]->setMyTurn(1);
myHand->getGuiInterface()->refreshGroupbox();
myHand->getGuiInterface()->refreshGroupbox(playersTurn,2);
// cout << "activePlayerBeforeSmallBlind " << activePlayerBeforeSmallBlind << endl;
// cout << "playersTurn " << playersTurn << endl;
+1 -1
View File
@@ -143,7 +143,7 @@ void Game::startHand()
myGui->nextRoundCleanGui();
//Spielernamen schreiben
myGui->refreshPlayerName();
// myGui->refreshPlayerName();
// Dealer-Button weiterschieben --> Achtung inactive
do {
+3 -1
View File
@@ -44,9 +44,11 @@ public:
//refresh-Funktionen
virtual void refreshSet() const=0;
virtual void refreshCash() const=0;
virtual void refreshAction(int =-1, int =-1) const=0;
virtual void refreshChangePlayer() const=0;
virtual void refreshPot() const=0;
virtual void refreshGroupbox() const=0;
virtual void refreshGroupbox(int =-1, int =-1) const=0;
virtual void refreshAll() const=0;
virtual void refreshPlayerName() const=0;
+3 -1
View File
@@ -48,10 +48,12 @@ void GuiWrapper::setSession(Session *s) { myW->setSession(s); }
int GuiWrapper::getMaxQuantityPlayers() const { return myW->getMaxQuantityPlayers(); }
void GuiWrapper::refreshSet() const { myW->refreshSet(); }
void GuiWrapper::refreshCash() const { myW->refreshCash(); }
void GuiWrapper::refreshAction(int playerID, int playerAction) const { myW->refreshAction(playerID, playerAction); }
void GuiWrapper::refreshChangePlayer() const { myW->refreshChangePlayer(); }
void GuiWrapper::refreshAll() const { myW->refreshAll(); }
void GuiWrapper::refreshPot() const { myW->refreshPot(); }
void GuiWrapper::refreshGroupbox() const { myW->refreshGroupbox(); }
void GuiWrapper::refreshGroupbox(int playerID, int status) const { myW->refreshGroupbox(playerID, status); }
void GuiWrapper::refreshPlayerName() const { myW->refreshPlayerName(); }
void GuiWrapper::dealHoleCards() const { myW->dealHoleCards(); }
+5 -3
View File
@@ -49,9 +49,11 @@ public:
int getMaxQuantityPlayers() const;
void refreshSet() const;
void refreshCash() const;
void refreshAction(int =-1, int =-1) const;
void refreshChangePlayer() const;
void refreshPot() const;
void refreshGroupbox() const;
void refreshGroupbox(int =-1, int =-1) const;
void refreshAll() const;
void refreshPlayerName() const;
@@ -92,8 +94,8 @@ public:
void SignalNetClientGameInfo(int actionID);
void SignalNetClientError(int errorID, int osErrorID);
void SignalNetServerSuccess(int actionID);
void SignalNetServerError(int errorID, int osErrorID);
void SignalNetServerSuccess(int actionID);
void SignalNetServerError(int errorID, int osErrorID);
private:
+275 -152
View File
@@ -574,44 +574,34 @@
</spacer>
</item>
<item>
<widget class="QTabWidget" name="tabWidget_LeftToolBox" >
<widget class="QGroupBox" name="groupBox_LeftToolBox" >
<property name="minimumSize" >
<size>
<width>197</width>
<height>0</height>
<height>172</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>197</width>
<height>16777215</height>
<height>172</height>
</size>
</property>
<property name="currentIndex" >
<number>0</number>
<property name="styleSheet" >
<string>QGroupBox { background-image: url(:/graphics/resources/graphics/toolboxFrameBG.png) }</string>
</property>
<widget class="QWidget" name="tab_log_2" >
<property name="styleSheet" >
<string>QWidget { background-image: url(:/graphics/resources/graphics/1px.png) }</string>
<widget class="QLabel" name="label" >
<property name="geometry" >
<rect>
<x>10</x>
<y>20</y>
<width>181</width>
<height>133</height>
</rect>
</property>
<property name="pixmap" >
<pixmap resource="resources.qrc" >:/graphics/resources/graphics/handRanking_release.png</pixmap>
</property>
<attribute name="title" >
<string>Hands</string>
</attribute>
<layout class="QGridLayout" >
<property name="margin" >
<number>5</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label_3" >
<property name="pixmap" >
<pixmap resource="resources.qrc" >:/graphics/resources/graphics/handRanking_release.png</pixmap>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
@@ -813,19 +803,6 @@
</item>
</layout>
</widget>
<widget class="QLabel" name="label_Avatar0" >
<property name="geometry" >
<rect>
<x>25</x>
<y>120</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
<widget class="QLabel" name="textLabel_Button0" >
<property name="geometry" >
<rect>
@@ -900,6 +877,28 @@
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
</widget>
<widget class="QSpinBox" name="spinBox_set" >
<property name="geometry" >
<rect>
<x>232</x>
<y>44</y>
<width>55</width>
<height>21</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="singleStep" >
<number>5</number>
</property>
</widget>
<widget class="QPushButton" name="pushButton_CallCheckSet" >
<property name="geometry" >
<rect>
@@ -946,6 +945,9 @@
</disabled>
</palette>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
</widget>
<widget class="QPushButton" name="pushButton_FoldAllin" >
<property name="geometry" >
@@ -993,24 +995,8 @@
</disabled>
</palette>
</property>
</widget>
<widget class="QSpinBox" name="spinBox_set" >
<property name="geometry" >
<rect>
<x>232</x>
<y>44</y>
<width>55</width>
<height>21</height>
</rect>
</property>
<property name="minimumSize" >
<size>
<width>40</width>
<height>0</height>
</size>
</property>
<property name="singleStep" >
<number>5</number>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
</widget>
<widget class="QPushButton" name="pushButton_BetRaise" >
@@ -1059,6 +1045,25 @@
</disabled>
</palette>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
</widget>
<widget class="QLabel" name="label_Avatar0" >
<property name="geometry" >
<rect>
<x>25</x>
<y>120</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
@@ -1119,7 +1124,7 @@
</spacer>
</item>
<item>
<widget class="QFrame" name="frame_RightToolBox" >
<widget class="QGroupBox" name="groupBox_RightToolBox" >
<property name="minimumSize" >
<size>
<width>197</width>
@@ -1132,44 +1137,115 @@
<height>172</height>
</size>
</property>
<property name="styleSheet" >
<string>QGroupBox { background-image: url(:/graphics/resources/graphics/toolboxFrameBG.png) }</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
<number>9</number>
</property>
<property name="spacing" >
<number>5</number>
</property>
<item row="0" column="0" >
<widget class="QTabWidget" name="tabWidget_RightToolBox" >
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>162</height>
</size>
<widget class="QTextBrowser" name="textBrowser_Log" >
<property name="palette" >
<palette>
<active>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Base" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>29</red>
<green>59</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="currentIndex" >
<number>0</number>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="horizontalScrollBarPolicy" >
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<widget class="QWidget" name="tab_log_4" >
<attribute name="title" >
<string>Log</string>
</attribute>
<layout class="QGridLayout" >
<property name="margin" >
<number>4</number>
</property>
<property name="spacing" >
<number>0</number>
</property>
<item row="0" column="0" >
<widget class="QTextBrowser" name="textBrowser_Log" >
<property name="horizontalScrollBarPolicy" >
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0" >
@@ -1249,6 +1325,9 @@
</disabled>
</palette>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="minimum" >
<number>1</number>
</property>
@@ -1274,12 +1353,21 @@
<property name="palette" >
<palette>
<active>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
@@ -1294,12 +1382,21 @@
</colorrole>
</active>
<inactive>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>0</red>
<green>0</green>
<blue>0</blue>
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
@@ -1314,6 +1411,15 @@
</colorrole>
</inactive>
<disabled>
<colorrole role="Button" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
<red>40</red>
<green>82</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
<colorrole role="ButtonText" >
<brush brushstyle="SolidPattern" >
<color alpha="255" >
@@ -1335,6 +1441,9 @@
</disabled>
</palette>
</property>
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="text" >
<string>Stop</string>
</property>
@@ -1594,19 +1703,6 @@
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar1" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
<widget class="QFrame" name="frame_Cards1" >
<property name="geometry" >
<rect>
@@ -1639,6 +1735,22 @@
</property>
</widget>
</widget>
<widget class="QLabel" name="label_Avatar1" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
</layout>
@@ -2681,19 +2793,6 @@
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar6" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
<widget class="QFrame" name="frame_Cards6" >
<property name="geometry" >
<rect>
@@ -2739,6 +2838,22 @@
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar6" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
</layout>
@@ -3023,6 +3138,9 @@
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
@@ -3255,19 +3373,6 @@
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar3" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
<widget class="QFrame" name="frame_Cards3" >
<property name="geometry" >
<rect>
@@ -3300,6 +3405,22 @@
</property>
</widget>
</widget>
<widget class="QLabel" name="label_Avatar3" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
<item>
@@ -3575,6 +3696,9 @@
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
@@ -3794,19 +3918,6 @@
<set>Qt::AlignBottom|Qt::AlignHCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar5" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
</widget>
<widget class="QFrame" name="frame_Cards5" >
<property name="geometry" >
<rect>
@@ -3852,6 +3963,22 @@
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
<widget class="QLabel" name="label_Avatar5" >
<property name="geometry" >
<rect>
<x>17</x>
<y>17</y>
<width>50</width>
<height>50</height>
</rect>
</property>
<property name="pixmap" >
<pixmap/>
</property>
<property name="scaledContents" >
<bool>true</bool>
</property>
</widget>
</widget>
</item>
<item>
@@ -3944,10 +4071,6 @@
</action>
</widget>
<tabstops>
<tabstop>pushButton_BetRaise</tabstop>
<tabstop>pushButton_CallCheckSet</tabstop>
<tabstop>pushButton_FoldAllin</tabstop>
<tabstop>tabWidget_LeftToolBox</tabstop>
<tabstop>spinBox_set</tabstop>
</tabstops>
<resources>
@@ -3961,12 +4084,12 @@
<slot>setNum(int)</slot>
<hints>
<hint type="sourcelabel" >
<x>903</x>
<y>635</y>
<x>886</x>
<y>624</y>
</hint>
<hint type="destinationlabel" >
<x>858</x>
<y>636</y>
<y>620</y>
</hint>
</hints>
</connection>
+178 -77
View File
@@ -205,11 +205,11 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
//Toolboxen verstecken?
if (!myConfig->readConfigInt("ShowRightToolBox")) {
tabWidget_LeftToolBox->hide();
groupBox_LeftToolBox->hide();
label_logoright->show();
}
if (!myConfig->readConfigInt("ShowLeftToolBox")) {
tabWidget_LeftToolBox->hide();
groupBox_LeftToolBox->hide();
label_logoleft->show();
}
@@ -464,6 +464,9 @@ mainWindowImpl::mainWindowImpl(QMainWindow *parent)
// QShortcut *startNewGameKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_N), this);
// connect( startNewGameKeys, SIGNAL(activated() ), actionNewGame, SLOT( trigger() ) );
//Clear Focus
groupBox_LeftToolBox->clearFocus();
//Statusbar
statusBar()->showMessage(tr("Ctrl+N to start a new Game"));
@@ -574,8 +577,8 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) {
// QPalette tempPalette = groupBox_board->palette();
// tempPalette.setColor(QPalette::Window, active);
// groupBox_board->setPalette(tempPalette);
frame_RightToolBox->setDisabled(FALSE);
tabWidget_LeftToolBox->setDisabled(FALSE);
groupBox_RightToolBox->setDisabled(FALSE);
groupBox_LeftToolBox->setDisabled(FALSE);
//show human player buttons
for(i=0; i<3; i++) {
@@ -677,11 +680,11 @@ void mainWindowImpl::callSettingsDialog() {
if (v->getSettingsCorrect()) {
//Toolbox verstecken?
if (myConfig->readConfigInt("ShowLeftToolBox")) { tabWidget_LeftToolBox->show(); }
else { tabWidget_LeftToolBox->hide(); }
if (myConfig->readConfigInt("ShowLeftToolBox")) { groupBox_LeftToolBox->show(); }
else { groupBox_LeftToolBox->hide(); }
if (myConfig->readConfigInt("ShowRightToolBox")) { frame_RightToolBox->show(); }
else { frame_RightToolBox->hide(); }
if (myConfig->readConfigInt("ShowRightToolBox")) { groupBox_RightToolBox->show(); }
else { groupBox_RightToolBox->hide(); }
//Falls Spielernamen geändert wurden --> neu zeichnen --> erst beim nächsten Neustart neu ausgelesen
if (v->getPlayerNickIsChanged() && actualGame) {
@@ -697,7 +700,21 @@ void mainWindowImpl::callSettingsDialog() {
refreshPlayerName();
}
if(actualGame) {
actualHand->getPlayerArray()[0]->setMyAvatar(v->lineEdit_humanPlayerAvatar->text().toStdString());
actualHand->getPlayerArray()[1]->setMyAvatar(v->lineEdit_Opponent1Avatar->text().toStdString());
actualHand->getPlayerArray()[2]->setMyAvatar(v->lineEdit_Opponent2Avatar->text().toStdString());
actualHand->getPlayerArray()[3]->setMyAvatar(v->lineEdit_Opponent3Avatar->text().toStdString());
actualHand->getPlayerArray()[4]->setMyAvatar(v->lineEdit_Opponent4Avatar->text().toStdString());
actualHand->getPlayerArray()[5]->setMyAvatar(v->lineEdit_Opponent5Avatar->text().toStdString());
actualHand->getPlayerArray()[6]->setMyAvatar(v->lineEdit_Opponent6Avatar->text().toStdString());
//avatar refresh
refreshPlayerAvatar();
}
//Flipside refresh
if (myConfig->readConfigInt("FlipsideOwn") && myConfig->readConfigString("FlipsideOwnFile") != "") {
@@ -716,8 +733,7 @@ void mainWindowImpl::callSettingsDialog() {
}
}
//avatar refresh
refreshPlayerAvatar();
}
}
@@ -821,7 +837,7 @@ void mainWindowImpl::refreshPlayerAvatar() {
}
}
void mainWindowImpl::refreshAction() {
void mainWindowImpl::refreshAction(int playerID, int playerAction) {
QPixmap onePix(":/graphics/resources/graphics/1px.png");
QPixmap action;
@@ -829,25 +845,50 @@ void mainWindowImpl::refreshAction() {
QStringList actionArray;
actionArray << "" << "fold" << "check" << "call" << "bet" << "raise" << "allin";
int i;
for (i=0; i<maxQuantityPlayers; i++) {
if(playerID == -1 || playerAction == -1) {
int i;
for (i=0; i<maxQuantityPlayers; i++) {
//if no action --> clear Pixmap
if(actualHand->getPlayerArray()[i]->getMyAction() == 0) {
actionLabelArray[i]->setPixmap(onePix);
}
else {
if(i!=0 || ( i==0 && actualHand->getPlayerArray()[0]->getMyAction() != 1) ) {
//paint action pixmap
actionLabelArray[i]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png"));
}
// actionLabelArray[i]->setStyleSheet("QLabel { background-image: url(:/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png");
}
if (actualHand->getPlayerArray()[i]->getMyAction()==1) {
// groupBoxArray[i]->setDisabled(TRUE);
if(i != 0) {
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
}
}
}
}
else {
//if no action --> clear Pixmap
if(actualHand->getPlayerArray()[i]->getMyAction() == 0) {
actionLabelArray[i]->setPixmap(onePix);
if(playerAction == 0) {
actionLabelArray[playerID]->setPixmap(onePix);
}
else {
//paint action pixmap and raise
actionLabelArray[i]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[actualHand->getPlayerArray()[i]->getMyAction()]+".png"));
// paint action pixmap and raise
actionLabelArray[playerID]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[playerAction]+".png"));
}
if (playerAction == 1) {
// groupBoxArray[i]->setDisabled(TRUE);
if (actualHand->getPlayerArray()[i]->getMyAction()==1) {
// groupBoxArray[i]->setDisabled(TRUE);
if(i != 0) {
holeCardsArray[i][0]->setPixmap(onePix, FALSE);
holeCardsArray[i][1]->setPixmap(onePix, FALSE);
if(playerID != 0) {
holeCardsArray[playerID][0]->setPixmap(onePix, FALSE);
holeCardsArray[playerID][1]->setPixmap(onePix, FALSE);
}
}
}
@@ -869,50 +910,88 @@ void mainWindowImpl::refreshCash() {
}
}
void mainWindowImpl::refreshGroupbox() {
void mainWindowImpl::refreshGroupbox(int playerID, int status) {
int i,j;
for (i=0; i<maxQuantityPlayers; i++) {
if(playerID == -1 || status == -1) {
if(actualHand->getPlayerArray()[i]->getMyTurn()) {
//Groupbox glow wenn der Spiele dran ist.
if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }");
}
else {
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }");
}
} else {
//Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist.
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
int i,j;
for (i=0; i<maxQuantityPlayers; i++) {
if(actualHand->getPlayerArray()[i]->getMyTurn()) {
//Groupbox glow wenn der Spiele dran ist.
if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
//show buttons
for(j=0; j<3; j++) {
userWidgetsArray[j]->show();
}
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }");
}
else {
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
}
}
//Groupbox verdunkeln wenn der Spiele inactive ist.
else {
if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
//hide buttons
for(j=0; j<4; j++) {
userWidgetsArray[j]->hide();
}
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }");
}
} else {
//Groupbox auf Hintergrundfarbe setzen wenn der Spiele nicht dran aber aktiv ist.
if(actualHand->getPlayerArray()[i]->getMyActiveStatus()) {
if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
//show buttons
for(j=0; j<3; j++) {
userWidgetsArray[j]->show();
}
}
else {
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
}
}
//Groupbox verdunkeln wenn der Spiele inactive ist.
else {
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
if(i==0) {
groupBoxArray[0]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
//hide buttons
for(j=0; j<4; j++) {
userWidgetsArray[j]->hide();
}
}
else {
groupBoxArray[i]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
}
}
}
}
}
else {
switch(status) {
//inactive
case 0: {
if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
}
else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
}
}
break;
//active but fold
case 1: {
if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxInactiveGlow.png) }");
}
else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxInactiveGlow.png) }");
}
}
break;
//active in action
case 2: {
if (!playerID) {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/playerBoxActiveGlow.png) }");
}
else {
groupBoxArray[playerID]->setStyleSheet("QGroupBox { background-image: url(:/guiv2/resources/guiv2/opponentBoxActiveGlow.png) }");
}
}
break;
default: {}
}
}
}
void mainWindowImpl::highlightRoundLabel(string tempround) {
@@ -945,11 +1024,9 @@ void mainWindowImpl::refreshAll() {
void mainWindowImpl::refreshChangePlayer() {
refreshSet(); // alter
refreshButton(); // wech
refreshAction(); // alter
refreshCash(); // alter
//<refreshGroupbox(int 1, int 2)
refreshSet();
refreshAction();
refreshCash();
}
void mainWindowImpl::refreshPot() {
@@ -1005,7 +1082,7 @@ void mainWindowImpl::dealHoleCards() {
}
}
//Groupbox repaint() hline-bug?;
refreshGroupbox();
// refreshGroupbox();
}
void mainWindowImpl::dealFlopCards0() { dealFlopCards0Timer->start(preDealCardsSpeed); }
@@ -1230,24 +1307,24 @@ void mainWindowImpl::meInAction() {
void mainWindowImpl::disableMyButtons() {
//clear userWidgets
spinBox_set->setMinimum(0);
spinBox_set->setValue(0);
spinBox_set->hide();
pushButton_BetRaise->show();
pushButton_BetRaise->setText("");
pushButton_CallCheckSet->setText("");
pushButton_FoldAllin->setText("");
spinBox_set->setMinimum(0);
spinBox_set->setValue(0);
spinBox_set->hide();
}
void mainWindowImpl::myBetRaise() {
if(pushButton_BetRaise->text() == "Raise") { myRaise(); }
else { myBet(); }
if(pushButton_BetRaise->text() == "Bet") { myBet(); }
}
void mainWindowImpl::myFoldAllin() {
if(pushButton_FoldAllin->text() == "Fold") { myFold(); }
else { myAllIn(); }
if(pushButton_FoldAllin->text() == "All-In") { myAllIn(); }
}
void mainWindowImpl::myCallCheckSet() {
@@ -1265,7 +1342,12 @@ void mainWindowImpl::myFold(){
//Action in LogWindow
myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet());
holeCardsArray[0][0]->startFadeOut(10);
holeCardsArray[0][1]->startFadeOut(10);
disableMyButtons();
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(0);
//Spiel läuft weiter
nextPlayerAnimation();
@@ -1281,6 +1363,9 @@ void mainWindowImpl::myCheck() {
disableMyButtons();
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(0);
//Spiel läuft weiter
nextPlayerAnimation();
}
@@ -1321,6 +1406,9 @@ void mainWindowImpl::myCall(){
disableMyButtons();
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(0);
//Spiel läuft weiter
nextPlayerAnimation();
}
@@ -1410,6 +1498,9 @@ void mainWindowImpl::mySet(){
disableMyButtons();
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(0);
//Spiel läuft weiter
nextPlayerAnimation();
}
@@ -1443,13 +1534,21 @@ void mainWindowImpl::myAllIn(){
disableMyButtons();
//set that i was the last active player. need this for unhighlighting groupbox
actualHand->setLastPlayersTurn(0);
//Spiel läuft weiter
nextPlayerAnimation();
}
void mainWindowImpl::nextPlayerAnimation() {
refreshChangePlayer();
//refresh Change Player
refreshSet();
refreshAction(actualHand->getLastPlayersTurn(), actualHand->getPlayerArray()[actualHand->getLastPlayersTurn()]->getMyAction());
refreshCash();
nextPlayerAnimationTimer->start(nextPlayerSpeed1);
}
@@ -1857,8 +1956,10 @@ void mainWindowImpl::nextRoundCleanGui() {
// labelPalette.setColor(QPalette::WindowText, c);
// label_Pot->setPalette(labelPalette);
disableMyButtons();
// for startNewGame during human player is active
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() == 1) {
disableMyButtons();
}
// QPalette tempPalette = frame_Pot->palette();
// tempPalette.setColor(QPalette::Window, active);
// frame_Pot->setPalette(tempPalette);
@@ -1925,7 +2026,7 @@ void mainWindowImpl::setSpeeds() {
gameSpeed = (11-guiGameSpeed)*10;
dealCardsSpeed = (gameSpeed/2)*10; //milliseconds
preDealCardsSpeed = dealCardsSpeed*2; //Zeit for Karten aufdecken auf dem Board (Flop, Turn, River)
postDealCardsSpeed = dealCardsSpeed*2; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River)
postDealCardsSpeed = dealCardsSpeed*3; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River)
AllInDealCardsSpeed = dealCardsSpeed*4; //Zeit nach Karten aufdecken auf dem Board (Flop, Turn, River) bei AllIn
postRiverRunAnimationSpeed = gameSpeed*18;
winnerBlinkSpeed = gameSpeed*3; //milliseconds
@@ -2061,14 +2162,14 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
void mainWindowImpl::switchLeftToolBox() {
if (tabWidget_LeftToolBox->isHidden()) { tabWidget_LeftToolBox->show(); }
else { tabWidget_LeftToolBox->hide(); }
if (groupBox_LeftToolBox->isHidden()) { groupBox_LeftToolBox->show(); }
else { groupBox_LeftToolBox->hide(); }
}
void mainWindowImpl::switchRightToolBox() {
if (frame_RightToolBox->isHidden()) { frame_RightToolBox->show(); }
else { frame_RightToolBox->hide(); }
if (groupBox_RightToolBox->isHidden()) { groupBox_RightToolBox->show(); }
else { groupBox_RightToolBox->hide(); }
}
void mainWindowImpl::switchFullscreen() {
+2 -2
View File
@@ -72,9 +72,9 @@ public:
void refreshButton();
void refreshPlayerName();
void refreshPlayerAvatar();
void refreshAction();
void refreshAction(int =-1, int=-1);
void refreshCash();
void refreshGroupbox();
void refreshGroupbox(int =-1, int =-1);
void refreshAll();
void refreshChangePlayer();
void refreshPot();
+1 -1
View File
@@ -60,7 +60,7 @@ void MyCardsPixmapLabel::startFadeOut(int speed) {
void MyCardsPixmapLabel::nextFadeOutFrame() {
if (frameOpacity < 0.65) {
if (frameOpacity < 0.75) {
frameOpacity += opacityRaiseIntervall;
update();
}
+1
View File
@@ -77,6 +77,7 @@
<file>resources/graphics/1px.png</file>
<file>resources/graphics/fileopen16.png</file>
<file>resources/graphics/handRanking_release.png</file>
<file>resources/graphics/toolboxFrameBG.png</file>
<file>resources/graphics/logoChip3D.png</file>
</qresource>
<qresource prefix="/guiv2" >
Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 B