0 votes
by (2.3k points)

So I'm trying to get my detailed inventory screen to work now. The link from the inventory UI to it is fine, but trying to make it go back to the previous page for players to navigate easily is a bit tricky.

Inventory:
[[Inventory Details]]
<<nobr>>
<ul>

*/Inventory details*/
	
<</for>>
</ul>
<</nobr>>

I've tried using the $previousPassage command but that doesn't seem to be working...
Inventory  Details Passage:

[[$previousPassage]]

 

2 Answers

0 votes
by (23.6k points)

You should always provide the storyformat you're using. I'll just assume you're working with some version of sugarcube 2.

In that case previous() will return the name of the most previous passage.

[[Return|previous()]]

 

0 votes
by (159k points)

If you are planning on having multiple 'menu' like passages (like your Inventory one) then you may want to consider implementing this answer supplied by TheMadExile. Once setup It automatically tracks the last non-menu passage viewed by the Reader and then allows them to return to it from any 'menu' related passage.

by (44.7k points)

You can also find that information in the "Guide: Tips" section of the SugarCube documentation.

by (2.3k points)
Thanks for that, it has helped greatly.
...