{"id":"frqstbite/fusion-plugin","name":"fusion-plugin","scope":"frqstbite","platform":"roblox","description":"Rediscover the joy of plugins.","version":"1.1.3","latest":"1.1.3","versions":["1.0.0","1.0.1","1.0.2","1.1.2","1.1.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"ed44b0233a58c6fe2cb65a8e4e535f46c9c0dee27c9862c71ba161f0b7087ce8","likes":0,"downloads":0,"install":"forest install frqstbite/fusion-plugin","url":"https://forest.dev/p/roblox/frqstbite/fusion-plugin","files":"https://api.forest.dev/ai/package/roblox/frqstbite/fusion-plugin/files","readme":"# fusion-plugin #\r\n\r\n![GitHub License](https://img.shields.io/github/license/frqstbite/fusion-plugin)\r\n![Discord](https://img.shields.io/discord/385151591524597761?label=need%20help%3F&logo=discord&logoColor=%2300BE9B&color=%2300BE9B&link=https%3A%2F%2Fdiscord.gg%2Fr4qaSqKMqq)\r\n\r\nBuild powerful plugins for Roblox Studio with [Fusion](https://elttob.uk/Fusion), a modern reactivity library for [Roblox](https://developer.roblox.com) [Luau](https://luau-lang.org).\r\n\r\n### Table of Contents ###\r\n\r\n* [Installation](#installation)\r\n* [Usage](#usage)\r\n  * [Dockable Widgets](#dockable-widgets)\r\n  * [Toolbars](#toolbars)\r\n  * [Plugin Actions](#plugin-actions)\r\n  * [Plugin Menus](#plugin-menus)\r\n* [Example](#example)\r\n* [Contribution](#contribution)\r\n* [License](#license)\r\n\r\n## Installation ##\r\n\r\n`fusion-plugin` is available on the [wally](https://wally.run) package manager. Copy the install string from the [project page](https://wally.run/package/frqstbite/fusion-plugin) and paste it into your `wally.toml`. Then, run `wally install`.\r\n\r\n## Usage ##\r\n\r\nEverything you'll need is available in the module.\r\nYou acquire it like so, providing the appropriate ModuleScripts:\r\n\r\n```lua\r\nlocal Fusion = require(...)\r\n-- .Value, .Computed, .New\r\n\r\nlocal FusionPlugin = require(...)(Fusion, plugin)\r\n-- .DockWidget, .Toolbar, .ToolbarButton\r\n```\r\n\r\nYou must call the required result, passing in your Fusion and plugin context. This is necessary because automatic dependency capturing only works on reactive objects from the same Fusion instance.<sup>[*citation needed*]</sup>\r\n\r\n### Dockable Widgets ###\r\n\r\nDockable widgets are exposed through a function called DockWidget. Here's an example of what a settings panel might look like:\r\n```lua\r\nlocal DockWidget = FusionPlugin.DockWidget\r\n\r\nlocal open = Value(false) --whether the dockable is open or not\r\n\r\nDockWidget \"examplePluginSettings\" {\r\n    Title = \"Example Plugin Settings\",\r\n    Enabled = open,\r\n    [Out \"Enabled\"] = open,\r\n    [Children] = ... --mount panel root component\r\n\r\n    -- NON-REACTIVE\r\n    Size = Vector2.new(400, 300),\r\n    MinimumSize = Vector2.new(100, 100), --Defaults to .Size\r\n}\r\n```\r\nNote how some props are **not reactive** due to the immutability of [DockWidgetPluginGuiInfo](https://create.roblox.com/docs/reference/engine/datatypes/DockWidgetPluginGuiInfo).\r\n\r\n### Toolbars\r\n\r\nToolbars can be elegantly expressed with two functions, as so:\r\n\r\n```lua\r\nlocal Toolbar = FusionPlugin.Toolbar\r\nlocal ToolbarButton = FusionPlugin.ToolbarButton\r\n\r\nToolbar \"Example Plugin\" {\r\n    ToolbarButton \"settings\" {\r\n        Active = ..., --whether the button is shaded gray\r\n        ClickableWhenViewportHidden = true,\r\n        [OnEvent \"Click\"] = function()\r\n            print(\"TODO: open example plugin settings widget\")\r\n        end,\r\n\r\n        -- NON-REACTIVE\r\n        Text = \"Settings\",\r\n        Tooltip = \"Open example plugin's settings\",\r\n        Icon = \"rbxassetid://4458900760\",\r\n    }\r\n}\r\n```\r\n\r\nNote how some props are **not reactive** due to the immutability of [PluginToolbar:CreateButton()](https://create.roblox.com/docs/reference/engine/classes/PluginToolbar#CreateButton)'s arguments.\r\n\r\n### Plugin Actions  ###\r\nPlugin actions are declared with the function `Action`:\r\n``\r\n```lua\r\nlocal Action = FusionPlugin.Action\r\n\r\nAction \"coolaction\" {\r\n    Bindable = true, --whether this action should be visible in the keybinds window\r\n    Icon = image,\r\n    Text = \"Cool Action\",\r\n    Tooltip = \"this means only good things\",\r\n\r\n    [OnEvent \"Triggered\"] = function()\r\n        print(\"cool things underway.......\")\r\n    end,\r\n}\r\n```\r\n\r\n### Plugin Menus ###\r\n[PluginMenus](https://create.roblox.com/docs/reference/engine/classes/PluginMenu) are not yet supported. Feel free to contribute an implementation.\r\n\r\n\r\n## Example\r\nA comprehensive [sample file](./example-plugin/init.server.lua) has been written for your reference. Build commands can be found in the [vscode tasks.json file](./.vscode/tasks.json).\r\n\r\n\r\n## Contribution ##\r\nFile an issue if you encounter a bug. Pull requests for bugfixes and improvements are welcome.\r\n\r\n\r\n## License ##\r\nThis library is licensed under the [MIT License](https://choosealicense.com/licenses/mit).\r\n","readmeBorrowedFrom":{"version":"1.0.0","source":"wally"},"readmeTruncated":false}