Guest User

GarrisonReportButton

a guest
Nov 16th, 2014
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. local config = {
  2. ["showGarrison"] = true,
  3. }
  4.  
  5.  
  6. if config.showGarrison == true then
  7. local menuFrame = CreateFrame('Frame', 'picomenuDropDownMenu', MainMenuBar, 'UIDropDownMenuTemplate')
  8.  
  9.  
  10. local f = CreateFrame('Button', nil, PicoMenuBar)
  11. f:SetFrameStrata('LOW')
  12. f:SetSize(50,50)
  13. f:SetPoint('BOTTOMLEFT', 5, 10)
  14. f:RegisterForClicks('Anyup')
  15. f:RegisterEvent('ADDON_LOADED')
  16.  
  17. f:SetNormalTexture('Interface\\AddOns\\qusemap\\picomenu\\picomenuNormal')
  18. f:GetNormalTexture():SetSize(50,50)
  19.  
  20. f:SetHighlightTexture('Interface\\AddOns\\qusemap\\picomenu\\picomenuHighlight')
  21. f:GetHighlightTexture():SetAllPoints(f:GetNormalTexture())
  22.  
  23. f:SetScript('OnMouseDown', function(self)
  24.     self:GetNormalTexture():ClearAllPoints()
  25.     self:GetNormalTexture():SetPoint('CENTER', 1, -1)
  26. end)
  27.  
  28. f:SetScript('OnMouseUp', function(self, button)
  29.     self:GetNormalTexture():ClearAllPoints()
  30.     self:GetNormalTexture():SetPoint('CENTER')
  31.         if (self:IsMouseOver()) then
  32.             --ToggleFrame(GameMenuFrame)
  33.         GarrisonLandingPageMinimapButton_OnClick()
  34.         end
  35.  
  36.     GameTooltip:Hide()
  37. end)
  38.  
  39. f:SetScript('OnEnter', function(self)
  40.     GameTooltip:SetOwner(self, 'ANCHOR_TOPLEFT', 25, -5)
  41.     GameTooltip:AddLine('Garrison Report')
  42.     GameTooltip:Show()
  43. end)
  44.  
  45. f:SetScript('OnLeave', function()
  46.     GameTooltip:Hide()
  47. end)
  48. end
Advertisement
Add Comment
Please, Sign In to add comment