API 4: Plugin API redesign #474
goaaats
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Old and busted
New hotness
...in constructors
You only have to include WHAT YOU WANT. You even don't need to include the DalamudPluginInterface if you don't use it. Add them to static properties in your base class, pass them around, however you want to access the various API classes. The scratch constructor above is all the various possibilities that you can currently include. Any classes that have a
[PluginInterface]
attribute are available as parameters in your constructor.If you would like to restrict the version of your dependency, i.e. you're worried about ClientState breaking, you should structure your parameters as such. If the API class version changes due to breaking updates, your plugin will gracefully not load, rather than break in unforeseen ways in-game.
...in properties
You can do the same for public, private, static or instance properties.
...for your own types and objects
You can inject into and create your own objects via DI.
Beta Was this translation helpful? Give feedback.
All reactions