View Single Post
02-02-15, 08:38 PM   #18
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Okay well... Nothing going back from that has anything to do with anything of any importance how ever.... as i started to weed out the stuff that it did show i got some new data. It pointed to this particular section of code and my use of of the setattribute and then the hide/show of the micro bar.
Lua Code:
  1. local addonName, addon = ...
  2.  
  3. --[[-----------------------------------------------------------------------------
  4. GrimUI options/config button
  5. -------------------------------------------------------------------------------]]
  6. local GUI_ConfigButton = CreateFrame('Button', GUI_ConfigButton, UIParent, 'SecureHandlerClickTemplate')
  7. GUI_ConfigButton:SetSize(62, 30)
  8. GUI_ConfigButton:RegisterForClicks('AnyUp')
  9. GUI_ConfigButton:SetNormalTexture([[Interface\AddOns\]] .. addonName .. [[\Media\ConfigButton]])
  10. GUI_ConfigButton:SetHighlightTexture([[Interface\AddOns\]] .. addonName .. [[\Media\ConfigButton]])
  11. GUI_ConfigButton:SetPoint('BOTTOMRIGHT', addon.skin, 'TOPRIGHT', -2, 0)
  12.    
  13. GUI_ConfigButton:SetAttribute('_onclick', [[
  14.     if button == 'LeftButton' and not IsControlKeyDown() and not IsAltKeyDown() then
  15.         local microBar = self:GetFrameRef("microBar")
  16.         if microBar:IsVisible() then
  17.             microBar:Hide()
  18.         else
  19.             microBar:Show()
  20.         end
  21.     elseif button == 'RightButton' and not IsControlKeyDown() then
  22.         control:CallMethod("OpenConfig")
  23.     end
  24. ]])
  25.  
  26. function GUI_ConfigButton:OpenConfig()
  27.     if addon.configPanel and addon.configPanel:IsVisible() then
  28.         InterfaceOptionsFrame:Hide()
  29.     else
  30.         addon.configPanel(GrimUI)
  31.         addon.configPanel(GrimUI)
  32.     end
  33. end
  34.  
  35.  
  36. GUI_ConfigButton:SetScript('OnEnter', function(self)
  37.     GameTooltip:SetOwner(self, 'ANCHOR_TOP', 0, 15)
  38.     GameTooltip:AddLine("|cffeda55fLeftClick|r toggle MicroBar", 0.2, 1, 0.2)
  39.     GameTooltip:AddLine("|cffeda55fRightClick|r Options Panel", 0.2, 1, 0.2)
  40.     if Macaroon then
  41.         GameTooltip:AddLine("|cffeda55fCtrl+LeftClick|r Button Binds", 0.2, 1, 0.2)
  42.         GameTooltip:AddLine("|cffeda55fCtrl+RightClick|r Button Config", 0.2, 1, 0.2)
  43.     end
  44.     GameTooltip:AddLine("|cffeda55fAlt+LeftClick|r Toggle VolumeBar", 0.2, 1, 0.2)
  45.     GameTooltip:Show()
  46. end)
  47.  
  48. GUI_ConfigButton:HookScript("OnClick", function(self, button)
  49.     if Macaroon then
  50.         if button == 'LeftButton' and IsControlKeyDown() then
  51.             Macaroon.ButtonBind(off)
  52.         elseif IsControlKeyDown() and button == 'RightButton' then
  53.             Macaroon.ConfigBars()
  54.         end
  55.     end
  56.     if button == 'LeftButton' and IsAltKeyDown() then
  57.         if addon.settings.showVolume == true then
  58.             addon.settings.showVolume = false
  59.             addon:GUI_ShowVolume()
  60.         elseif addon.settings.showVolume == false then
  61.             addon.settings.showVolume = true
  62.             addon:GUI_ShowVolume()
  63.         end
  64.     end
  65. end)
  66.  
  67. GUI_ConfigButton:SetScript('OnLeave', addon.HideTooltip)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote