Displaying/Hiding Save Buttons

Twine Version: 2.3.9
Story Format: SugarCube 2.31.1

I’m trying to create checkpoints in my game, and I’m doing so by showing/hiding the Save button at certain points. I currently have it set up like this:

body.nosave #menu-item-saves{
	display: none;
}

This means that if tag a passage with nosave, it will hide the save button, and if I tag it with nothing, you can save. Every time I try to do something like:

body #menu-item-saves {
        display: none;
}
body.checkpoint #menu-item-saves {
        display;
}

It ignores the checkpoint tag and stays hidden. What I would like to know is if there is a way to hide the save button permanently, except for when I tag a passage with checkpoint.

For what you want, you can just put this in your Stylesheet section:

#menu-item-saves {
    display: none;
}
#menu li:nth-child(2) {
    border-top: none;
}
.checkpoint #menu-item-saves {
	display: list-item;
}
.checkpoint #menu li:nth-child(2) {
    border-top: 1px solid #444;
}

Now your story will only display the “SAVES” button in passages with a “checkpoint” tag.

Note that all CSS properties need a value, so you can’t just do “display;”, you have to do something like “display: block;” or “display: list-item;”. Using bad CSS code in your Stylesheet section can break your CSS so that styles set after that broken code will be ignored, so you should be careful to make sure all of the CSS in your Stylesheet section is valid.

Enjoy! :grinning: