manonamora / SugarCube-Guide

What the title says. It's a Guide for Twine-SugarCube. Up to date for v.2.37.3
2 stars 0 forks source link

Code update (not breaks but maybe in future update it might be) #9

Open manonamora opened 1 week ago

manonamora commented 1 week ago
$(document).on(':passagestart', function (ev) {
        if (!ev.passage.tags.includes('noreturn')) {
            State.variables.return = ev.passage.title;
        }
    });

should be name and not title

manonamora commented 1 week ago
You can also modify the number of autosave slots available for players with:

    Config.saves.maxAutoSaves = 4;
}}} 

the space after }}} breaks the formatting

manonamora commented 1 week ago

SAVE ON SAVE

Save.onSave.add(function (save) {
    switch (save.type) {
        case Save.Type.Auto: {
            /* code to process an auto save object before it's saved */
            break;
        }

        case Save.Type.Base64: {
            /* code to process a base64 save object before it's saved */
            break;
        }

        case Save.Type.Disk: {
            /* code to process a disk save object before it's saved */
            break;
        }

        case Save.Type.Slot: {
            /* code to process a slot save object before it's saved */
            break;
        }
    }
});