Switch E2Helper & Wire's Text Editor to a partly modular/mode system #3127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removes the hardcoded support for the CPU, GPU, and SPU (their functionality has been reimplemented as part of an upcoming wire-cpu PR) and replaces it with a partly modular system.
E2Helper
Replaces the CPU/GPU and E2 checkboxes with a slick new dropdown which should be populated by all the registered e2helper modules
Will be hidden if there's less than 2 modules to pick from to avoid visual clutter
(E2Helper will look like this for people with no modules other than E2)
Allows descriptions and items to be updated easily without need for globals by the addon that registered this mode, which will update on next refresh. (Helps support extensions for other addons by letting them dynamically change the list as their own extensions get loaded and unloaded)
Opens more of the columns to be accessed by key on E2Helper, or via an array so you don't have to memorize the names and order, and allows E2Helper to call a "Setup" function for modes, allowing them to change column names or do what they need to with the editor on mode change (E2 and ZCPU's modes change column names primarily)
Text Editor
Looks exactly the same to the user for the pre-existing cases.
Allows per-editor replacement of the E2Lib compile / CPULib compile functions with an addon provided "Validator" taking Editor, Code, File as arguments.
Sound browser and validator for the text editor are now controlled via settings on the editor mode, rather than hardcoded by their name.
Neither are fully decoupled fully from hardcoded E2 cases, but this makes a good stepping stone I think to opening up the use of the text editor and E2helper by other addons.
For an example of how to support or use these changes, see: wiremod/wire-cpu#63