As a Roblox developer, it is impossible to disable ChangeHistoryService without it deleting previous waypoints.
Currently I am making a plugin which modifies the user’s place and it takes some time for that modification to be done, for the plugin to work ideally, the user shouldn’t touch anything during that process, including undo-ing and redo-ing stuff.
So I want to “freeze” ChangeHistoryService, meaning that no other script can create a waypoint, and the user can’t undo/redo or add new waypoints, if an unexpected error occurs during the plugin’s process, I want to be able to “unfreeze” ChangeHistoryService and undo the changes.
Currently there is only one option similar to this available and its ChangeHistoryService:SetEnabled()
, however unfortunately that deletes all previous waypoints, and once I reenable ChangeHistoryService, I can’t undo the said changes.
I suggest the following APIs to be added to ChangeHistoryService;
ChangeHistoryService:Freeze(status: boolean)
Depending on the status passed, it affects the ability to perform undos, redos, waypoints sets or resets and keeps the previous waypoints.
ChangeHistoryService:GetFrozenStatus(): boolean
Returns whether ChangeHistoryService is currently frozen using the ChangeHistoryService:Freeze() method.
Additionally some API changes could also be made to the already existing APIs, mainly :GetCanUndo() and :GetCanRedo(), which, if the service is frozen should return their first value as false
, but also return the last action as the second value.