Candy Logo Copyright © 2025-2026 Candy Arts

Reacting to Choices
Your code is informed of what happens in a menu through hook functions, and a menu scene of your own can send events of its own to the Dialogue. This is useful for a sound on each pick, a journal that records the player's answers, or a preview displayed when a choice is hovered. The Choice Hook Each pick calls the x_choice_selected() hook function, in User_Data/Functions, before the choice switches category and before its action runs. candy_args contains:
KeyValue
"caller"The Engine running the Choice_List command.
"menu"The menu node.
"category", "choice"The names of the category and the choice picked.
"button"The button node.
"choice_data"The choice's keys, as written in the Line.
custom_data contains the Custom Data of the menu, the category and the choice, in that order. The Engine waits for the hook, so an animation awaited in it plays before the action runs; the menu's timers are paused meanwhile. A choice picked by a timer calls the hook too; an inactive choice doesn't. See Hook Functions. Menu Hooks The menu scene has two hook functions of its own, called with the menu as "node":
HookCalled
x_initialization_finished()Once the menu, its categories and its buttons are built, before its timers start.
x_menu_closing()When a picked choice is about to close the menu, while the menu is still displayed. candy_args adds the category, the choice, the button and the Finish type.
The Engine waits for both, so the menu's opening and closing animations are played in them. Write them in a copy of the menu script attached to your own menu scene, since the shipped script is overwritten by updates. See Menu UI. Events of Your Own A menu, a category or a button scene of your own can send events of its own to the Choice_List command, by emitting the Engine's choice_list_event signal: a preview of the hovered choice, for example. A script in Scripts/Choice_Events, named after the event, runs it, and decides whether the menu stays open or the Dialogue continues, returns or ends. The shipped events, a pick and a timer expiry, are scripts in the same folder. See Event Scripts. Suspension While the Dialogue is suspended, choices can't be picked and timers stop counting down. On resume, the menu is available again and the timers continue from where they stopped. See Suspending Dialogues. Interruption When the Dialogue ends or is interrupted while a menu is open, the menu is deleted at once, without its closing animation (see Interrupting Dialogues).