Extension

How to extend the Customizer

A directory named terrain.png, which contains the texture sheets(Yes, it is ends with .png, but is a directory)

A big JSON tree, containing the preferences and their options

If you want to replace the whole texture pack and rewrite the options, you have to do the following:

Replace the contents of the terrain.png-directory with the alternative terrain.pngs you want to use. Rename them sensibly in the process, e.g. “v4.0.png” and “tweaks.png”.

Replace the list of versions in the JavaScript with yours – minus the .png – e.g. var versions = ["v4.0", "tweaks"];. The last version in the list is initially drawn and it’s options selected.Note that if you use plain numbers truncateable to integers, like 4.0, JavaScript will truncate them (in our example to 4). Use Strings ("4.0"), or already truncated numbers (4) in this case.

Now recreate the settings. var settings is assigned to a JSON tree with the following structure:

1. Level: settings

Each setting appears under the name it was assigned to

There is a special (optional!) setting called override with the single option pack, which is used to override certain parts of the initially drawn texture.

2. Level: options

Each of these refers to one of the versions registered via the versions list.

A special option called coords instead contains a list of texture coordinates.

3. Level (inside each coords option): coordinates

Coordinates are in the form [x,y], so e.g. [0,15] refers to the texture on the bottom of the first column (start of break animation).