1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- Config.macros.ifAssignmentError = false;
- Config.navigation.override = function (dest) {
- /*if(tags(dest).includes('hasEvents')){
- State.variables.isEventPassage = true;
- State.variables.eventReturnPassage = dest;
- return dest+'_events';
- }
- return false;*/
- const tagsWithEvents = ['indoors','outdoors','interruptible'];
- const tagsWithCustomEventHandling = ['dynamicHousing'];
- if(tags(dest).includesAny(tagsWithEvents) && !tags(dest).includesAny(tagsWithCustomEventHandling)){
- State.variables.eventReturnPassage = dest;
- return 'event';
- }
- };
- Config.passages.nobr = true; //vgl. https://www.motoslave.net/sugarcube/2/docs/#config-api-property-passages-nobr
- Config.history.maxStates = 3;
- Config.saves.isAllowed = function () {
- if(tags().includes("noSave"))
- return false;
- return true;
- };
- Save.onLoad.add(function (save) {
- console.log("Loading savegame",save);
- let saveVars = save.state.history.last().variables;
- setup.settingsApply(saveVars.settings);
- });
- setup.settingsApply = function(settings){
- console.warn('Aplly settings',settings);
- switch(settings.autosave){
- case 'ALWAYS':
- Config.saves.autosave = true;
- break;
- case 'AWAKE':
- Config.saves.autosave = ['sleepAwake','autosave'];
- break;
- case 'NONE':
- Config.saves.autosave = false;
- break;
- }
- switch(settings.ui?.sidebarRight){
- case true:
- $("#ui-bar").addClass("uiBarRight");
- break;
- default:
- break;
- }
- if(settings.ui?.css)
- importStyles(settings.ui?.css.split("\n"));
- }
|