There's a number of script states which are used at coding and testing time, but are not saved between IDE sessions.
This refers to:
collapsed regions;
breakpoints
When testing certain case, or debugging some problem, sometimes we have to restart the project, or open it later, and it would be convenient to have breakpoints restored automatically, instead of setting them in all places again.
Similarly, regions are not fully usable right now, as you cannot leave them collapsed, they will always be expanded again when reopening a project.
Therefore, suggestion is to save design-time script's state, and restore it when reopening a script in the Editor next time.
There may be a new option in preferences which toggles this behavior, if you think it's necessary.
The most straightforward implementation would be for this data to be serialized by ScriptsComponent class, by implementing IPersistUserData interface and its methods (that will correspond to saving and reading a chunk in Game.agf.user file).
(See how DebugLogComponent is doing this, for example)
EDIT: A better approach would be to have a .user file per each script, saving any workspace data for individual scripts. The problem with this is that the project's folder may become littered with .user files (rooms already have *.user files which store design-time data).
There's a number of script states which are used at coding and testing time, but are not saved between IDE sessions. This refers to:
When testing certain case, or debugging some problem, sometimes we have to restart the project, or open it later, and it would be convenient to have breakpoints restored automatically, instead of setting them in all places again.
Similarly, regions are not fully usable right now, as you cannot leave them collapsed, they will always be expanded again when reopening a project.
Therefore, suggestion is to save design-time script's state, and restore it when reopening a script in the Editor next time. There may be a new option in preferences which toggles this behavior, if you think it's necessary.
The most straightforward implementation would be for this data to be serialized by ScriptsComponent class, by implementing IPersistUserData interface and its methods (that will correspond to saving and reading a chunk in Game.agf.user file). (See how DebugLogComponent is doing this, for example)
EDIT: A better approach would be to have a .user file per each script, saving any workspace data for individual scripts. The problem with this is that the project's folder may become littered with .user files (rooms already have *.user files which store design-time data).
Such problem may be solved by introducing a project subfolder for these files. In fact, they may even be zipped and stored in a single archive. (See https://learn.microsoft.com/en-us/dotnet/api/system.io.compression.zipfile?view=net-8.0)