Class: SaveManager
Defined in: adventure/SaveManager.js, line 10
Todos: Save to adventurejs.com web server.
SaveManager manages the job of saving games. It contains all the methods needed to create the Save pop-up screen. SaveManager can save a game to a local save file, to browser cookies, or to the adventurejs.com web server.
SaveManager is created automatically by Game. This is an internal class that authors should not need to construct or modify. However, if you'd like to try, you can find styles for the Save & Restore pop-ups in adventurejs.css. All relevant styles are prefixed with '.save_' or '.restore_'.
Private Constructor:
var foo = new adventurejs.SaveManager(game)
Parameters:
-
game
Game
A reference to the game instance.
- Index
- Methods
- Properties
Index
Methods Collapse all |
clickButton_Browser()
Defined in: adventure/SaveManager.js, line 566
Player can name their save however they want. However, we always prepend the game name because local storage applies to all pages on a given domain, meaning that all saves for all games played at, i.e., adventurejs.com will be saved in the same local storage. And, local storage appears not to have any method for nesting data, so we can't have a parent object or 'folder'. Instead, we need to name them in such a way that we can identify them by game.
clickButton_Close()
Defined in: adventure/SaveManager.js, line 512
clickButton_Server()
clickSaveButton_File()
closeDisplay()
Defined in: adventure/SaveManager.js, line 498
openDisplay()
Defined in: adventure/SaveManager.js, line 477
sanitizeInputFileName()
Defined in: adventure/SaveManager.js, line 639
selectTab()
Defined in: adventure/SaveManager.js, line 659
set(props) → {adventurejs.SaveManager}
Defined in: adventure/SaveManager.js, line 678
Parameters:
-
props
Object
A generic object containing properties to copy to the DisplayObject instance.
Returns:
adventurejs.SaveManager
Returns the instance the method is called on (useful for chaining calls.)
Properties |
game :Object
Defined in: adventure/SaveManager.js, line 37
Default value: {}
restoreClose :HTMLElement
Defined in: adventure/SaveManager.js, line 89
Default value: {}
saveButtons :Array
Defined in: adventure/SaveManager.js, line 60
Default value: []
saveDisplayTitle :HTMLElement
Defined in: adventure/SaveManager.js, line 109
Default value: {}
savePane_Browser :HTMLElement
Defined in: adventure/SaveManager.js, line 350
Default value: {}
savePane_File :HTMLElement
Defined in: adventure/SaveManager.js, line 248
Default value: {}
savePane_Server :HTMLElement
Defined in: adventure/SaveManager.js, line 419
Default value: {}
savePanes :Array
Defined in: adventure/SaveManager.js, line 52
Default value: []
saveRowInput :HTMLElement
Defined in: adventure/SaveManager.js, line 122
Default value: {}
saveRowPanes :HTMLElement
saveRowTabs :HTMLElement
Defined in: adventure/SaveManager.js, line 152
Default value: {}
saveTab_Browser :HTMLElement
Defined in: adventure/SaveManager.js, line 188
Default value: {}
saveTab_File :HTMLElement
Defined in: adventure/SaveManager.js, line 164
Default value: {}
saveTab_Server :HTMLElement
Defined in: adventure/SaveManager.js, line 212
Default value: {}
saveTabs :Array
Defined in: adventure/SaveManager.js, line 44
Default value: []