Does anyone know if it's possible to call the save menu in Sugarcube? I'd like to replicate whatever javascript function occurs when the user clicks 'Saves' on the Sugarcube sidebar.


Such that when these options are selected the window pops up. I was hoping to kind of find it in the header. I found a click handler for the saves link that runs the UISystem.buildSaves() function, but that doesn't seem to be everything. It's possible that there is no callable function for this. If I'm out of luck that's okay. Just curious.
Comments
Here's the public API for the SaveSystem: There are several configuration options for saves (from config.saves.autosave to config.saves.slots).
There's currently no method built into SaveSystem which allows you to access the title and datestamp for a given save slot (which is something I should rectify). If you wanted access to those, then you'll have to load the saves object from storage yourself (this is the way that UISystem currently does it). Doing so would look something like this: (not including some safety boilerplate that you probably don't need) [EDIT] Updated the SaveSystem public API docs above.
You continue to be a huge help.
Working great so far! But I'm having some trouble using SaveSystem.save. It throws errors. Is this the correct way to use it? Even if I use variables and not the quotes for a string, I get: EDIT: Nevermind. I just missed the obvious typo in your post. Working totally fine now.
Drop the square-brackets, they're notational.
Assuming you mean the square-brackets, they're not a typo, they're a notation for denoting optional parameters.
The UISystem "library" consists of two methods at this point (well, there are several others, but they aren't meant to be public). The API looks like this: * Note: You can select multiple elements this way, so ensure that you use the proper selector.
You should always specify a target and (likely) a startFunc (which is what should populate the dialog container, #ui-body).
As an example, this is how you might setup a dialog: Technically, there's no reason you couldn't just make startFunc completely anonymous, which would make the call to addClickHandler() look like this: Basically, your startFunc should:
[list type=decimal]
Select the dialog container (#ui-body)
Ensure that any previous contents are gone from it
Add a class to it for selection purposes (e.g. in your CSS, #ui-body.stats { })
Add your content to it (and you don't have to wikify it either, build its contents however you want)