I've been using the add clickhandler function to make my own save, restart, and options buttons. With the new update to Sugarcube, the clickhandler functions don't seem to work anymore. It gives an error message saying that there was a Type error, undefined is not a function. It worked perfectly before, so I'm guessing that now there's a new way to write this, but I don't know what it is.
The old code I was using is
$("body").append("<button id='save-sub'>Save/Load</button>");
UISystem.addClickHandler("#save-sub", null, function () { UISystem.buildSaves(); });
$("body").append("<button id='restart-sub'>Restart</button>");
UISystem.addClickHandler("#restart-sub", null, function () { UISystem.buildRestart(); });
$("body").append("<button id='sound-sub'>Sound</button>");
UISystem.addClickHandler("#sound-sub", null, function () { UISystem.buildOptions(); });
Comments
UISystem.build()
static methods had their names altered. The new names follow the formUISystem.buildDialog()
(e.g.UISystem.buildDialogSaves()
).Beyond that, I'm not sure if your above example is your exact code or not, however, you don't need (or really want) three jQuery calls to do (essentially) one thing. You might be better served by something like this: