0 votes
by (370 points)
Well the question tells it all

2 Answers

0 votes
by (6.2k points)
Do you mean having a button in the header or something and bringing up a screen with all the characters stats?
by (370 points)
yes,but i want a smaller screen which appears on top of the main screen
+1 vote
by (159k points)

If you are asking how to add a menu item to the left side-bar that opens a passage that displays the characters stats then you can do that by adding the StoryMenu special passage to your project and place a link to your Stats passage in it.

[[Stats]]


You have two options when it comes to exiitng your Stats passage, you can either use the Undo navigator button found at the top of the left sode-bar or you can include a "Return" link in your Stats passage.

If you choose to add a "Return" link then you will likely want that link to always return the reader to the last non-menu related passage they were viewing. To do this you will need to do the following.

1. Edit your Stats passage and assign it a menu Passage Tag, then add the following link to the content of the passage.

<<link "Return" $return>><</link>>


2. Add the following code to your project's Story Javascript area, it updates a $returns story variable if the current passage being shown doesn't include a menu passage tag.

predisplay['set-return'] = function (taskName) {
	if (!tags().includes('menu')) {
		State.variables.return = State.passage;
	}
};


3. If you add other menu related passage to your project then you will need to also assign them a menu passage tag.

...