Thread Tools Display Modes
Prev Previous Post   Next Post Next
11-21-20, 11:33 PM   #1
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
CharacterMicroButton:Click() not working

Hi,

im creating a new micro menu and wanted to use the click functions (to avoid taints).
It is working for all micro menu buttons except character.

When I do:

Lua Code:
  1. CharacterMicroButton:Click()

Nothing happens...

Is there somethign special about this button?

*EDIT*

Nevermind. They taint anyway. Since ShowUIPanel and HideUIPanel are forbidden in fight now I tried to do the following:

Lua Code:
  1. local function showUIPanel(frame, _, duplicated)
  2.     if (frame and not frame:IsShown() and (not duplicated) and InCombatLockdown()) then
  3.         local point, _, relativePoint, xOff, yOff = frame:GetPoint()
  4.  
  5.         frame:ClearAllPoints()
  6.         frame:SetPoint(point or "CENTER", FRAMES.UIParent, relativePoint or "CENTER", xOff or 0, yOff or 0)
  7.         frame:Show()
  8.     end
  9. end
  10.  
  11. local function hideUIPanel(frame, _, duplicated)
  12.     if (frame and frame:IsShown() and (not duplicated) and InCombatLockdown()) then
  13.         frame:Hide()
  14.     end
  15. end
  16.  
  17. hooksecurefunc("ShowUIPanel", function(frame, force, duplicated)
  18.     showUIPanel(frame, force, duplicated)
  19. end)
  20. hooksecurefunc("HideUIPanel", function(frame, force, duplicated)
  21.     hideUIPanel(frame, force, duplicated)
  22. end)

This is working for most of the buttons but for example not for the spell book frame.

Is there any way to get this working without any taints or is the way to go:

"This is not allowed during combat!"?

Last edited by Lybrial : 11-22-20 at 12:40 AM. Reason: new informations
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » CharacterMicroButton:Click() not working

Thread Tools
Display Modes

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