Hello
I need some help because I am really struggling with CSS and TPL.
I have a panel {mahjong} with numbers from 2 to 14. When a player selects and validates one, a tiny number should appear in his player's panel.
first of all, the code for the mahjong panel :
TPL
JS
The panel is displayed but all elements are displayed vertically. They are well displayed (horizontally) with F5 or F12.
How can I solve this ?
Next step.
When I click on a value and validate, I would like to have a tiny number appearing in the player's panel.
I AJAXe to PHP the value clicked and notifies back.
PHP
JS
Can I use the mahjongValues Stock and display a tiny sprite (the original one is 70 * 105 and the tiny should be 22 * 32) ?
If not, can I use the tichu-icons-table.png anyway or do I have to create a tichu-icons-panel.png ?
And last, how can I display that in any case ?
I need some help because I am really struggling with CSS and TPL.
I have a panel {mahjong} with numbers from 2 to 14. When a player selects and validates one, a tiny number should appear in his player's panel.
first of all, the code for the mahjong panel :
TPL
Code: Select all
<div id="mahjong" class="whiteblock" style="display:none;">
<h3>{LB_MAHJONG}:</h3>
</div>Code: Select all
setup
this.mahjongValues = new ebg.stock();
this.mahjongValues.create( this, $('mahjong'), this.mahjongwidth, this.mahjongheight );
this.mahjongValues.setSelectionMode( 1 );
dojo.connect( this.mahjongValues, 'onChangeSelection', this, 'onMahjongValuesSelectionChanged' );
this.mahjongValues.image_items_per_row = 7; // 7 images per row
for( var value=0; value<=13; value++ )
{ // Build card type id
this.mahjongValues.addItemType( value, value, g_gamethemeurl+'img/tichu-icons-table.png', value );
this.mahjongValues.addToStockWithId(value, value);
onEnteringState: function( stateName, args )
{
case 'firstTrick':
if( this.isCurrentPlayerActive() )
{
dojo.style( $('mahjong'), 'display', 'block' );
}
this.playerHand.unselectAll();
break;
How can I solve this ?
Next step.
When I click on a value and validate, I would like to have a tiny number appearing in the player's panel.
I AJAXe to PHP the value clicked and notifies back.
PHP
Code: Select all
self::notifyAllPlayers( 'wishMade', $notification_description, array(
'player_id' => self::getActivePlayerId(),
'player_name' => self::getActivePlayerName(),
'value_wished' => $valueWished,Code: Select all
notif_wishMade: function( notif )
{
dojo.style( $('mahjong'), 'display', 'none' );
???
},If not, can I use the tichu-icons-table.png anyway or do I have to create a tichu-icons-panel.png ?
And last, how can I display that in any case ?