This macro provides users access to parts of the UI and UIBar APIs from macros, and a few other, non-API functions.
Syntax: <<ui commandList>>
<<ui commandList>>
The <<ui>> macro is a macro-wrapper around some SugarCube APIs, similar in concept to the dialog API macro set. It allows you to control certain UI and UIBar APIs from macro code, and also adds a few extra commands of its own. You can run any number of actions in a single macro call, and they will execute in order. Calling two commands that essentially do the opposite, e.g. stow and unstow in the same <<ui>> macro call won't cause an error but it's also a wash: nothing will happen.
<<ui>>
stow
unstow
Arguments:
commandList
Command List: Some commands have aliases (alternate command names that do the same thing).
update
refresh
reload
StoryCaption
toggle
hide
show
kill
destroy
UI.destroy()
restore
revive
jump
jumpto
saves
save
load
settings
setting
share
sharing
⚠️ Tip: The last group of commands above can be used to access UI bar menus without needing the UI bar.
Usage:
/% create your own save button %/ :: PassageHeader <<button "Saves">><<ui saves>><</button>> /% hide the UI bar until the next passage %/ <<ui hide>> Blah blah blah. <<link [[Next|next passage]]>> <<ui show>> <</link>> /% remove the UI bar, but be able to restore it later %/ <<ui kill>> /% update the player's health %/ :: StoryCaption $currentHealth / $maxHealth :: some passage You took 15 damage! <<ui update>>
READ: Documentation
Demo Twee code:
:: Start <<button "Hide UI">><<ui hide>><</button>><<button "Show UI">><<ui show>><</button>> <<button "Show saves menu">><<ui saves>><</button>>