LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Interface Requests (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=5)
-   -   A request for all plugin authors (https://www.lotrointerface.com/forums/showthread.php?t=1515)

Emberleaf 05-31-2011 02:38 PM

A request for all plugin authors
 
Hello all,

I have a (relatively) small request for all you amazing plugin authors out there. If your plugin has a visible toggle button (or any other visible aspect, really) associated with it, could you please (if possible) make it so this disappears like the rest of the UI when F12 is pressed? It would sure make taking screenshots a lot easier. I realize that I could simply unload the plugins in question, but sometimes I'm trying to capture something in a split second and...well...you get the idea.

Thanks in advance, and please keep up the awesome work!

Digital_Utopia 05-31-2011 04:31 PM

Quote:

Originally Posted by Emberleaf (Post 6560)
Hello all,

I have a (relatively) small request for all you amazing plugin authors out there. If your plugin has a visible toggle button (or any other visible aspect, really) associated with it, could you please (if possible) make it so this disappears like the rest of the UI when F12 is pressed? It would sure make taking screenshots a lot easier. I realize that I could simply unload the plugins in question, but sometimes I'm trying to capture something in a split second and...well...you get the idea.

Thanks in advance, and please keep up the awesome work!

I think that's a fair request - and to help out, below is an example of how to do so:

Code:

self.KeyDown = function(sender,args)
    if (args.Action == 268435635)then
          if(self.myPlugin:IsVisible()==true)then
              self.myPlugin:SetVisible(false)
          else
              self.myPlugin:SetVisible(true)
          end
    end
end

In this example "myPlugin" would obviously be the main window that your plugin is displayed in, and the code would exist in whatever class you generated this window in.

Now, for both the OP and other authors, there is one caveat. The action alone only tells the author whether someone has pressed the key that shows/hides the UI, with no information pertaining to the actual state of the UI at the time. Now with this (unlike UI positioning) it isn't so bad, as it is unlikely that someone would be able to load a plugin with the UI hidden. Even still, the author should provide some option to assist the user in "syncing" the plugin with the game.

MrJackdaw 05-31-2011 04:35 PM

Or, if you use the Dragbar class - this seems to be automatic!

D.H1cks 05-31-2011 06:06 PM

Yup, I did this for the travel window's toggle button. It is a fair request.

Emberleaf 05-31-2011 07:09 PM

Quote:

Originally Posted by D.H1cks (Post 6563)
Yup, I did this for the travel window's toggle button. It is a fair request.

And I, for one, greatly appreciate it! Now, if we can get the MoorMap and Lotro Compendium plugins to follow suit, I will be one very happy little hobbit. =P

Fortunis 06-02-2011 08:25 AM

Is this number/amount the same for all nationality of keyboard.

(args.Action == 268435635)

because i cant get it to acknowledge that the f12 key has been pressed.

Garan 06-02-2011 10:09 AM

Quote:

Originally Posted by Emberleaf (Post 6564)
And I, for one, greatly appreciate it! Now, if we can get the MoorMap and Lotro Compendium plugins to follow suit, I will be one very happy little hobbit. =P

MoorMap has had this functionality for many months, as has AltInventory. Due to the fact that there is no way to detect the UI state, I've chosen not to hide the minimized button when the HUD is clear as that would innevitably lead to someone getting confused when they load their plugins with the UI already hidden (such as by binding PluginManager to a quickslot). Instead I provided the option of eliminating the minimized button and using a chat command which can be bound to a quickslot. If you go to the options and uncheck the "Show Icon When Minimized" option you can then bind the toggle command ("/moormap toggle") to a quickslot and the icon will no longer show when you use the Escape action (typically bound to Esc) or toggle the HUD (typically bound to F12). This eliminates any inconsistent behavior from the Plugin due to the fact that Turbine does not expose the state of the UI (which I really hope Turbine changes but there's MANY more important things for them to fix first).

Garan 06-02-2011 10:13 AM

Quote:

Originally Posted by Fortunis (Post 6565)
Is this number/amount the same for all nationality of keyboard.

(args.Action == 268435635)

because i cant get it to acknowledge that the f12 key has been pressed.

It's not bound to a key so keyboard and nationality are irrelevant. 268435635 is the code bound to the "toggle HUD" action which in turn is bound to a distinct keystroke in the keybindings. Go to your Options dialog (typically Ctrl+O), select "Key Mapping" on the right side, then scroll down until you see the "Toggle HUD On/Off" action entry. Whatever key is mapped to that action is what will clear your HUD and fire the KeyDown event with args.Action=268435635

Fortunis 06-02-2011 10:19 AM

Ty for your replies. I noticed the typo and tried SetVisible and IsVisible. Also im aware of the keybind and it is F12 for me, so thats not the issue, and as youve pointed out to me that its nothing to do with a keypress signature, rather the lotro code. It leaves me wondering why it aint working for me :s

I placed a Turbine.Shell.WriteLine command in its structure but got nothing.

Garan 06-02-2011 10:30 AM

Quote:

Originally Posted by Fortunis (Post 6568)
Ty for your replies. I noticed the typo and tried SetVisible and IsVisible. Also im aware of the keybind and it is F12 for me, so thats not the issue, and as youve pointed out to me that its nothing to do with a keypress signature, rather the lotro code. It leaves me wondering why it aint working for me :s

I placed a Turbine.Shell.WriteLine command in its structure but got nothing.

And I gather you didn't take the "self.myPlugin" literally. That needs to be replaced by a reference to the actual window being affected.

Did you put the WriteLine inside the If statement or just inside the start of the function definition - if it's just inside the function, you should get responses from any action event, such as showing bags, hitting escape, etc. If you aren't getting that, then you need to check where you are defining the function and be sure you don't already have another .KeyDown function defined elsewhere for that control. Oh and be sure you didn't SetWantsKeyEvents(false) for that control.


All times are GMT -5. The time now is 09:52 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI