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
_deletedsuffix visible=falseis 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 eventOn 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 ButtonsTypical Usage Flows
Flow 1: Switching button groups by conditional branch
Change displayed buttons depending on a variable:
- Add Button (Add Button) × 3 (choices for stage 1)
- Show Buttons displays the menu
- (When you want to clear existing buttons under another condition)
- Reset Buttons (this event content) ← clears all existing buttons
- Add Button (Add Button) × 3 (choices for stage 2)
- Show Buttons (Show Buttons)
Flow 2: Forced cancel processing
Invalidate button operations due to a change in game state:
- Add Button (Add Button) × N (choices)
- Show Buttons (Show Buttons)
- (forced cancel in another event)
- Reset Buttons (this event content) ← removes buttons
- Hide All Windows (Hide All Windows) ← also removes the background window
Flow 3: Debug / initialization
Cleanup when buttons remain in an unexpected situation:
- Reset Buttons (this event content) ← run at the beginning just in case
- Add Button (Add Button) × N (new button group)
- 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:
- Reset Buttons (this event content) ← removes buttons
- Reset Choices (Reset Choices) ← removes choices
- Hide All Windows (Hide All Windows) ← removes background windows
- (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:
- Add Button (Add Button) × N (old button group)
- Show Buttons (Show Buttons)
- (time passes / another event)
- Reset Buttons (this event content)
- Add Button (Add Button) × M (new button group)
- Show Buttons (Show Buttons)
Clearing all UI at once
Completely reset the screen at a milestone of game progression:
- Reset Buttons (this event content) ← removes buttons
- Reset Choices (Reset Choices) ← removes choices
- 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:
- Reset Buttons (this event content) ← initialization just in case
- Show Window (Show Window)
- Show Text (Show Text)
- Add Button (Add Button) × N
- Show Buttons (Show Buttons)
Related Event Contents
| Related Event Content | Purpose |
|---|---|
| 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) |
Related Pages
| Page | Related Content |
|---|---|
| Event Content List | List 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:
- Reset Buttons (this event content)
- Reset Choices (Reset Choices)
- Hide All Windows (Hide All Windows)
