Skip to content

Reset Buttons ​

Category: Message (Message)

An event content that deletes all buttons added by Add Button (Add Button) at once. Both buttons currently displayed on the screen and buttons still waiting while hidden are all removed.

Normally not needed

When the user clicks a button, reset processing automatically runs internally. Therefore, this event content is unnecessary in the normal click → transition flow.

This event content becomes necessary in the following cases where you want to swap button groups without waiting for a click:

  • Changing choices after a timer elapses (time-limited event)
  • Switching button groups based on external operation results
  • Debug / reset processing

Property List ​

This event content has no properties. It operates simply by being added to the event.

Runtime Behavior ​

When this event content is executed, the following processing is performed:

1. Clearing all button data ​

All internally stored button information (button_data) becomes empty.

2. Deleting all button nodes ​

All button nodes generated on the screen are safely deleted (Common.safe_free).

  • Node names are renamed with _deleted suffix
  • visible=false is set
  • Node deletion is reserved with queue_free()

Safe to regenerate buttons with the same name right after

Since safe_free renames nodes before deletion, no name conflict error occurs even if you create buttons with the same number via Add Button (Add Button) in the same frame.

3. Clearing focus history ​

The history of the button that was focused just before is cleared (_last_focus_node = null).

4. Proceeding to the next event content ​

After reset is complete, processing automatically proceeds to the next event content (no wait).

Difference from Automatic Reset on Click ​

Buttons added via Add Button (Add Button) have the same reset processing run internally at the moment the user clicks. Therefore, this event content is unnecessary in the following normal pattern:

Add Button × N
→ Show Buttons
→ (user click)
→ internal auto reset → to destination event

On the other hand, this event content is necessary in the following cases:

Add Button × N
→ Show Buttons
→ (another process without waiting for click)
→ Reset Buttons (this event content) ← necessary
→ Add Button × M (another button group)
→ Show Buttons

Typical Usage Flows ​

Flow 1: Switching button groups by conditional branch ​

Change displayed buttons depending on a variable:

  1. Add Button (Add Button) × 3 (choices for stage 1)
  2. Show Buttons displays the menu
  3. (When you want to clear existing buttons under another condition)
  4. Reset Buttons (this event content) ← clears all existing buttons
  5. Add Button (Add Button) × 3 (choices for stage 2)
  6. Show Buttons (Show Buttons)

Flow 2: Forced cancel processing ​

Invalidate button operations due to a change in game state:

  1. Add Button (Add Button) × N (choices)
  2. Show Buttons (Show Buttons)
  3. (forced cancel in another event)
  4. Reset Buttons (this event content) ← removes buttons
  5. Hide All Windows (Hide All Windows) ← also removes the background window

Flow 3: Debug / initialization ​

Cleanup when buttons remain in an unexpected situation:

  1. Reset Buttons (this event content) ← run at the beginning just in case
  2. Add Button (Add Button) × N (new button group)
  3. Show Buttons (Show Buttons)

Safe even without existing buttons

Executing this event content in a state with no buttons at all causes no error, and processing passes through to the next event content.

Flow 4: Game termination processing ​

Cleanup before returning to title or load:

  1. Reset Buttons (this event content) ← removes buttons
  2. Reset Choices (Reset Choices) ← removes choices
  3. Hide All Windows (Hide All Windows) ← removes background windows
  4. (processing to return to title screen)

Typical Combinations ​

See Combination Pattern Collection for the overall picture.

Switching button groups without clicks ​

Swap buttons based on timer or another event's result:

  1. Add Button (Add Button) × N (old button group)
  2. Show Buttons (Show Buttons)
  3. (time passes / another event)
  4. Reset Buttons (this event content)
  5. Add Button (Add Button) × M (new button group)
  6. Show Buttons (Show Buttons)

Clearing all UI at once ​

Completely reset the screen at a milestone of game progression:

  1. Reset Buttons (this event content) ← removes buttons
  2. Reset Choices (Reset Choices) ← removes choices
  3. Hide All Windows (Hide All Windows) ← removes background windows and text

"Hide All Windows" alone is not enough

Hide All Windows (Hide All Windows) removes only the background message window and its text. Buttons and choices remain, so use this event content and Reset Choices together.

Initialization at event start ​

Clear remnants of the previous event just in case:

  1. Reset Buttons (this event content) ← initialization just in case
  2. Show Window (Show Window)
  3. Show Text (Show Text)
  4. Add Button (Add Button) × N
  5. Show Buttons (Show Buttons)
Related Event ContentPurpose
Add Button (Add Button)Adds buttons to be deleted by this event content
Show Buttons (Show Buttons)Displays added buttons on the screen
Reset Choices (Reset Choices)Reset version for choices (selection window)
Hide All Windows (Hide All Windows)Bulk removal of background windows and text (buttons are not removed, use together with this event content)
Add Choice (Add Choice)Choice version of button addition (not a target of this reset)
PageRelated Content
Event Content ListList of all event contents

Notes ​

Normally not needed (auto-reset on click) ​

When the user clicks a button, the same reset processing is automatically run internally. In the normal "click → transition" flow, this event content is unnecessary. This event content is only needed when you want to swap without waiting for a click.

No error even without buttons ​

Executing this event content in a state with no buttons at all causes no error. Processing passes through to the next event content.

Use a different reset for choices ​

This event content is exclusively for free-placement buttons added by Add Button. To remove choices inside the selection window, use Reset Choices (Reset Choices).

Line up 3 to clear all UI ​

This event content only removes buttons. Hide All Windows (Hide All Windows) also targets only the background message window and its text, not buttons / choices.

If you want to clear all UI of text, windows, choices, and buttons, line up the following three:

  1. Reset Buttons (this event content)
  2. Reset Choices (Reset Choices)
  3. Hide All Windows (Hide All Windows)