Difference between revisions of "Board18Market2"
(→Function itemLoaded(event): Added delayCheckForUpdate) |
(updated release notice) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ReleaseNoticeX|2.5|Design_Document_board18Market_Page}} | |||
board18Market2.js contains the BOARD18 startup functions. | board18Market2.js contains the BOARD18 startup functions. | ||
== Function makeTrays() == | |||
==Function makeTrays()== | Function makeTrays() initializes all of the tray objects. | ||
It calls the TokenSheet constructor for each mtok sheet. | It calls the TokenSheet constructor for each mtok sheet. | ||
It also adds the trayNumb to each new tray object. | It also adds the trayNumb to each new tray object. | ||
Line 8: | Line 8: | ||
BD18.trayCount to the number of tray objects. | BD18.trayCount to the number of tray objects. | ||
==Function makeMktTokenList()== | == Function makeMktTokenList()== | ||
This function initializes the BD18.marketTokens array. | This function initializes the BD18.marketTokens array. | ||
It calls the MarketToken constructor for each token in | It calls the MarketToken constructor for each token in | ||
Line 14: | Line 14: | ||
BD18.marketTokens array. | BD18.marketTokens array. | ||
==Function trayCanvasApp()== | == Function trayCanvasApp() == | ||
Function trayCanvasApp calls the trays.place() | Function trayCanvasApp calls the trays.place() | ||
method for the current token sheet object. | method for the current token sheet object. | ||
This sets up the tray Canvas. | This sets up the tray Canvas. | ||
==Function mainCanvasApp()== | == Function mainCanvasApp()== | ||
Function mainCanvasApp calls the stockMarket.place() method. | Function mainCanvasApp calls the stockMarket.place() method. | ||
This sets up the main Canvas. | This sets up the main Canvas. | ||
==Function toknCanvasApp(keepBoxSelect)== | == Function toknCanvasApp(keepBoxSelect)== | ||
Function toknCanvasApp places all existing tokens | Function toknCanvasApp places all existing tokens | ||
on the stock market using the BD18.marketTokens array. | on the stock market using the BD18.marketTokens array. | ||
==Function canvasApp()== | == Function canvasApp()== | ||
Function CanvasApp initializes all canvases. | Function CanvasApp initializes all canvases. | ||
It then calls trayCanvasApp and mainCanvasApp. | It then calls trayCanvasApp and mainCanvasApp. | ||
==Function itemLoaded(event)== | == Function itemLoaded(event) == | ||
This function is an event handler for the game box images. | This function is an event handler for the game box images. | ||
It calls makeTrays, makeBdTileList, canvasApp and | It calls makeTrays, makeBdTileList, canvasApp and | ||
delayCheckForUpdate after all itemLoaded events have occured. | delayCheckForUpdate after all itemLoaded events have occured. | ||
==Function loadBox(box)== | == Function doLink(linkURL) == | ||
The loadLinks function is called by the <li> statements | |||
which are created by the loadLinks function below. | |||
== Function loadLinks(newLinks) == | |||
The loadLinks function is called by loadBox and getLinks | |||
functions to add game links to the "Useful Links" sub-menu. | |||
== Function loadBox(box) == | |||
The loadBox function is a callback function for | The loadBox function is a callback function for | ||
the gameBox.php getJSON function. | the gameBox.php getJSON function. | ||
It loads all the game box images. | It loads all the game box images. | ||
==Function loadSession(session)== | == Function loadSession(session) == | ||
The loadSession function is a callback function for | The loadSession function is a callback function for | ||
the gameSession.php getJSON function. It finds and | the gameSession.php getJSON function. It finds and | ||
loads the game box file. | loads the game box file. |
Latest revision as of 08:02, 28 July 2017
This page has been updated to comply with Release 2.5.x of BOARD18. | Go Back |
board18Market2.js contains the BOARD18 startup functions.
Function makeTrays()
Function makeTrays() initializes all of the tray objects. It calls the TokenSheet constructor for each mtok sheet. It also adds the trayNumb to each new tray object. Finally it initializes BD18.curTrayNumb to 0 and BD18.trayCount to the number of tray objects.
Function makeMktTokenList()
This function initializes the BD18.marketTokens array. It calls the MarketToken constructor for each token in BD18.gm.mktTks array and adds the new object to the BD18.marketTokens array.
Function trayCanvasApp()
Function trayCanvasApp calls the trays.place() method for the current token sheet object. This sets up the tray Canvas.
Function mainCanvasApp()
Function mainCanvasApp calls the stockMarket.place() method. This sets up the main Canvas.
Function toknCanvasApp(keepBoxSelect)
Function toknCanvasApp places all existing tokens on the stock market using the BD18.marketTokens array.
Function canvasApp()
Function CanvasApp initializes all canvases. It then calls trayCanvasApp and mainCanvasApp.
Function itemLoaded(event)
This function is an event handler for the game box images. It calls makeTrays, makeBdTileList, canvasApp and delayCheckForUpdate after all itemLoaded events have occured.
Function doLink(linkURL)
The loadLinks function is called by the
Function loadLinks(newLinks)
The loadLinks function is called by loadBox and getLinks functions to add game links to the "Useful Links" sub-menu.
Function loadBox(box)
The loadBox function is a callback function for the gameBox.php getJSON function. It loads all the game box images.
Function loadSession(session)
The loadSession function is a callback function for the gameSession.php getJSON function. It finds and loads the game box file.