RZS's Class Inserter Plugin
Tired of typing the same snippets of code every time when you’re creating a new class ModuleScript? This plugin may be for you.
Features
- Small, non-intrusive UI. One toolbar button, one widget, no unnecessary prints
- Studio theme syncing
- Subclassing support
- Custom, fully editable and highly flexible template system
Using the plugin
To create a new ModuleScript, open the main GUI and input a class name. Additionally, input any constructor parameters (comma-separated, space-separated... anything works).Next, choose whether the new class is subclassing an already-existing class.
Lastly, simply click the big Create Class
button and a new, ready-to-go ModuleScript with the supplied information will be created under the current studio selection.
Editing the template
To edit the used template, click the Edit Template button. A new script will be created with instructions and a text field to edit. Make the desired changes and then click Save Changes
.
About the custom template system
We all have different programming styles and preferred formats. RZS’s CI was made with this in mind, and allows for fully custom templates with the use of custom string patterns.
The following template generates the above example:
-- Original script by !c, !dB !dY --
--![
Docs
!]
$local !i = require(script.Parent)
local !s = {}
!s.__index = !s
$setmetatable(!s, !i)
function !s.new(!p)
local self = {}$local self = !i.new(!p)
setmetatable(self, !s)
return self
end
--![
Docs
!]
function !s:get()
end
return !s
Use these patterns to build your preferred template, and RZS’s CI will do the rest. Note that subclass variations are supported by the $
character as well.
More details about this system can be found in the plugin.
Get RZS’s Class Inserter here.
Alright, that’s pretty much everything I have to say. This being my first plugin, I would greatly appreciate any feedback, suggestions, questions, bug reports… anything. Have a nice day