0 votes
by (200 points)
I know there are built in forward/back buttons, or technically "undo" and "redo". I plan to get rid of these but I'd like to be able to manually add in a back/undo link on a few certain passages. Is there a way I can do this?

1 Answer

+1 vote
by (154k points)
selected by
Best answer

1. You can use the (link-undo:) macro to simulate the side-bar's Undo link

(link-undo: "Undo")

...however there isn't a macro equivalent for the side-bar's Redo link.

2. Depending on how you disabled / hid the side-bar's Undo & Redo links it may be possible to use JavaScript to send a click event to them.

(link: "Undo")[<script>$('tw-sidebar tw-icon.undo:not([style*="hidden"])').click()</script>]

(link: "Redo")[<script>$('tw-sidebar tw-icon.redo:not([style*="hidden"])').click()</script>]

...however there is no easy way to know when an Undo event has occured, which makes it difficult to know when to show your custom Redo link.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.