Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How do I use the feature of SugarCube when I have history disabled?

I'm showing some information page to the user that has a back button once they're done reading it. The problem is, I intentionally disabled history via config.disableHistoryTracking. Because of that, <<back>> is having problems saying the passage doesn't exist. With SugarCane, I was using [[Back|previous()]] and it's working even with history disabled. How do I achieve the same with SugarCube?

Comments

  • You seem to be confusing config.disableHistoryControls and config.disableHistoryTracking.  Unless I'm suffering an error of memory, the former is like the vanilla headers' "undo" setting, while the later both limits the history to one state and disables the history controls (because controls don't do you any good when you have a single-state history; this is also why nothing was working for you before).  You very likely do not want or need config.disableHistoryTracking.  I'd recommend switching to config.disableHistoryControls.

    Once that's sorted out, all of these should work (though <<back>> and <<return "Back">>/[[Back|previous()]] do very different things):

    <<back>> Rewinds the history, undoing all intervening states (undoes history)
    <<return "Back">> Pushes another state onto the history (preserves history)
    [[Back|previous()]] (largely equivalent to <<return>>)
  • TheMadExile wrote:

    You seem to be confusing config.disableHistoryControls and config.disableHistoryTracking.


    Yep, I did confuse the two, my mistake! Thanks for the added tip too! While <<return>> is the one more akin to [[Back|previous()]] I guess I'll stick with <<back>> this time.
Sign In or Register to comment.