starts human player input filed redesign - PART VII (firtst steps for network game)
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
using namespace std;
|
||||
|
||||
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(false),
|
||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(false),
|
||||
cardsShown(false), bettingRoundsPlayed(0)
|
||||
{
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ using namespace std;
|
||||
|
||||
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, BoardInterface *b, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
|
||||
: myFactory(f), myGui(g), myBoard(b), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(0),
|
||||
smallBlind(sB), startCash(sC), lastPlayersTurn(0), allInCondition(0),
|
||||
smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(0),
|
||||
cardsShown(false), bettingRoundsPlayed(0)
|
||||
{
|
||||
PlayerListIterator it;
|
||||
|
||||
@@ -95,6 +95,7 @@ void ServerGuiWrapper::nextRoundCleanGui() {}
|
||||
|
||||
void ServerGuiWrapper::meInAction() {}
|
||||
void ServerGuiWrapper::disableMyButtons() {}
|
||||
void ServerGuiWrapper::updateMyButtonsState() {}
|
||||
void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
|
||||
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ public:
|
||||
void nextRoundCleanGui();
|
||||
|
||||
void meInAction();
|
||||
void updateMyButtonsState();
|
||||
void disableMyButtons();
|
||||
void startTimeoutAnimation(int playerId, int timeoutSec);
|
||||
void stopTimeoutAnimation(int playerId);
|
||||
|
||||
@@ -88,6 +88,7 @@ public:
|
||||
// virtual void userWidgetsBackgroudColor() const=0;
|
||||
// virtual void timerBlockerFalse() const=0;
|
||||
virtual void meInAction()=0;
|
||||
virtual void updateMyButtonsState()=0;
|
||||
virtual void disableMyButtons()=0;
|
||||
virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0;
|
||||
virtual void stopTimeoutAnimation(int playerId) =0;
|
||||
|
||||
@@ -95,6 +95,7 @@ void GuiWrapper::flipHolecardsAllIn() { myW->signalFlipHolecardsAllIn(); }
|
||||
void GuiWrapper::nextRoundCleanGui() { myW->signalNextRoundCleanGui(); }
|
||||
|
||||
void GuiWrapper::meInAction() { myW->signalMeInAction(); }
|
||||
void GuiWrapper::updateMyButtonsState() { myW->updateMyButtonsState(); }
|
||||
void GuiWrapper::disableMyButtons() { myW->signalDisableMyButtons(); }
|
||||
void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->signalStartTimeoutAnimation(playerId, timeoutSec); }
|
||||
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); }
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
|
||||
void meInAction();
|
||||
void disableMyButtons();
|
||||
void updateMyButtonsState();
|
||||
void startTimeoutAnimation(int playerId, int timeoutSec);
|
||||
void stopTimeoutAnimation(int playerId);
|
||||
|
||||
|
||||
@@ -2389,19 +2389,13 @@ void mainWindowImpl::nextPlayerAnimation() {
|
||||
if((*it_c)->getMyID() == currentHand->getLastPlayersTurn()) break;
|
||||
}
|
||||
|
||||
refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction());
|
||||
if(currentHand->getLastPlayersTurn() != -1) {
|
||||
refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction());
|
||||
}
|
||||
refreshCash();
|
||||
|
||||
//refresh actions for human player
|
||||
|
||||
if(currentHand->getLastPlayersTurn() == 0) {
|
||||
myButtonsCheckable(FALSE);
|
||||
clearMyButtons();
|
||||
}
|
||||
else {
|
||||
myButtonsCheckable(TRUE);
|
||||
provideMyActions();
|
||||
}
|
||||
updateMyButtonsState();
|
||||
|
||||
nextPlayerAnimationTimer->start(nextPlayerSpeed1);
|
||||
}
|
||||
@@ -3532,6 +3526,20 @@ void mainWindowImpl::mouseOverFlipCards(bool front) {
|
||||
}
|
||||
}
|
||||
|
||||
void mainWindowImpl::updateMyButtonsState() {
|
||||
|
||||
HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand();
|
||||
|
||||
if(currentHand->getLastPlayersTurn() == 0) {
|
||||
myButtonsCheckable(FALSE);
|
||||
clearMyButtons();
|
||||
}
|
||||
else {
|
||||
myButtonsCheckable(TRUE);
|
||||
provideMyActions();
|
||||
}
|
||||
}
|
||||
|
||||
void mainWindowImpl::uncheckMyButtons() {
|
||||
|
||||
pushButton_BetRaise->setChecked(FALSE);
|
||||
|
||||
@@ -310,6 +310,7 @@ public slots:
|
||||
|
||||
void mouseOverFlipCards(bool front);
|
||||
|
||||
void updateMyButtonsState();
|
||||
void uncheckMyButtons();
|
||||
void resetMyButtonsCheckStateMemory();
|
||||
void clearMyButtons();
|
||||
|
||||
@@ -935,7 +935,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(actionDoneData.highestSet);
|
||||
curGame->getCurrentHand()->getBoard()->collectSets();
|
||||
curGame->getCurrentHand()->switchRounds();
|
||||
|
||||
curGame->getCurrentHand()->setLastPlayersTurn(tmpPlayer->getMyID());
|
||||
|
||||
//log blinds sets after setting bigblind-button
|
||||
if (isBigBlind) {
|
||||
@@ -957,6 +957,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().refreshCash();
|
||||
client.GetGui().refreshButton();
|
||||
client.GetGui().updateMyButtonsState();
|
||||
}
|
||||
else if (packet->ToNetPacketPlayersTurn())
|
||||
{
|
||||
@@ -1011,7 +1012,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_FLOP);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealFlopCards();
|
||||
client.GetGui().dealBeRoCards(1);
|
||||
}
|
||||
else if (packet->ToNetPacketDealTurnCard())
|
||||
{
|
||||
@@ -1027,7 +1028,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_TURN);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealTurnCard();
|
||||
client.GetGui().dealBeRoCards(2);
|
||||
}
|
||||
else if (packet->ToNetPacketDealRiverCard())
|
||||
{
|
||||
@@ -1043,7 +1044,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_RIVER);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealRiverCard();
|
||||
client.GetGui().dealBeRoCards(3);
|
||||
}
|
||||
else if (packet->ToNetPacketAllInShowCards())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user