From a1c07dccbae02ae3663cb30bed875cfe904587a6 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Tue, 15 Nov 2011 20:56:02 -0800 Subject: LAYOUT: redone layout of table and cards scales a lot better now and should be better for mobile devices --- include/game.php | 217 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 125 insertions(+), 92 deletions(-) (limited to 'include/game.php') diff --git a/include/game.php b/include/game.php index c78482c..621b0b0 100644 --- a/include/game.php +++ b/include/game.php @@ -330,6 +330,103 @@ if($mystatus!='gameover') if(isset($_SESSION['id'])) DB_update_user_timestamp($_SESSION['id']); + +/****************************************************************************** + * Output menu for selecting tricks + ******************************************************************************/ + +switch($mystatus) + { + case 'start': + break; + case 'init': + case 'check': + /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ + echo "\n\n"; /* end div trick, end li trick , end tricks*/ + /* end displaying sickness */ + break; + case 'poverty': + /* output pre-game trick in case user reloads, + * only needs to be done when a team has been formed */ + if($myparty=='re' || $myparty=='contra') + { + echo "\n\n\n"; /* end div trick, end li trick , end ul tricks */ + } + /* end output pre-game trick */ + break; + case 'play': + case 'gameover': + + echo "\n\n\n"; + + break; + default: + } + + /****************************************************************************** * Output tricks played, table, messages, and cards (depending on game status) ******************************************************************************/ @@ -338,7 +435,7 @@ if($mystatus!='gameover') echo "
\n"; /* display the table and the names */ -display_table(); +display_table_begin(); /* mystatus gets the player through the different stages of a game. * start: does the player want to play? @@ -361,6 +458,7 @@ $cards_status = CARDS_EMPTY; */ $messages = array(); + switch($mystatus) { case 'start': @@ -428,28 +526,6 @@ switch($mystatus) ***************************/ if(!myisset('solo','wedding','poverty','nines','lowtrump') ) { - /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ - echo "\n\n"; /* end div trick, end li trick , end tricks*/ - /* end displaying sickness */ - $mycards = DB_get_hand($me); output_check_for_sickness($me,$mycards); @@ -546,28 +622,6 @@ switch($mystatus) * this can therefore only be handled once all players finished the last stage */ - /* output sickness of other playes, in case they already selected and are sitting in front of the current player */ - echo "\n\n"; /* end div trick, end li trick , end tricks*/ - /* end displaying sickness */ - $messages[] = _('Checking if someone else selected solo, nines, wedding or poverty.'); /* check if everyone has reached this stage */ @@ -879,24 +933,6 @@ switch($mystatus) }; } - /* output pre-game trick in case user reloads, - * only needs to be done when a team has been formed */ - if($myparty=='re' || $myparty=='contra') - { - echo "\n\n\n"; /* end div trick, end li trick , end ul tricks */ - } - /* end output pre-game trick */ - /* get hand */ $mycards = DB_get_hand($me); @@ -1270,7 +1306,7 @@ switch($mystatus) $pos = DB_get_startplayer_by_gameid($gameid)-1; $firstcard = ''; /* first card in a trick */ - echo "\n\n"; /* end ul tricks*/ + echo "\n"; /* end ul tricks*/ if($myturn && !myisset('card') && $mystatus=='play' ) { @@ -1987,6 +2017,9 @@ switch($mystatus) myerror("error in testing the status"); } /*end of output: tricks, table, messages, card */ +/* display the 2nd half of table and the names */ +display_table_end(); + /************** * show cards * **************/ -- cgit v1.2.3-18-g5258