Skip to content

ccdirectlink3/CCRestartButton

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCRestartButton

Adds a button to restart Cross Code without memory leaks.

Install

Install CCLoader.

Download a release and unpack into the CCLoader mods folder.

To keep the window in the same location after restarting add the option "id": "CrossCode" to the "window" object in CrossCode's package.json.

Usage

Press L to restart the game. This can be configured at the bottom of the Controls tab.

API

This was designed for my other mod CCTAS (not released yet), though other modders are free to use it and submit issues for extensions.

API is stored in window.restartButton.

addListener(listener)

Adds a listener to be called before restarting the game, either by api or keypress. For example to write data to localstorage to be read back after the game has restarted.

  • listener : function - The listener to run, is not given any parameters and the return value is ignored.

restart([skipListeners])

Programatically restart the game instead of requiring the user to press a button.

  • skipListeners : boolean - If true listeners will not be run, as if the user had manually closed and restarted the game. Defaults to false.
  • Does not return.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%