Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-15-12, 04:01 PM   #1
jostor
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Nov 2011
Posts: 10
OnClick only registering for the left mouse button?

Hey! I dislike the new 5.0 "feature" that changed the minimap button in battlegrounds which you use to show the scoreboard, and right click to for example leave the BG or interact with your queue to other BGs and so on. It no longer simply shows the scoreboard with a left click, it has an annoying menu with the scoreboard button way too close to the "Leave Battleground" button, and what I wanted to do was simply change it so that with the left mouse button you open the scoreboard, but with the right mouse button you open the regular menu as you normally would. For LFG instances (which now uses the same button) it should open the menu regardless of which button was used.

The first part was easy, getting the scoreboard to open with the left button, that part is working fine. However, the right mouse button simply does nothing, since my OnClick function doesn't have any code for it, but is there a simple way to make it work like it normally would, either by simply adding it into my if-clause, or having OnClick only registering the left mouse button.

Here's my code:

Lua Code:
  1. local frameCurrentlyShown = false
  2. QueueStatusMinimapButton:SetScript("OnClick", function(self, button)
  3.     isInstance, instanceType = IsInInstance()
  4.        
  5.     if isInstance and instanceType == "pvp" and button == "LeftButton" then
  6.         if frameCurrentlyShown then
  7.             WorldStateScoreFrame:Hide()
  8.             frameCurrentlyShown = false
  9.         else
  10.             WorldStateScoreFrame:Show()
  11.             frameCurrentlyShown = true
  12.         end
  13.     else
  14.         -- Show the regular menu
  15.     end
  16.  
  17. end)

Simply running DropDownList1:Show() (DropDownList1 is the name of the regular frame that pops up...) doesn't work, I assume since the frame also has to be filled with information.
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » OnClick only registering for the left mouse button?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off