0 votes
asked by (250 points)
closed by
This one should be fairly easy to answer, but my google-fu has failed me thus far.

Is there a way to force the StoryMenu sidebar to update WITHOUT changing passages? I have a "Spellbook" popup link that I want to keep hidden until the player knows at least one spell, and the logic works just fine, but right now it requires a passage change to display. Since the event that causes a spell to be learned also originates in a popup menu, this is a problem.

I tried using a simple span and replace method, but it throws errors and hides elements I don't want hidden  - I'm presuming that such behavior is born out of the link-only nature of StoryMenu.
closed with the note: Question answered.

1 Answer

+1 vote
answered by (59.9k points)
selected by
 
Best answer

You can use the UIBar.setStoryElements() method: 

<<link "Change stuff">>
    /% change a variable that has an <<if>> in the StoryMenu %/
    <<run UIBar.setStoryElements()>>
<</link>>

 

commented by (250 points)
<<run UIBar.setStoryElements()>>

This is exactly what I needed, thanks!

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.
...