diff --git a/source/client/panels/MainGamePanel.cpp b/source/client/panels/MainGamePanel.cpp index 3a37a8d3dbedc49f5c2c65c63d9e2b925ef80277..2c6b19576bdc98c072bd782698c9f8da5deb4be0 100644 --- a/source/client/panels/MainGamePanel.cpp +++ b/source/client/panels/MainGamePanel.cpp @@ -46,9 +46,12 @@ void MainGamePanel::buildGameState(game_state* gameState, player* me) { // this->buildOtherPlayerLabels(gameState, otherPlayer, playerAngle, side); } - // show our own player - if(!me->is_broke()){ - this->buildThisPlayer(gameState, me); + bool am_broke = me->get_money() + me->get_bet_size() < gameState->_min_bet; + if (!am_broke) { + // show our own player + this->buildThisPlayer(gameState, me); + } else { + this->buildThisPlayerBroke(); } // show the number of rounds @@ -177,8 +180,8 @@ void MainGamePanel::buildOthers(game_state* gameState, player* otherPlayer, doub int numberOfCards = otherPlayer->get_hand()->get_nof_cards(); std::string cardImage; - wxSize weirdSize(90, 90); - // weirdSize = boundsOfRotatedHand; + wxSize weirdSize(76, 90); + //weirdSize = boundsOfRotatedHand; double cAngle = playerAngle + MainGamePanel::twoPi/4; int cDist = MainGamePanel::otherPlayerHandSize; wxSize card_dist((int)(sin(cAngle)*cDist), (int)(cos(cAngle) * cDist)); @@ -396,6 +399,17 @@ void MainGamePanel::buildThisPlayer(game_state* gameState, player* me) { } } +void MainGamePanel::buildThisPlayerBroke(){ + wxBoxSizer* outerLayout = new wxBoxSizer(wxHORIZONTAL); + this->SetSizer(outerLayout); + //Display text to tell player he has lost + wxPoint Offset(-100, 200); + wxPoint textPosition = MainGamePanel::tableCenter + Offset; + wxStaticText *playerName = + buildStaticText("You are broke :(", textPosition, wxSize(400, 36), + wxALIGN_CENTER, true); +} + void MainGamePanel::buildRoundCounter(game_state* gameState){ if(gameState->is_started() && gameState->get_current_player() != nullptr) { diff --git a/source/client/panels/MainGamePanel.hpp b/source/client/panels/MainGamePanel.hpp index d3fc853a1f39e733defac834ab51d691f4e9042e..fecf1dc0e15e5a3091a1c03e60ea671a55ebe804 100644 --- a/source/client/panels/MainGamePanel.hpp +++ b/source/client/panels/MainGamePanel.hpp @@ -19,7 +19,8 @@ private: //void buildGameController(); //change this from sds void buildRoundCounter(game_state* gameState); void buildThisPlayer(game_state* gameState, player* me); //in sds this is build myself - void buildShoe(game_state* gameState); + void buildThisPlayerBroke(); + void buildShoe(game_state *gameState); void buildDealer(game_state*); void buildCardPiles(game_state* gameState, player *me); @@ -36,7 +37,7 @@ private: wxSize const cardSize = wxSize(80, 124); - double const otherPlayerHandSize = 140.0; // smaller? + double const otherPlayerHandSize = 130; // smaller? double const otherPlayerBetDistanceFromCenter = 80.0; double const otherPlayerHandDistanceFromCenter = 180.0;