Skip to content

Instantly share code, notes, and snippets.

@kyrathasoft
Created April 27, 2025 00:26
Show Gist options
  • Save kyrathasoft/614adce9a8ff332637021a8b67a557bb to your computer and use it in GitHub Desktop.
Save kyrathasoft/614adce9a8ff332637021a8b67a557bb to your computer and use it in GitHub Desktop.
The Arbitrarily Long Return function for use in Sugarcube
/* Trigger the following code at the start of navigation to a new passage. */
$(document).on(":passagestart", function (event) {
/* Make sure the current passage doesn't have a "noreturn" tag. */
if (!tags().includes("noreturn")) {
/* If it doesn't, then set $return to the current passage name. */
State.variables.return = passage();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment