Changeset aac3b2b for components


Ignore:
Timestamp:
07/07/22 23:53:57 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
95ce58b
Parents:
189cd8f
Message:

Fixes to poker functionality

Location:
components/poker/sections
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • components/poker/sections/Messages.jsx

    r189cd8f raac3b2b  
    2424    return (
    2525        <div className="pokerMessagesContainer">
    26             { playerState.pokerGame.table.started && playerState.pokerGame.table.ended && playerState.pokerGame.table.winners.length === 1 && <p>Game over - {playerState.pokerGame.table.winners[0]?.displayName} won ${playerState.pokerGame.table.winners[0]?.wonAmount} with a {playerState.pokerGame.table.winners[0]?.hand?.hand} combination! Congratulations.</p> }
    27             { playerState.pokerGame.table.started && playerState.pokerGame.table.ended && playerState.pokerGame.table.winners.length > 1 && <p>Game over - {playerState.pokerGame.table.winners.map(e=>e.displayName).join(", ")} drew!</p> }
    28             { playerState.pokerGame.table.started && playerState.pokerGame.table.ended && <p>New game will start soon.</p> }
     26            { playerState.pokerGame.table.ended && playerState.pokerGame.table.onlyOnePlayerLeft && <p>Game over - {playerState.pokerGame.table.winners[0]?.displayName} won ${playerState.pokerGame.table.winners[0]?.wonAmount} because everyone else folded! Congratulations.</p> }
     27            { playerState.pokerGame.table.ended && !playerState.pokerGame.table.onlyOnePlayerLeft && playerState.pokerGame.table.winners.length === 1 && <p>Game over - {playerState.pokerGame.table.winners[0]?.displayName} won ${playerState.pokerGame.table.winners[0]?.wonAmount} with a {playerState.pokerGame.table.winners[0]?.hand?.hand} combination! Congratulations.</p> }
     28            { playerState.pokerGame.table.ended && playerState.pokerGame.table.winners.length > 1 && <p>Game over - {playerState.pokerGame.table.winners.map(e=>e.displayName).join(", ")} drew!</p> }
     29            { playerState.pokerGame.table.ended && <p>New game will start soon.</p> }
    2930
    3031            { playerState.pokerGame.table.started && !playerState.pokerGame.table.ended && <p>Round {playerState.pokerGame.table.round}/4{roundMessage}</p> }
    31             { !playerState.pokerGame.table.started && <p>Waiting for coordinator {playerState.pokerGame.table.creator} to start the game.</p> }
     32            { !playerState.pokerGame.table.started && !playerState.pokerGame.table.ended && <p>Waiting for coordinator {playerState.pokerGame.table.creator} to start the game.</p> }
    3233            { playerState.pokerGame.table.started && !playerState.pokerGame.table.ended && <p>{turnMessage}</p> }
    3334            { playerState.pokerGame.table.started && !playerState.pokerGame.table.ended && <p>{callMessage}</p> }
  • components/poker/sections/PickATable.jsx

    r189cd8f raac3b2b  
    4949                <h3>Pick a table:</h3>
    5050                <div onClick={(e) => joinATable(e)}>
    51                     {playerState.pokerGame.tables.map(table => (
     51                    {playerState.pokerGame.tables.filter(table=>table.started===false).map(table => (
    5252                        <div data-table={table.id} key={table.id}>
    5353                            <p data-table={table.id}>Table name: {table.name}</p>
    5454                            <p data-table={table.id}>Creator: {table.creator}</p>
    55                             <p data-table={table.id}>Players: {table.players.length}/8</p>
     55                            <p data-table={table.id}>Players: {table.players.filter(e=>e.isGhost===false).length}/8</p>
    5656                            <p data-table={table.id}>Join</p>
    5757                        </div>
  • components/poker/sections/PlayButtons.jsx

    r189cd8f raac3b2b  
    6060    return (
    6161      <div className="pokerPlayButtonsContainer">
    62         {!playerState.pokerGame.table.started && playerState.pokerGame.player.isCoordinator && playerState.pokerGame.player.isSatDown && <button className="secondaryButton" onClick={() => startGame()}>Start game</button>}
     62        {!playerState.pokerGame.table.started && !playerState.pokerGame.table.ended && playerState.pokerGame.player.isCoordinator && playerState.pokerGame.player.isSatDown && <button className="secondaryButton" onClick={() => startGame()}>Start game</button>}
    6363        {!playerState.pokerGame.table.started && !playerState.pokerGame.player.isSatDown && <button className="secondaryButton" onClick={() => sitDown()}>Take a seat</button>}
    6464      </div>
Note: See TracChangeset for help on using the changeset viewer.