|
Category: Outdated LotRO Interfaces[Class] DragBar with Examples |
Example of a DragBar Attached to a Window
|
|
Version 1.3b
REQUIRES TURBINE UTILITIES!
This is a utility class that adds dragging and ui hiding functionality similar to in game ui elements. It is used by attaching it to any parent window. If self is your parent window, you could attach it as follows:
Code:
self.DragBar = Deusdictum.UI.DragBar( self, "DragBar Demo Window" );
This results in something like the attached screenshot from the included demo plugin.
The class also looks for the following functions on the window it's attached to and calls them when appropriate. You do not have to define them, but if they are defined, they will be called:
- HUDShow() - when the UI is un-hidden (F12)
- HUDHide() - when the UI is hidden (F12)
- DragEnable() - when dragging is enabled (CTRL + \)
- DragDisable() - when dragging is disabled (CTRL + \)
- DragStart() - when dragging begins
- DragEnd() - when dragging ends
- RotateStart() - when the user presses the mouse button down on the rotate icon / rotation begins
- Rotating() - when the user moves the mouse after pressing the mouse button down on the rotate icon
- RotateEnd() - when the user releases the mouse button after pressing it on the rotate icon / rotation ends; fires regardless of where the mouse pointer is in relation to the rotate icon
- Rotate() - when the user releases the mouse button after pressing it on the rotate icon / rotation should be executed; fires only if the mouse pointer is positioned appropriately over the rotate icon
Let me know if you have any suggestions or encounter any bugs.
Known Issues:- API LIMITATION: The API does not allow you to determine whether the client is in layout mode (CTRL + \) or not. DragBar assumes you are not in layout mode when the plugin is loaded. Creating a DragBar while in layout mode will result in a DragBar that displays/hides when it should be doing the opposite.
- The size and position of a window should be initialized before the DragBar class is attached to it, otherwise it will not correctly detect the window's size and shape when it is displayed.
- If the target window changes Size or changes its Position directly (instead of through the DragBar class), it should call one of the Recalculate methods or the Refresh method. Otherwise, the DragBar may be displayed in the wrong location or be incorrectly sized.
Features:- The default resources can be overridden to provide the look of your choosing.
- Option of displaying a button that will trigger Rotate events on the target.
- Option of placing the DragBar below the target instead of above it. Left and Right placement will not happen until we can do vertical text.
- Methods for disabling/enabling HUD toggling and Dragging. You can use it for combat only quickslots and other controls that only appear/should be able to be dragged based on some condition.
- Three demo plugins showing how it is used:
- DragBarDemoOne - demo with a rotate button
- DragBarDemoTwo - a complex way of dealing with windows that only open under certain conditions; another class tracks whether the target should be visible or hidden and the DragBar events are monitored so that the control is correctly hidden or displayed
- DragBarDemoThree - a simple way of dealing with windows that only open under certain conditions; the demo window only appears during combat, but still responds appropriately to the DragBar control during combat
Available Methods: (well, the ones I expect developers to use, anyway...):- G/Set = There's a Get version of the Set method, usually w/no arguments
- I/Set = There's an Is version of the Set method, usually w/no arguments
- Constructor( ctlAttachTo, sName, bBarOnTop, tResources ) - self-explanatory except look at the local defaultDragBarResources table in DragBar.lua for the structure of tResources if you want to override the default ones.
- SetRotatorOffset( oX, oY ) - if the Rotator has been initialized, determines the location of the rotate icon
- SetRotator( boolean, tResources ) - show/hide the rotate icon, allowing customization of resources
- SetBarOnTop( boolean ) - pass false to put the DragBar beneath the target window
- G/SetAllowsDragging( boolean )
- G/SetAllowsHUDHiding( boolean, boolean ) - optional 2nd argument; if true, will unhide the control if you are turning off HUD hiding. (use false or omit for conditional appearance of a control, e.g. combat quickslots)
- HideTargetIfHUDHidden()
- I/SetDraggable( boolean )
- I/SetHUDVisible( boolean )
- ToggleDraggable()
- ToggleHUDVisible()
- RecalculatePosition()
- RecalculateSize()
- Refresh() - just calls the two Recalculate methods
Version History:- 1.3b - The Rotator, if enabled, should now stay on top of the DragBar after it has been moved.
- 1.3a - Removed all references to Turbine.Utils for US November 2010 update.
|
Archive List (Old Versions) |
File Name |
Version |
Size |
Author |
Date |
|
1.3a-All |
21.35 Kb |
Deusdictum |
12-05-2010 02:07 AM |
|
1.3-All |
21.37 Kb |
Deusdictum |
09-09-2010 09:30 AM |
File Statistics |
User Rating: |
|
Downloads: |
166795 |
Views: |
159068 |
Favorites: |
82 |
Uploaded By: |
|
Last Modified: |
N/A |
|
| |
|
|
|
11-09-2019, 11:10 AM
|
|
The Undying
Forum posts: 20
File comments: 146
Uploads: 0
|
Can this plugin be used to rotate other elements?
if so how?
|
|
|
06-18-2012, 09:07 PM
|
|
The Wary
Forum posts: 0
File comments: 1
Uploads: 0
|
Can't move panels
How do I move the panels to a different location in my game session? Using Ctl + / doesn't activate click and drag for the GambitHelper2 panels though it does for everything else. I did download Deusdictum's Dragbar (no install instructions with it so I think it's installed correctly). I'm using Bootstrap to activate my plugins. Any suggestions or thoughts on how to debug/fix this would be greatly appreciated.
|
|
|
02-12-2012, 01:21 PM
|
|
The Wary
Forum posts: 2
File comments: 5
Uploads: 0
|
First, a question: Do I have to have the actual demo plugins installed for it to work with the other plugins (like Jackdaw's Sortpack), or can I remove the demos, and just keep the resources and UI folders?
Secondly, I was experiencing a problem with one of the plugins that uses the dragbar. I am cross-posting my fix in case someone comes here trying to figure out what is wrong with their install.
--------
I had tried re-installing [this dragbar plugin] half a dozen times, but was having some trouble with the Turbine stuff because I can't open 7Z archives, because my free trial of winzip ran out. (grrr for using a specialty archive).
Since I couldn't do a clean reinstall of those (which probably would not have worked anyway), I had to actually open the dragbar .plugin files and .lua files and check the lines with the errors I saw in chat, to see what was wrong.
Basically, it was a problem of where the stuff got installed.
My folders looked like
Quote:
Docs / LOTRO / Plugins / BetaLuaPlugins / TurbinePlugins
Docs / LOTRO / Plugins / BetaLuaPlugins / Turbine / UI
Docs / LOTRO / Plugins / BetaLuaPlugins / Turbine / Debug
Docs / LOTRO / Plugins / BetaLuaPlugins / Turbine / Animation
Docs / LOTRO / Plugins / BetaLuaPlugins / Turbine / Testing
and then
Docs / LOTRO / Plugins / Deusdictum / Plugins
Docs / LOTRO / Plugins / Deusdictum / Resources
Docs / LOTRO / Plugins / Deusdictum / UI
and then
Docs / LOTRO / Plugins / Turbine / Resources
|
All I had to do to make it work was move the
Docs / LOTRO / Plugins / BetaLuaPlugins / Turbine / folder contents to
Docs / LOTRO / Plugins / Turbine /
Now my plugin works!
So, if anyone else is getting errors like
Quote:
...s Online\Plugins\Deusdictum\UI\DeltaButtonWindow.lua :8: attempt to call global 'class' (a nil value)
... Online\Plugins\Deusdictum\UI\DeltaButtonControl.lu a:8: attempt to call global 'class' (a nil value)
...f the Rings Online\Plugins\Deusdictum\UI\Dragbar.lua:39: attempt to call global 'class' (a nil value)
...ings Online\Plugins\JackdawPlugins\SortPack\Load.lua:5: Failed to import package "Deusdictum.UI.Dragbar".
|
that's how I fixed it.
Last edited by MizSparrow : 02-12-2012 at 02:57 PM.
|
|
|
01-21-2012, 01:35 PM
|
|
The Wary
Forum posts: 2
File comments: 2
Uploads: 0
|
Turbine utilities
Where do we put the Turbine utilities?
|
|
|
10-02-2011, 01:55 AM
|
|
The Undying
Forum posts: 249
File comments: 423
Uploads: 19
|
Permission
Please can I have permission to package this with my plugins? The only thing I would remove is the examples - or not as you wish. It would just save the PM's I get asking me why my plugin doesn't work...
|
|
|
08-25-2011, 08:51 PM
|
|
The Wary
Forum posts: 0
File comments: 1
Uploads: 0
|
Turbine utilities
Where, exactly, does the Turbine Utilities required for this go?
|
|
|
06-27-2011, 06:42 PM
|
|
The Wary
Forum posts: 0
File comments: 2
Uploads: 0
|
Little help
Hello there In order for Tonicbars to work I have had to use an older version then the current v2.5b Because you can not make bar extensions.
In v2.5b Tonicbars and Dragbars seem to be meshing ok.
But I am using Tonicbars v2.4 and for some reason I can not move my TonicBars.
I have Dragbars 1.3b Installed I have changed the lines as per previous posts in this thread.
I use plugin manager and I can see DragBar Demo 1,2,3 there but when I type in /plugins load Dragbar or /plugins load Dragbars it says unable to load.
Also on a smaller note I do not see much on how this program works. I see a post that says I use the following lines:
self.Window.DragBar.sName=s
self.Window.DragBar.Label:SetText( s )
But I have no idea what that means and what I should put, to me it sounds like its targeting "self" as in my character and do I put some name in like my bar name where you have written sName=s? If there was just a basic guide of any kind, I can not seem to find one however.
Any Ideas?
PS I see that this is for developers to use on there plugins, So I am guessing I will have to wait for Tonicbars to be working correctly. btw I tried Tonicbars r120 aswell no go
Last edited by Bloodpact : 06-27-2011 at 07:27 PM.
|
|
|
02-27-2011, 09:11 AM
|
|
The Undying
Forum posts: 249
File comments: 423
Uploads: 19
|
Re: Request
Quote:
I have a request. I would like to allow people to use DragBar along with TonicBars (basically if it's there it'll use it, and if not, it'll use my basic tabs). But I was working out bar names / titles and I can't seem to change the name after it's created. That's an issue as people can change the names of my bars on the fly and expect to see the value changed.
So, can you please add a way for me to change the bar name without having to create a new one? Thanks.
|
I use the following lines...
Code:
self.Window.DragBar.sName=s
self.Window.DragBar.Label:SetText( s )
|
|
|
02-13-2011, 10:15 AM
|
|
The Undefeated
Forum posts: 8
File comments: 247
Uploads: 1
|
Request
I have a request. I would like to allow people to use DragBar along with TonicBars (basically if it's there it'll use it, and if not, it'll use my basic tabs). But I was working out bar names / titles and I can't seem to change the name after it's created. That's an issue as people can change the names of my bars on the fly and expect to see the value changed.
So, can you please add a way for me to change the bar name without having to create a new one? Thanks.
|
|
|
12-05-2010, 10:52 AM
|
|
The Undying
Forum posts: 249
File comments: 423
Uploads: 19
|
Quote:
Ah! Thanks for catching this. I completely missed this because I simply unzipped the new Turbine Utilities over the old Turbine Utilities and didn't notice that Turbine.Utils doesn't exist in the new file structure.
|
A pleasure! After all - none of my plugins would work without this, so thanks for your work!
|
|
|
12-05-2010, 01:40 AM
|
|
The Wary
Forum posts: 0
File comments: 25
Uploads: 4
|
Quote:
To get this working on the current US live server I have had to make the following changes;
Under Plugins/DeusDictum/UI
Code:
DragBar.lua; Change line 7 to --import "Turbine.Utils";
DeltaButtonControl.lua; Change line 6 to --import "Turbine.Utils";
DeltaButtonWindow.lua; Change line 6 to --import "Turbine.Utils";
Then all is well!
You may not need to make these changes, so panic not!
|
Ah! Thanks for catching this. I completely missed this because I simply unzipped the new Turbine Utilities over the old Turbine Utilities and didn't notice that Turbine.Utils doesn't exist in the new file structure.
|
|
|
12-05-2010, 01:39 AM
|
|
The Wary
Forum posts: 0
File comments: 25
Uploads: 4
|
Quote:
now I have:
DragBarDemoOne (1.3)
DragBarDemoThree (1.2)
DragBarDemoTwo (1.2)
Am I supposed to have these three?
Only DemoOne is 1.3 ?
If somethings wrong - what do I need to change please?
|
If you are only using DragBar because some other plugin requires it, you technically don't need these so it doesn't matter what version these are and you can delete their folders and .plugin files from your Plugins\Deusdictum folder.
If you are going to be writing a plugin / Lua code using the DragBar class, these three plugins are simply demos. It does not matter that only one is 1.3. When I wrote these a) I was notorious for forgetting to update the version number and b) just because I updated one demo didn't mean I updated all three. So, I think that is actually correct. The last time I updated the demos, I only updated DemoOne, so it is 1.3 and the rest are still 1.2.
|
|
|
12-04-2010, 05:08 AM
|
|
The Undying
Forum posts: 249
File comments: 423
Uploads: 19
|
To get this working on the current US live server I have had to make the following changes;
Under Plugins/DeusDictum/UI
Code:
DragBar.lua; Change line 7 to --import "Turbine.Utils";
DeltaButtonControl.lua; Change line 6 to --import "Turbine.Utils";
DeltaButtonWindow.lua; Change line 6 to --import "Turbine.Utils";
Then all is well!
You may not need to make these changes, so panic not!
|
|
|
11-29-2010, 06:05 PM
|
|
The Unscathed
Forum posts: 16
File comments: 27
Uploads: 0
|
I just downloaded version 1.3 - extracted all to the Plugins folder. Told it to overwrite Yes to All.
In game I did a /plugins refresh
and now I have:
DragBarDemoOne (1.3)
DragBarDemoThree (1.2)
DragBarDemoTwo (1.2)
Am I supposed to have these three?
Only DemoOne is 1.3 ?
If somethings wrong - what do I need to change please?
|
|
|
09-17-2010, 01:41 PM
|
|
The Wary
Forum posts: 0
File comments: 25
Uploads: 4
|
Quote:
Will it allow me to make the main toolbar ... moveable?
|
Sorry, no, it won't. Currently, the DragBar can only be attached to other plugin controls and must be attached via Lua code.
This means it will primarily be used by other developers as a shortcut to providing the DragBar functionality in their own plugins. For example, BuffBars ( http://www.lotrointerface.com/downlo...-BuffBars.html) will use a DragBar if you have it installed.
|
|
|
All times are GMT -5. The time now is 04:23 AM.
|
|