We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 22 of 22
  1. #1
    Join Date
    Jun 2010
    Posts
    21

    It's a secret to everyone (The Plugin Manager & Options)

    Hey guys,

    One of the new things most of you have seen on Bullroarer was the plugin manager which now allows for plugins to be configured for automatic loading. There are 3 things related to this of interests to plugin authors:

    1) When the main file of your plugin is loaded there is a special global variable "plugin" that is assigned to be your plugin's object. You can use this to add information to your plugin class and more importantly to register functions and events that the system uses. This was mainly implemented for the options panel support (below), but it should also be useful for register Unload events without the need to perform an Update/Wait/Register pattern. (*disclaimer* I haven't had a chance to test this myself yet though!)

    2) In the *.plugin files you can now specify an <Image></Image> element in the <Information/> element. This image will be used by the plugin manager as the icon for your plugin. The plugin manager wants a 32x32 icon and any other size will be cropped or tiled.

    3) Relating back to #1. This is how you can add your own options to the plugin manager. The plugin manager looks through all the plugin definitions for a GetOptionsPanel() function. It is expected to return a Turbine.UI.Control that will be parented inside of the options tab. That's really all you need to do. The control can listen for size changes and update it's layout.

    Here is a quick example of an options panel:

    Code:
    optionsPanel = Turbine.UI.Control();
    optionsPanel:SetBackColor( Turbine.UI.Color( 0.3, 0.3, 0.3 ) );
    optionsPanel:SetSize( 600, 600 );
    
    local testButton1 = Turbine.UI.Lotro.Button();
    testButton1:SetText( "Test Button 1" );
    testButton1:SetSize( 150, 22 );
    testButton1:SetPosition( 10, 10 );
    testButton1:SetParent( optionsPanel );
    
    testButton1.Click = function( sender, args )
      Turbine.Shell.WriteLine( "Heya!" );
    end
    
    local testButton2 = Turbine.UI.Lotro.Button();
    testButton2:SetText( "Test Button 2" );
    testButton2:SetSize( 150, 22 );
    testButton2:SetPosition( 10, 40 );
    testButton2:SetParent( optionsPanel );
    
    optionsPanel.SizeChanged = function( sender, args )
      local optionsPanelWidth = optionsPanel:GetWidth();
      testButton1:SetWidth( optionsPanelWidth - testButton1:GetLeft() * 2 );
      testButton2:SetWidth( optionsPanelWidth - testButton2:GetLeft() * 2 );
      
      optionsPanel:SetHeight( optionsPanelWidth );
    end
    
    plugin.GetOptionsPanel = function( self )
      return optionsPanel;
    end
    Last edited by ForsakenArcher; Nov 17 2011 at 04:43 PM.

  2. #2
    Join Date
    Aug 2007
    Posts
    62

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Very cool. Thanks for the information.
    Lycius [size=1][color="gray"][ELF HNT][/color][/size] / Dannav [size=1][color="gray"][MAN WDN][/color][/size] / Pius [size=1][color="gray"][HOB BUR][/color][/size]
    [i][color="gray"]Landroval[/color][/i]

  3. #3
    Join Date
    Jun 2009
    Location
    UK
    Posts
    1,461

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Thanks for this. I sent Narrel a message asking for exactly what you posted
    [CENTER][SIZE=3][B]Galuhad | Narvelan[/B]
    Lore Breakers of Eldar[/SIZE]

    [URL="http://www.lotrointerface.com/list.php?skinnerid=3762"]Plugins[/URL] | [URL="https://www.lotro.com/forums/showthread.php?538975-Accounts-for-New-Players"]New Player Guide[/URL] | [URL="http://www.twitch.tv/galuhad"]Twitch[/URL]
    [/CENTER]

  4. #4
    Join Date
    Dec 2007
    Location
    Seattle, WA
    Posts
    7,600

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Awesome, this is exactly what the Turbine Plugin Manager needed.

    Here's to hoping that us plugin authors can get these control panels implemented and tested before Update 5 goes live =)

    Edit:
    Any chance you can update the example plugins to better work with the manager?
    Maley Oakensage, Captain of Elendilmir

    Alas Elendilmir, may you *jingle jangle* forever in the Forgotten West

  5. #5
    Join Date
    Mar 2007
    Posts
    1,179

    Re: It's a secret to everyone (The Plugin Manager & Options)

    I kinda jumped the gate and had already updated the LoTRO Plugins for Noobs thread to include the Image and Description tags in the .plugin file yesterday

    I hadn't known about the Plugin variable. Sounds cool, but I'm wondering what happens with multiple plugins in the same apartment since it's global. I'll have to play with it a bit.

    EDIT: I see. The global variable "plugin" is only available while the plugin is loading. Interesting.

    Quote Originally Posted by ForsakenArcher View Post
    This was mainly implemented for the options panel support (below), but it should also be useful for register Unload events without the need to perform an Update/Wait/Register pattern. (*disclaimer* I haven't had a chance to test this myself yet though!)
    I got around to quite a bit of testing and it works beautifully for registering Unload event handlers and it also simplifies "loading" messages too:
    Turbine.Shell.WriteLine("Loadi ng "..plugin:GetName().." ver. "..plugin:GetVersion());

    I really like this
    Last edited by Garan; Nov 17 2011 at 09:07 PM.

  6. #6
    Join Date
    Mar 2007
    Posts
    1,780

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Very very nice. Thanks a lot for the quick update.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  7. #7
    Join Date
    Jun 2011
    Location
    Lancaster, England
    Posts
    81

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Excellent! I really must download bullroarer and have a look at this! Are there any other changes to the plugin system apart from this?

    EDIT: Can we register a slash command to open this option window?
    Formerly know as [B]MrJackdaw[/B]
    Author of [I]Bevy-o-Bars, SortPack, VBar[/I] and [I]BuffFrame[/I]
    Characters; [B]Dirmac[/B], [B]Dvarlin [/B]and [B]Fathiriel[/B]

  8. #8
    Join Date
    Jun 2010
    Posts
    21

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by Dvarlin View Post
    Excellent! I really must download bullroarer and have a look at this! Are there any other changes to the plugin system apart from this?

    EDIT: Can we register a slash command to open this option window?
    There already is one. If you check out "/plugins help" you'll see you can now use "/plugins manager" to open the manager up. Or you can just create an alias quickslot, etc.

  9. #9
    Join Date
    Jun 2011
    Location
    Lancaster, England
    Posts
    81

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by ForsakenArcher View Post
    There already is one. If you check out "/plugins help" you'll see you can now use "/plugins manager" to open the manager up. Or you can just create an alias quickslot, etc.
    Ah! Excellent! I haven't looked at the beta - I am downloading it now - so it is all new to me.

    This will make plugins more accessible to the masses, kudos to the development team!
    Formerly know as [B]MrJackdaw[/B]
    Author of [I]Bevy-o-Bars, SortPack, VBar[/I] and [I]BuffFrame[/I]
    Characters; [B]Dirmac[/B], [B]Dvarlin [/B]and [B]Fathiriel[/B]

  10. #10
    Join Date
    Apr 2007
    Posts
    8

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by ForsakenArcher View Post
    There already is one. If you check out "/plugins help" you'll see you can now use "/plugins manager" to open the manager up. Or you can just create an alias quickslot, etc.
    will there be a way to open directly to a plugin's option panel from Lua? ie. plugin.OpenOptionsPanel()

  11. #11
    Join Date
    Mar 2007
    Posts
    1,179

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by eluzive View Post
    will there be a way to open directly to a plugin's option panel from Lua? ie. plugin.OpenOptionsPanel()
    Since the "plugin" variable is only available while the plugin is loading, you would actually need something more like
    Plugins["YourPlugin"]:OpenOptionsPanel(); but it still sounds like a good idea.
    Last edited by Garan; Nov 18 2011 at 04:33 PM.

  12. #12
    Join Date
    Jun 2011
    Location
    Lancaster, England
    Posts
    81

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by Garan View Post
    Since the "plugin" variable is only available while the plugin is loading, you would actually need something more like
    Plugins["YourPlugin"]:OpenOptionsPanel(); but it still sounds like a good idea.
    Agreed - feature request ForsakenArcher!
    Formerly know as [B]MrJackdaw[/B]
    Author of [I]Bevy-o-Bars, SortPack, VBar[/I] and [I]BuffFrame[/I]
    Characters; [B]Dirmac[/B], [B]Dvarlin [/B]and [B]Fathiriel[/B]

  13. #13
    Join Date
    Mar 2007
    Posts
    1,780

    Re: It's a secret to everyone (The Plugin Manager & Options)

    While we have the very useful SizeChanged function, it appears there is no way to determine the width of the options panel when the plugin is run (ie: the width of the options panel is never forcibly set until the user manually resizes the plugin manager after loading the plugin). Let me know if I've missed something.

    This is quite annoying, as it means we have to just guess a starting width. Could this please be addressed? (perhaps by just setting the options panel width immediately after the plugin is loaded, and thus invoking the SizeChanged function). It is pretty much the only thing preventing me from making a nice looking menu. Thanks
    Last edited by Evendale; Nov 22 2011 at 11:59 PM.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  14. #14
    Join Date
    Mar 2007
    Posts
    108

    Re: It's a secret to everyone (The Plugin Manager & Options)

    After playing around with the options panel for a bit I have a request to make as well.

    Add a function call to the api to get the current dimensions of the options area.
    Something like PluginManager.GetOptionPanelSi ze().

    This will fix the problem Evendale is talking about as you could set the size when your panel is created appropriately.

    It will also enable plugin authors to create panels that have static content at the bottom of the window like tabs. With the current setup when your panel is bigger than the window automatic scrollbars appear pushing things like tabs at bottom off the screen. If I knew the dimensions I could set the size of my options panel so that scrollbars never appeared and manage the scrolling in an inner container myself. With a section of the screen real estate being taken up on the left side now with the plugin list I need to cut down on the horizontal space my options are taking, tabs would be a good fit to replace the buttons I have on the right side currently.

  15. #15
    Join Date
    Mar 2007
    Posts
    1,179

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Quote Originally Posted by Pengoros View Post
    If I knew the dimensions I could set the size of my options panel so that scrollbars never appeared and manage the scrolling in an inner container myself.
    One thing to be wary of, I noticed that if I included a vertical scrollbar bound to my options panel, it caused a client crash. Horizontal scrollbars worked fine. I suspect there was some issue between the Lua vertical scrollbar and the built-in scrollbar that the Plugin manager provides.

    I didn't test to see whether using an unbound vertical scroll bar would also cause crashes or if binding it to a child control would crash either so those may be suitable workarounds until this is fixed.

  16. #16
    Join Date
    Jun 2011
    Location
    Germany
    Posts
    902

    AW: It's a secret to everyone (The Plugin Manager & Options)

    Is the PM now on the live servers? Cant find it.
    Ah, Gotcha! Its live, nice!

    Its under: Menu"arrow"button->System(Mouseover)->PluginManager
    Last edited by Schinderhannes; Dec 12 2011 at 09:48 PM.
    Suggestions: Tasks [URL="http://goo.gl/rt4M5"]en[/URL]|[URL="http://goo.gl/BBbhC"]de[/URL]

  17. #17

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Lotro manager dont work as expected.

    http://www.lotrointerface.com/forums...=7474#post7474
    Ashannae(LM85 Taylor) Laureanna(Hunter85/Sch) Annaelen(Mins/78/cook) Moranae(Mins/76/WS)

  18. #18
    Join Date
    Mar 2007
    Posts
    1,780

    Re: It's a secret to everyone (The Plugin Manager & Options)

    It's great that the size is now being set on initialization and that we can manually open the menu (update 6).

    FYI to show your plugin options:
    Code:
    Turbine.PluginManager.ShowOptions(Plugins["MyPluginName"])
    (NB: calling that function with nil or an incorrect reference can crash the client)




    However, there is another bug that should really be fixed. If a plugin apartment is unloaded while one of the plugin's in that apartment is selected in the plugin manager options window (regardless of whether or not the window is open at the time), the plugin menu will still be visible to the user (when the menu is opened) and can be interacted with (though none of the plugin's mouseclick events etc seem to be run).

    Note that if all plugins are unloaded this bug does not occur. It only happens when an apartment is unloaded.

    This wouldn't be much of a problem on its own. But sometimes (not always) when the selected plugin is loaded again (while still selected in the options window, without having changed that selection), the client will crash.
    Last edited by Evendale; Mar 03 2012 at 11:43 PM.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  19. #19
    Join Date
    Mar 2007
    Posts
    1,780

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Ok it looks like the problem is worse than I thought. I think it may have changed in the last update.

    But now the issue is basically that:

    If you unload plugins (either all at once or by apartment) while one of the active plugins that has options in the plugin manager is selected in the plugins manager, the game will crash.

    It doesn't matter if the plugins window is open or not. So for example if someone goes "/buffbars options" (selecting Buffbars in the plugin manager), closes the manager window, then later decides to "/plugins unload", their game will crash.

    It seems to happen every time now.

    Afaict, the only workaround is to always make sure you don't have an active plugin selected in the manager before unloading.

    I'm sure a lot of people will be encountering this issue soon. Please don't wait too long to fix it.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  20. #20
    Join Date
    Mar 2007
    Posts
    1,780

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Oh, and while most people probably rarely unload plugins while playing, it also makes the game crash when you log off/quit (as plugins are unloaded first). So it is quite a big problem really!
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  21. #21

    Re: It's a secret to everyone (The Plugin Manager & Options)

    Did some poking around. Here's what I can tell...

    Simpler options panels are less likely to cause a crash. For example, for BuffBars, if I disabled all the tabs (never created any of the sub-options panels), unloading didn't cause a crash. If I disabled all of them but the Log options, it almost never crashed, while the other tabs by themselves seemed to be more likely to cause crashes.

    A plugin that's been automatically loaded seems to cause a crash more frequently than one that's manually loaded in game.
    A plugin that's loaded for the first time seems to cause a crash more frequently than one that's been unloaded and reloaded multiple times.
    The first login of a client session seems to result in a crash more frequently than subsequent logins.

    It's messy enough that determining which parts of the options panels need to be disabled before crashes no longer occur (or seriously decrease in frequency) is difficult.

  22. #22
    Join Date
    Mar 2007
    Posts
    1,780
    Quote Originally Posted by moebius92 View Post
    Simpler options panels are less likely to cause a crash. For example, for BuffBars, if I disabled all the tabs (never created any of the sub-options panels), unloading didn't cause a crash. If I disabled all of them but the Log options, it almost never crashed, while the other tabs by themselves seemed to be more likely to cause crashes.
    So I seem to have worked around the issue in CA now based on this observation. I've been able to unload and reload the plugin a large number of times with no issues, even with the Options tab selected while doing the unloading/reloading, and even though it (in the new version) has a huge menu (and was causing frequent crashes before the fix).

    During the Plugin Unload event, I firstly remove all controls from my menu panel (easy since the base control is a simple tabbed pane), which is probably the only thing that's actually necessary to prevent crashes. But I also remove any event functions on the menu panel, set its parent to nil, set it to not visible, and set the only reference to it to nil. Finally, I make a call to collectgarbage() just in case...

    It would be nice if they actually fixed it properly though.
    Last edited by Evendale; Nov 10 2012 at 06:54 PM.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload