I have a plugin that is likely to reach several thousand lines of code with multiple classes. Using Oxide, is it possible to split up my plugin into multiple files? I would really like to have each class in its own file. Also, I have read the API section in the docs, but that doesn't allow for any typing on method calls, since it uses a string to find the method to call.
Thanks for any help
Is it possible to break plugins out into multiple files?
Discussion in 'Rust Development' started by *VIC, Nov 12, 2016.
-
Wulf Community Admin
Yes, you can split into as many files as you'd like. You can have Ext.Name.cs files under the oxide/plugins/include folder that plugins can reference, you can // Require: PluginName at the top of your fine and add using statements for referencing methods directly, or you can use the plugin.Call method like how you saw in the Docs.
-
Brilliant! Thanks. Also, thanks for all of the work you put into this great project and community!
-
Still kind of confused here. Here is an example of the structure I'm using.
------------------------------------------------------------------
File: oxide/plugins/MyPlugin.cs
// Require: MyPluginAddition
usings...
namespace Oxide.Plugins
{
[Info("MyPlugin", "Me", 0.1)]
class MyPlugin : RustPlugin
{
[PluginReference] MyPluginAddition addition;
}
}
------------------------------------------------------------------
File: oxide/plugins/include/MyPluginAddition.cs
usings...
namespace Oxide.Plugins
{
[Info("MyPluginAddition", "Me", 0.1)]
class MyPluginAddition : RustPlugin
{
}
}
I'm getting errors "The type or namespace MyPluginAddition cannot be found from the MyPlugin.cs? I feel like I'm misunderstanding how to set this up. -
Wulf Community Admin
-
Is this still possible?
-
Wulf Community Admin
-
Code:
// Require: Foo
-
Wulf Community Admin
-
You can make plugin builder