Hacknet-Pathfinder
Hacknet-Pathfinder copied to clipboard
Improved Options system
- Deprecates old options system, marked for deletion in next major version
- Enables overriding default behavior
- Default behavior saves and loads to configs according to its Id, and in accordance to default value, can be overriden
- Tab names and tab ids can be separated
- Tabs are optionally modifiable
- Tabs and Options store their position and size data in an instance DrawData struct
- Simplifies PathfinderOptions immensely
- Manages config loading and registers saving in PostLoad
- DrawData allows storing and modifying position and size structs easily (currently the X position of tab buttons are hard coded to be 10 pixels after the previous tab button however)
Added DrawData
- Simple position and size data struct
- Converts between any draw relevant types
- Also has simple data modifiers
Added PluginOptionTab registry methods
- Registers the option tab object for drawing and retrieves the tab object
- Enables chained method calls like
GetOrRegisterTab("tabName").AddOption(PluginOption).AddOption(PluginOption2) - Can separate tab ids and tab names
Added ease of use PluginOption registry method
- For the case that one does not wish to mess with tab objects
- Does not allow chain methods, is called instead like so
RegisterOption("tabName", PluginOption); - Shortcut for
GetOrRegisterTab(string).AddOption(IPluginOption)while returning the option object - Can separate tab ids and tab names
#127 needs to be updated when this is merged, or this needs to be updated when #127 is merged
I hope to add a capability to change the plugin options so that they can also support being drawn in a less "standard" position better, might require manually storing X, Y as nullable ints however.
And with that tabs and options support being in custom positions with overriding the draw methods.
Additions to #164:
- Pathfinder.Meta.Load:
- [ ] OptionAttribute.Tag
- [ ] OptionsTabAttribute.Tag
- Pathfinder.Options:
- [ ] Option
- [ ] OptionsManager.Tabs
- [ ] OptionsManager.AddOption(string, Option)
- [ ] OptionsTab