Plugin Buttons Manipulation

Currently, a plugin can create toolbars, and buttons on those toolbars.
It can also detect when it’s clicked, and thuss set it (in)active if needed.

A few ideas I have, that would help with developing plugins:
[ul]
[li]Add new methods for button: SetName,SetImage,… basicly edit buttons after they’re created[/li]
[li]Add the ability for plugins to set one major icon for a toolbar, making it minimised to that icon
(Very useful when there are a lot of buttons. Click the icon to open up the toolbar with all buttons)[/li]
[li]Allow HttpService to be used without NetworkServer (internally check thread identity for that)[/li]
[li]Maybe a worse idea: Allow to add stuff to the context menu [size=2](see note 1)[/size][/li]
[li]Add Plugin:SetClipboard(string data) [size=2](probably no GetClipboard() due privacy)[/size][/li]
[/ul]

Note 1:
This could be done with Plugin:AddContextOption(String name, Function checker, Function handler)
[size=2]Maybe add an optional fourth argument “image” for a small icon next to the name in the context menu[/size]
Whenever the context menu is opened (rightclick in explorer, or alt/shift-RC in game-window),
the checker function is called (maybe Selection:Get() already passed on), which should
return true/false (or a new Enum) to determine if the option should be shown.
When it’s shown, and clicked, call handler, maybe with the selection again.
This way, plugins can add useful stuff to certain selections (depending on classes etc).
Example: For sound, display option “Preview” to play the music, maybe with a quick GUI button to stop it

This would give plugin developers more freedom to improve/create useful plugins.
(Especially being more responsive: A button can rename itself to “Disable …” or “Enable …”)
(^ Could even change the icon to one that clearly states that it’s enabled)

2 Likes