Im actually planning to do (or at least look into doing) something that involves most of the above (with a twist). Ive just been contemplating wether to package it all together with mouse cursor highlight advanced or not :s
Edit: It probably makes more sense to package it as a different plugin :) |
Quote:
While developing the plugin, I also toyed with the idea of exposing an API for plugin authors to register functions and icons directly, although I dismissed it so far because 1) registering functions is pretty much what's being done with shell commands, 2) I'm not going to convince everyone to do so, 3) 'Apartments'. I might resuscitate that idea, should I manage to get around 'Apartments'. |
It appears to me that it's not currently possible to achieve communication between plugins if they are in different 'apartments', in any other way than using shell commands, which I'd rather not do as a generic solution to that particular problem.
Still, I wanted to move forward with Bootstrap. As mentioned above, my primary objective with that plugin other than functionalities already existing in other plugin managers, was to offer the user a graphical user interface to interact with plugins. I've now added icons to Bootstrap's menu, which makes it fairly similar to Turbine's own panel menu, and gives me the option of turning it into an icon-only bar or something in the future. Currently, I've assigned every existing plugin (that might have any business being in the menu) an icon, either from the plugin's resources (preferably), or in game resources that I thought appropriate. I hope the authors of those plugins will find them suitable (feel free to criticize !). Ideally though, plugin authors themselves should be picking the icons they want used. To that end, I devised a relatively simple way for a plugin to expose a 'favourite icon', in a way that is not intrinsically bound to my own plugin (and hence can be used by others). It's rather lightweight for plugin authors to do so, and I hope it catches (if not, oh well, I'll keep assigning icons by hand). Anyway, here goes: Declaring a favourite icon - Favicon.lua By adding a "Favicon.lua" file to their plugins, authors can declare an icon to be used by other plugins. Favicon.lua should be in the same folder as the 'package' (entry point of the plugin) defined in .plugin definition files. Favicon.lua should contain a table named "Favicon". Favicon should itself have a subtable named 'Regular" (to allow for other icon states), with the following fields:
Eg: if a plugin hiearchy looks like this : Code:
Plugins/ Code:
Favicon = { Retrieving a plugin's favourite icon Because it might not be immediately obvious, below is a code snippet to extract the icon data from a plugin's Favicon.lua. GetPluginFavicon( pluginData ) parameters pluginData: definition table of a plugin as returned by Turbine.PluginManager.GetAvailablePlugins() Returns - nil if it fails - resource, width, height if success (where resource is a resource that can be sent to Turbine.UI.Control:SetBackground() ) Note: for the sake of code safety, it is preferable to call subsequent SetBackground() on those resources in a protected call. Never vouch for external data. Code:
function GetPluginFavicon( pluginData ) |
All times are GMT -5. The time now is 01:12 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI