Hey, I am writing a plugin and have found that ChangeHistoryService does not undo or redo changes made to TextBox.Text, TextLabel.Text, or TextButton.Text by a plugin or code (This works fine if it is changed manually via properties).
This is occurring inside of a DockWidgetPluginGui inside of Roblox Studio Version 0.421.0.385673(64bit)
Here is a demonstration:
In this video I change a value from 0.299 to 1 and undo then redo several times - this can be seen working as intended on the character (the blue ball) but there is no change made to the TextBox (lower right).
I’ve set a waypoint before and after making changes in the TextBox.LostFocus event. Here’s the code for a local plugin to repro this: hastebin (you’ll need to add your own screengui and textbox.)
Not quite on-topic, but many thanks to whomever made ChangeHistoryService ignore non-Archivable instances. Plugins can now created complex objects and visualizations that are ignored by undo/redo which is huge!
Ah sorry, I just realized that you’re trying to do. Unfortunately, the ChangeHistoryService only tracks changes in the workspace, so what you’re seeing does make sense. What the plugin needs to do is use the waypoints to tag changes it makes to the workspace and then set up a listener to handle the undo and redo events when those plugin events are encountered.