ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Right-Click Toggling for Drop-Down Menu Display. (https://www.esoui.com/forums/showthread.php?t=4138)

BornDownUnder 12/14/14 05:49 AM

Right-Click Toggling for Drop-Down Menu Display.
 
As title states, it is my intention to have a drop-down menu that displays only when you right-click on a bar...

Everything seems set up just fine, the menu is perfect in display, functionality, just first time the bar is displayed per session the drop down menu is displayed as well. :confused:

Here are the bits of code that I can see as having an involvement in the issue, the rest is just variables for the display of the menu options (Taken from WLGF):
Code:

local function WLGF_RightClick_HideAll()
        for i = 1, 4, 1 do
                if (WLGF["RC_BG_group"..i] ~= nil) then
                        WLGF["RC_BG_group"..i]:SetHidden(true)
                end
        end
end --WLGF_RightClick_HideAll()

        if (WLGF["RC_BG_"..owner]:IsHidden()) then

                WLGF["RC_BG_"..owner]:SetAnchor(BOTTOMLEFT, GuiRoot, TOPLEFT, mouseLeft,mouseTop)
                WLGF["RC_BG_"..owner]:SetHidden(false)

local function WLGF_RightClick_Click(button, owner)
        if (button == 2) then
                WLGF_RightClick_Toogle(owner)
        else
                WLGF["RC_BG_"..owner]:SetHidden(true)
        end
end --WLGF_RightClick_Click()

                WLGF["RC_BG_"..owner] = Chain(WINDOW_MANAGER:CreateControl("WLGF_RC_BG_"..owner, WLGF["Anchor_group"..num], CT_BACKDROP))
                        :SetDimensions(200,100)
                        :SetCenterTexture(center_tex)
                        :SetEdgeTexture(edge_tex, 128, 16)
                        :SetInsets(16,16,-16,-16)
                        :SetDrawLayer(1)
                        :SetHidden(false)
                .__END

Can anybody see in that code as to why the menu displays automatically upon group creation, only once, always the first group creation per play session :mad:

Note: WLGF is WarLegendsGroupFrames, I am planning on updating it and releasing it once I hear back from Lyeos.

Garkin 12/14/14 09:33 AM

Quote:

Originally Posted by BornDownUnder (Post 17840)
...<snip>...

Can anybody see in that code as to why the menu displays automatically upon group creation, only once, always the first group creation per play session :mad:

...<snip>...

Menu is displayed because you made it visible. see the difference:
Lua Code:
  1. --origial code:
  2.         WLGF["RC_BG_"..owner] = Chain(WINDOW_MANAGER:CreateControl("WLGF_RC_BG_"..owner, WLGF["Anchor_group"..num], CT_BACKDROP))
  3.             :SetDimensions(200,100)
  4.             :SetCenterTexture(center_tex)
  5.             :SetEdgeTexture(edge_tex, 128, 16)
  6.             :SetInsets(16,16,-16,-16)
  7.             :SetDrawLayer(1)
  8.             :SetHidden(true)
  9.         .__END
  10. --your code:
  11.         WLGF["RC_BG_"..owner] = Chain(WINDOW_MANAGER:CreateControl("WLGF_RC_BG_"..owner, WLGF["Anchor_group"..num], CT_BACKDROP))
  12.             :SetDimensions(200,100)
  13.             :SetCenterTexture(center_tex)
  14.             :SetEdgeTexture(edge_tex, 128, 16)
  15.             :SetInsets(16,16,-16,-16)
  16.             :SetDrawLayer(1)
  17.             :SetHidden(false)
  18.         .__END

BornDownUnder 12/14/14 08:42 PM

Quote:

Originally Posted by Garkin (Post 17841)
Menu is displayed because you made it visible.

zomg! I can't believe I didn't pick that up... I think from now on no more pulling near all-nighters to do code :rolleyes:


All times are GMT -6. The time now is 09:59 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI