{"id":"stravant/create-shared-toolbar","name":"create-shared-toolbar","scope":"stravant","platform":"roblox","description":"A utility function to create a Toolbar shared between multiple plugins.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"613eeb2e0e6062df924a60aea84a4c9513fefb2172734615592c3d3ddbaddd79","likes":0,"downloads":0,"install":"forest install stravant/create-shared-toolbar","url":"https://forest.dev/p/roblox/stravant/create-shared-toolbar","files":"https://api.forest.dev/ai/package/roblox/stravant/create-shared-toolbar/files","readme":"# Roblox createSharedToolbar function\r\nThis is a function for creating a Toolbar shared between multiple plugins.\r\n\r\nIt will correctly handle a variety of edge cases such as one of the plugins sharing the toolbar being reloaded or unloaded entirely.\r\n\r\nThis code has been battle-tested in the widely used GeomTools set of plugins.\r\n\r\nUse the `createSharedToolbar.SharedToolbarSettings` type to get code completion for the required fields in the initialization table passed to the function.\r\n\r\n# Usage\r\n```lua\r\nlocal createSharedToolbar = require(script.Parent.createSharedToolbar)\r\n\r\nlocal toolbarSettings = {} :: createSharedToolbar.SharedToolbarSettings\r\ntoolbarSettings.CombinerName = \"<arbitrary name here>\"\r\ntoolbarSettings.ToolbarName = \"Your Toolbar Name\"\r\ntoolbarSettings.ButtonName = \"Your Button Name\"\r\ntoolbarSettings.ButtonIcon = \"rbxassetid://123456789\"\r\ntoolbarSettings.ButtonTooltip = \"Click here to do some fancy stuff!\"\r\ntoolbarSettings.ClickedFn = function()\r\n\t-- Button handler code here. A \"Button\" field is added to the\r\n\t-- toolbarSettings table when createSharedToolbar is called which is\r\n\t-- used to access the button Instance so you can call SetActive on it.\r\n\t--\r\n\t-- (Note: DO NOT connect to Click on the button via this reference, use this\r\n\t-- ClickedFn callback instead, as the Button reference may change if the\r\n\t-- plugin owning the Toolbar gets reloaded or unloaded)\r\n\tsharedToolbarSettings.Button:SetActive(...)\r\nend\r\ncreateSharedToolbar(plugin, sharedToolbarSettings)\r\n```\r\n\r\n","readmeTruncated":false}