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;
|
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)
|
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)
|
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)
|
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),
|
: 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)
|
cardsShown(false), bettingRoundsPlayed(0)
|
||||||
{
|
{
|
||||||
PlayerListIterator it;
|
PlayerListIterator it;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ void ServerGuiWrapper::nextRoundCleanGui() {}
|
|||||||
|
|
||||||
void ServerGuiWrapper::meInAction() {}
|
void ServerGuiWrapper::meInAction() {}
|
||||||
void ServerGuiWrapper::disableMyButtons() {}
|
void ServerGuiWrapper::disableMyButtons() {}
|
||||||
|
void ServerGuiWrapper::updateMyButtonsState() {}
|
||||||
void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
|
void ServerGuiWrapper::startTimeoutAnimation(int /*playerId*/, int /*timeoutSec*/) {}
|
||||||
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
|
void ServerGuiWrapper::stopTimeoutAnimation(int /*playerId*/) {}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ public:
|
|||||||
void nextRoundCleanGui();
|
void nextRoundCleanGui();
|
||||||
|
|
||||||
void meInAction();
|
void meInAction();
|
||||||
|
void updateMyButtonsState();
|
||||||
void disableMyButtons();
|
void disableMyButtons();
|
||||||
void startTimeoutAnimation(int playerId, int timeoutSec);
|
void startTimeoutAnimation(int playerId, int timeoutSec);
|
||||||
void stopTimeoutAnimation(int playerId);
|
void stopTimeoutAnimation(int playerId);
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ public:
|
|||||||
// virtual void userWidgetsBackgroudColor() const=0;
|
// virtual void userWidgetsBackgroudColor() const=0;
|
||||||
// virtual void timerBlockerFalse() const=0;
|
// virtual void timerBlockerFalse() const=0;
|
||||||
virtual void meInAction()=0;
|
virtual void meInAction()=0;
|
||||||
|
virtual void updateMyButtonsState()=0;
|
||||||
virtual void disableMyButtons()=0;
|
virtual void disableMyButtons()=0;
|
||||||
virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0;
|
virtual void startTimeoutAnimation(int playerId, int timeoutSec) =0;
|
||||||
virtual void stopTimeoutAnimation(int playerId) =0;
|
virtual void stopTimeoutAnimation(int playerId) =0;
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ void GuiWrapper::flipHolecardsAllIn() { myW->signalFlipHolecardsAllIn(); }
|
|||||||
void GuiWrapper::nextRoundCleanGui() { myW->signalNextRoundCleanGui(); }
|
void GuiWrapper::nextRoundCleanGui() { myW->signalNextRoundCleanGui(); }
|
||||||
|
|
||||||
void GuiWrapper::meInAction() { myW->signalMeInAction(); }
|
void GuiWrapper::meInAction() { myW->signalMeInAction(); }
|
||||||
|
void GuiWrapper::updateMyButtonsState() { myW->updateMyButtonsState(); }
|
||||||
void GuiWrapper::disableMyButtons() { myW->signalDisableMyButtons(); }
|
void GuiWrapper::disableMyButtons() { myW->signalDisableMyButtons(); }
|
||||||
void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->signalStartTimeoutAnimation(playerId, timeoutSec); }
|
void GuiWrapper::startTimeoutAnimation(int playerId, int timeoutSec) { myW->signalStartTimeoutAnimation(playerId, timeoutSec); }
|
||||||
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); }
|
void GuiWrapper::stopTimeoutAnimation(int playerId) { myW->signalStopTimeoutAnimation(playerId); }
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
|
|
||||||
void meInAction();
|
void meInAction();
|
||||||
void disableMyButtons();
|
void disableMyButtons();
|
||||||
|
void updateMyButtonsState();
|
||||||
void startTimeoutAnimation(int playerId, int timeoutSec);
|
void startTimeoutAnimation(int playerId, int timeoutSec);
|
||||||
void stopTimeoutAnimation(int playerId);
|
void stopTimeoutAnimation(int playerId);
|
||||||
|
|
||||||
|
|||||||
@@ -2389,19 +2389,13 @@ void mainWindowImpl::nextPlayerAnimation() {
|
|||||||
if((*it_c)->getMyID() == currentHand->getLastPlayersTurn()) break;
|
if((*it_c)->getMyID() == currentHand->getLastPlayersTurn()) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(currentHand->getLastPlayersTurn() != -1) {
|
||||||
refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction());
|
refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction());
|
||||||
|
}
|
||||||
refreshCash();
|
refreshCash();
|
||||||
|
|
||||||
//refresh actions for human player
|
//refresh actions for human player
|
||||||
|
updateMyButtonsState();
|
||||||
if(currentHand->getLastPlayersTurn() == 0) {
|
|
||||||
myButtonsCheckable(FALSE);
|
|
||||||
clearMyButtons();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
myButtonsCheckable(TRUE);
|
|
||||||
provideMyActions();
|
|
||||||
}
|
|
||||||
|
|
||||||
nextPlayerAnimationTimer->start(nextPlayerSpeed1);
|
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() {
|
void mainWindowImpl::uncheckMyButtons() {
|
||||||
|
|
||||||
pushButton_BetRaise->setChecked(FALSE);
|
pushButton_BetRaise->setChecked(FALSE);
|
||||||
|
|||||||
@@ -310,6 +310,7 @@ public slots:
|
|||||||
|
|
||||||
void mouseOverFlipCards(bool front);
|
void mouseOverFlipCards(bool front);
|
||||||
|
|
||||||
|
void updateMyButtonsState();
|
||||||
void uncheckMyButtons();
|
void uncheckMyButtons();
|
||||||
void resetMyButtonsCheckStateMemory();
|
void resetMyButtonsCheckStateMemory();
|
||||||
void clearMyButtons();
|
void clearMyButtons();
|
||||||
|
|||||||
@@ -935,7 +935,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(actionDoneData.highestSet);
|
curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(actionDoneData.highestSet);
|
||||||
curGame->getCurrentHand()->getBoard()->collectSets();
|
curGame->getCurrentHand()->getBoard()->collectSets();
|
||||||
curGame->getCurrentHand()->switchRounds();
|
curGame->getCurrentHand()->switchRounds();
|
||||||
|
curGame->getCurrentHand()->setLastPlayersTurn(tmpPlayer->getMyID());
|
||||||
|
|
||||||
//log blinds sets after setting bigblind-button
|
//log blinds sets after setting bigblind-button
|
||||||
if (isBigBlind) {
|
if (isBigBlind) {
|
||||||
@@ -957,6 +957,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
client.GetGui().refreshSet();
|
client.GetGui().refreshSet();
|
||||||
client.GetGui().refreshCash();
|
client.GetGui().refreshCash();
|
||||||
client.GetGui().refreshButton();
|
client.GetGui().refreshButton();
|
||||||
|
client.GetGui().updateMyButtonsState();
|
||||||
}
|
}
|
||||||
else if (packet->ToNetPacketPlayersTurn())
|
else if (packet->ToNetPacketPlayersTurn())
|
||||||
{
|
{
|
||||||
@@ -1011,7 +1012,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
client.GetGui().refreshGameLabels(GAME_STATE_FLOP);
|
client.GetGui().refreshGameLabels(GAME_STATE_FLOP);
|
||||||
client.GetGui().refreshPot();
|
client.GetGui().refreshPot();
|
||||||
client.GetGui().refreshSet();
|
client.GetGui().refreshSet();
|
||||||
client.GetGui().dealFlopCards();
|
client.GetGui().dealBeRoCards(1);
|
||||||
}
|
}
|
||||||
else if (packet->ToNetPacketDealTurnCard())
|
else if (packet->ToNetPacketDealTurnCard())
|
||||||
{
|
{
|
||||||
@@ -1027,7 +1028,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
client.GetGui().refreshGameLabels(GAME_STATE_TURN);
|
client.GetGui().refreshGameLabels(GAME_STATE_TURN);
|
||||||
client.GetGui().refreshPot();
|
client.GetGui().refreshPot();
|
||||||
client.GetGui().refreshSet();
|
client.GetGui().refreshSet();
|
||||||
client.GetGui().dealTurnCard();
|
client.GetGui().dealBeRoCards(2);
|
||||||
}
|
}
|
||||||
else if (packet->ToNetPacketDealRiverCard())
|
else if (packet->ToNetPacketDealRiverCard())
|
||||||
{
|
{
|
||||||
@@ -1043,7 +1044,7 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
|||||||
client.GetGui().refreshGameLabels(GAME_STATE_RIVER);
|
client.GetGui().refreshGameLabels(GAME_STATE_RIVER);
|
||||||
client.GetGui().refreshPot();
|
client.GetGui().refreshPot();
|
||||||
client.GetGui().refreshSet();
|
client.GetGui().refreshSet();
|
||||||
client.GetGui().dealRiverCard();
|
client.GetGui().dealBeRoCards(3);
|
||||||
}
|
}
|
||||||
else if (packet->ToNetPacketAllInShowCards())
|
else if (packet->ToNetPacketAllInShowCards())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user