Plugin toggle buttons
So while I'm usually comfortable using chat box command line switches, my wife is less inclined to remember the commands to bring up options for a plugin. I like the fact that a button can be displayed so that you can toggle the window, but wondering if they can be made to be different sizes?
What would be cool to see is the option to allow for a smaller one, something small and round like the other icons that appear on the radar currently, that could be dragged and placed so that they look like part of the radar ring. Is this possible? If so, would it be easy to change the lua to accomodate this (as in myself) or is this something that authors might be able to build in, if they feel so inclined? |
Lua authors can set the size of buttons.
It would be up to the author to provide methods for the user to change the size of these buttons. |
What about in the Lua, does this information have to live in a certain place across all plugins? Is there a specific thing that I could look for to see if I can modify it?
|
Probably look for-
objectName = Turbine.UI.Lotro.Button objectName being the name the author has given the button, but the author may have used many buttons so you may have a hard time. besides that, if there is an image for the button in the plugin files, look for its name in the code and see what button is associated with it. Then check objectName:SetSize and objectName:SetPosition |
Quote:
Best to contact the plugin author and make a feature request. |
The easiest way to do it would be to simply add a alias to the command, and put it on your quickslots. As far as actually coding it yourself - this is what you'd need to do.
1) Find the name of the function that is called when you type in the slash command 2) Create a Turbine.UI.Lotro.Button, and place it at the coords you want it at 3) call the above mentioned function on that button's onclick handler Being able to move it around is an entirely different ballgame that would entail detecting whether alt, shift or ctrl is being pressed - depending on what modifier you want to "unlock" the button's position setting whether your modifier is being pressed as a variable having your button's "MouseDown" event handler check that variable, and then setting another variable as a flag to allow movement if that flag is set to true (modifier pressed, and mouse button is down over the button, then change the button's position, relative to the mouse - on that button's MouseMove handler. Obviously MouseUp and KeyUp handlers would be used to set the above mentioned flags to false. Then of course, you have to keep in mind that if the author's plugin hides itself when you press f12, that you would have to put that button as a child of whatever window is hidden on that event. Otherwise, you'll still see that button after hiding the UI Also, for best results, you'd probably want to use a Turbine.UI.Button instead, providing your own images for the three states (up, down and over) - as that way you'd be able to do a circular button, instead of the standard LotRO button. |
Is it possible to create buttons that we can put into our quickslots like skills? I guess not for the moment cause otherwise you guys would have already implemented it by now. :D
|
Should be able to do this using alias'
|
The alias isn't a bad idea, though I wish that Turbine allowed us to assign icons to them, but whatever I suppose.
Still think that it would be nice to have smaller ones that can be placed, or moved around (many of them do this already, just drag and drop) to be placed out of the way on the radar ring, just seems like a perfect place for them so they don't take up screen real estate, and like addons were in WoW when I used to play, the icons look like they belong on the radar ring. |
I've noticed that WoW addon authors have started using a slide out type of icon menu for their addons - presumably due to an alternative to mini-map icons, as you can only fit so many on there.
But anyway, that might be something worth looking into. It would require cooperation from individual authors, but it would certainly make things easier. I'm not sure if global variables are confined to apartments, but that might be one way of doing it, without having to do any manual editing or whatnot. |
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 05:11 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI