ChangeHistoryService¶
Must be used by plugins to communicate to Studio how to undo and redo the changes which they make to the experience.
Description¶
Plugin developers must use ChangeHistoryService to tell Studio how to undo and redo changes that their plugins make to experiences by recording. Before making changes, a plugin calls ChangeHistoryService.TryBeginRecording(), remembering the identifier it assigns, then after making changes, the Plugin calls ChangeHistoryService.FinishRecording() to complete the recording.
Plugins may also programmatically invoke an undo or redo through ChangeHistoryService.Undo() or ChangeHistoryService.Redo().
ChangeHistoryService is not enabled at runtime, so calling its methods in a running experience has no effect.
Inheritance¶
Object → Instance → ChangeHistoryService
Nova inheritance: Instance → ChangeHistoryService
Methods¶
GetCanRedo Supported Function Returns whether there is an action available to redo and, if so, the name of that action.
Returns whether there is an action available to redo and, if so, the name of that action.
Reports whether Redo() currently has
an action available to replay. It returns a boolean that is true when a
redoable waypoint exists ahead of the current position in the undo/redo
history; when that boolean is true, it also returns the name of the
waypoint that the next redo would replay.
The boolean is false, with no name returned, when the redo stack is
empty because the newest waypoint is already the current one, or when the
service is disabled (which is always the case at runtime).
PluginSecurityGetCanUndo Supported Function Returns whether there is an action available to undo and, if so, the name of that action.
Returns whether there is an action available to undo and, if so, the name of that action.
Reports whether Undo() currently has
an action available to revert. It returns a boolean that is true when an
undoable waypoint exists at the current position in the undo/redo history;
when that boolean is true, it also returns the name of the waypoint that
the next undo would revert.
The boolean is false, with no name returned, when the undo stack is
empty because the position is already at the base waypoint, or when the
service is disabled (which is always the case at runtime).
PluginSecurityRedo Supported Function Re-executes the most recently undone action, advancing forward through the undo/redo history.
Re-executes the most recently undone action, advancing forward through the undo/redo history.
Replays the waypoint immediately ahead of the current position in the undo/redo history, redoing the action that a matching Undo() had reverted, and advances the redo pointer forward by one waypoint. After the waypoint is replayed, it fires OnRedo with the name of the redone waypoint.
This method raises an error if a play is already in progress, if the service is disabled (which is always the case at runtime), or if there is nothing left to redo. Call GetCanRedo() first to confirm a redo is available.
PluginSecurityResetWaypoints Supported Function Collapses undo history into a base waypoint. Plugin-only.
Collapses undo history into a base waypoint. Plugin-only.
Nova implements the legacy plugin method and resets the base waypoint. Modern Roblox's wording about editor history does not make it a no-op in Nova.
PluginSecuritySetEnabled Supported Function Sets whether or not the ChangeHistoryService is enabled.
Sets whether or not the ChangeHistoryService is enabled. When set to false, the undo/redo list is cleared, and does not repopulate. When set to true again, the original list is not restored, but further operations append to the list once more
PluginSecuritySetWaypoint Supported Function Sets a new waypoint which can be used as an undo or redo point.
Sets a new waypoint which can be used as an undo or redo point.
This method will be deprecated soon in favor of TryBeginRecording().
ChangeHistoryService tracks plugin history as a stream of property changes. SetWaypoint() creates a cut in that stream of property changes so that the undo and redo actions know where to stop.
By convention, user-invoked actions in Studio must call SetWaypoint() after completing their set of changes to the experience. Calling it before a set of changes may clean up another misbehaving plugin which failed to set a waypoint, but it's a poor reason to justify such usage in your own plugin.
PluginSecurityUndo Supported Function Reverts the most recent action, stepping backward through the undo/redo history.
Reverts the most recent action, stepping backward through the undo/redo history.
Unplays the waypoint at the current position in the undo/redo history, reverting the most recent recorded action, and steps the undo pointer back by one waypoint. After the waypoint is reverted, it fires OnUndo with the name of the undone waypoint.
This method raises an error if a play is already in progress, if the service is disabled (which is always the case at runtime), or if there is nothing left to undo. Call GetCanUndo() first to confirm an undo is available.
PluginSecurityEvents¶
OnRedo Supported Event Fires after an action is redone, reporting the name of the action that was replayed.
Fires after an action is redone, reporting the name of the action that was replayed.
Fires immediately after Redo() replays
a waypoint, whether the redo was triggered by the user through Studio or
invoked programmatically. The waypoint argument is the name of the
action that was redone, matching the name that was recorded for that
waypoint.
PluginSecurityOnUndo Supported Event Fires after an action is undone, reporting the name of the action that was reverted.
Fires after an action is undone, reporting the name of the action that was reverted.
Fires immediately after Undo() reverts
a waypoint, whether the undo was triggered by the user through Studio or
invoked programmatically. The waypoint argument is the name of the
action that was undone, matching the name that was recorded for that
waypoint.
PluginSecurityInherited members¶
Inherited from Instance: 8 properties, 36 methods, 7 events. They are documented on the base class page.
5 modern Roblox member(s) are not implemented yet — expand to inspect
Members declared by Roblox's ChangeHistoryService class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.
Methods¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
FinishRecording |
ChangeHistoryService:FinishRecording(identifier: string, operation: FinishRecordingOperation, finalOptions: Dictionary?): null |
Not yet | Communicates to Studio that the identified recording is finished and to take the final operation to complete the recording. | PluginSecurity |
IsRecordingInProgress |
ChangeHistoryService:IsRecordingInProgress(identifier: string?): bool |
Not yet | Returns whether the plugin currently has a recording in progress, optionally checking for a specific recording identifier. | PluginSecurity |
TryBeginRecording |
ChangeHistoryService:TryBeginRecording(name: string, displayName: string?): string? |
Not yet | Begins tracking changes made to the data model into a recording. | PluginSecurity |
Events¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
OnRecordingFinished |
OnRecordingFinished(name: string, displayName: string?, identifier: string?, operation: FinishRecordingOperation, finalOptions: Dictionary?) |
Not yet | Fired when the user completes an action. Parameters come from TryBeginRecording() and [FinishRecording()](ChangeHistoryServi… | PluginSecurity |
OnRecordingStarted |
OnRecordingStarted(name: string, displayName: string?) |
Not yet | Fired when the user begins an action. Parameters come from TryBeginRecording(). | PluginSecurity |
Roblox reference: ChangeHistoryService
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.