https://hu.doc.boardgamearena.com/index.php?title=Game_interface_logic_(yourgamename.js)&feed=atom&action=historyGame interface logic (yourgamename.js) - Laptörténet2024-03-29T15:42:54ZAz oldal laptörténete a wikibenMediaWiki 1.39.0https://hu.doc.boardgamearena.com/index.php?title=Game_interface_logic_(yourgamename.js)&diff=449&oldid=prevSourisdudesert: Created page with "== Client side (Javascript functions) == ; this.player_id : Id of the player on whose browser the code is running. ; this.isSpectator : Flag set to true if the user at the t..."2013-01-05T10:16:36Z<p>Created page with "== Client side (Javascript functions) == ; this.player_id : Id of the player on whose browser the code is running. ; this.isSpectator : Flag set to true if the user at the t..."</p>
<p><b>Új lap</b></p><div>== Client side (Javascript functions) ==<br />
<br />
; this.player_id<br />
: Id of the player on whose browser the code is running.<br />
<br />
; this.isSpectator<br />
: Flag set to true if the user at the table is a spectator (not a player).<br />
<br />
; this.gamedatas<br />
: Contains your initial set of datas to init the game, created at game start or game refresh (F5)<br />
: You can update it as needed to keep an up to date reference of the game on the client side.<br />
<br />
; slideToObject: function( mobile_obj, target_obj, duration, delay )<br />
: Return an dojo.fx animation that is sliding a DOM object from its current position over another one<br />
: Animate a slide of the DOM object referred to by domNodeToSlide from its current position to the xpos, ypos relative to the object referred to by domNodeToSlideTo.<br />
<br />
; slideToObjectPos: function( mobile_obj, target_obj, target_x, target_y, duration, delay )<br />
: Return an dojo.fx animation that is sliding a DOM object from its current position over another one at the given coordinates relative to the target object.<br />
<br />
; updateCounters(counters)<br />
: Useful for updating game counters in the player panel (such as resources). <br />
: 'counters' arg is an associative array [counter_name_value => [ 'counter_name' => counter_name_value, 'counter_value' => counter_value_value], ... ]<br />
: All counters must be referenced in this.gamedatas.counters and will be updated.<br />
: DOM objects referenced by 'counter_name' will have their innerHTML updated with 'counter_value'.<br />
<br />
; addTooltip( node, _( helpString ), _( actionString ), delay );<br />
: Add a simple text tooltip to the DOM node. Only one of 'helpString' or 'actionString' must be used. _() must be used for the text to be marked for translation.<br />
<br />
; addTooltipHtml( node, html, delay );<br />
: Add an HTML tooltip to the DOM node (for more elaborate content such as presenting a bigger version of a card).<br />
<br />
; addTooltipToClass( cssClass, _( helpString ), _( actionString ), delay );<br />
: Add a simple text tooltip to all the DOM nodes set with this cssClass. Only one of 'helpString' or 'actionString' must be used. _() must be used for the text to be marked for translation.<br />
: NB: all concerned nodes must have IDs to get tooltips<br />
<br />
; addTooltipHtmlToClass( cssClass, html, delay );<br />
: Add an HTML tooltip to to all the DOM nodes set with this cssClass (for more elaborate content such as presenting a bigger version of a card).<br />
: NB: all concerned nodes must have IDs to get tooltips<br />
<br />
; addEventToClass: function( cssClassName, eventName, functionName )<br />
: Same as dojo.connect(), but for all the nodes set with the specified cssClassName<br />
<br />
; addStyleToClass: function( cssClassName, cssProperty, propertyValue )<br />
: Same as dojo.style(), but for all the nodes set with the specified cssClassName<br />
<br />
; isCurrentPlayerActive()<br />
: Returns true if the player on whose browser the code is running is currently active (it's his turn to play)<br />
<br />
; checkAction: function( action, nomessage )<br />
: Check if player can do the specified action by taking into account: _ current game state & _ interface locking<br />
: return true if action is authorized<br />
: return false and display an error message if not (display no message if nomessage is specified)<br />
<br />
; showMessage: function( msg, type )<br />
: Show an information message during a few seconds at the top of the page<br />
: Type can be 'error' or 'info'<br />
<br />
; this.scoreCtrl[ player_id ].incValue( score_delta );<br />
: Adds score_delta (positive or negative integer) to the current score value for player</div>Sourisdudesert