public
Description: WoW Addon - Lua error manager
Homepage: http://www.tekkub.net/
Clone URL: git://github.com/tekkub/tekerr.git
Click here to lend your support to: tekerr and make a donation at www.pledgie.com !
tekkub (author)
Sat Aug 23 14:05:24 -0700 2008
commit  7c64b5f5bcc8733e3361bb4fe9d40fa102344c03
tree    32a486593a3dd1a7b5fd58c73ce482df37e0756c
parent  904ff4c60a0c74eb229e068fa8406916be0c89c5
tekerr / MinimapButton.lua
100644 63 lines (52 sloc) 1.784 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
function tekErrMinimapButton()
local frame = CreateFrame("Button", nil, Minimap)
frame:SetWidth(31)
frame:SetHeight(31)
frame:SetFrameStrata("LOW")
frame:SetHighlightTexture("Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight")
frame:SetPoint("RIGHT", Minimap, "LEFT")
 
local icon = frame:CreateTexture(nil, "BACKGROUND")
icon:SetTexture("Interface\\Icons\\INV_Elemental_Primal_Fire")
icon:SetPoint("TOPLEFT", 6, -6)
icon:SetPoint("BOTTOMRIGHT", -6, 6)
 
local overlay = frame:CreateTexture(nil, "OVERLAY")
overlay:SetTexture("Interface\\Minimap\\MiniMap-TrackingBorder")
overlay:SetWidth(53)
overlay:SetHeight(53)
overlay:SetPoint("TOPLEFT")
 
frame:RegisterForClicks("AnyUp")
 
frame:SetScript("OnMouseDown", function(self) icon:SetTexCoord(.1,.9,.1,.9) end)
frame:SetScript("OnMouseUp", function(self)
icon:SetTexCoord(0,1,0,1)
ShowUIPanel(tekErrPanel)
end)
 
frame:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "BOTTOMRIGHT")
GameTooltip:AddLine("tekErr")
GameTooltip:AddLine("You have new script errors!",.8,.8,.8,1)
GameTooltip:Show()
end)
frame:SetScript("OnLeave", function() GameTooltip:Hide() end)
 
frame:SetMovable(true)
frame:EnableMouse(true)
frame:RegisterForDrag("LeftButton")
frame:SetScript("OnDragStart", function(self) self:StartMoving() end)
frame:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
icon:SetTexCoord(0,1,0,1)
end)
 
local el = 0
local BLINKRATE = 1
frame:SetScript("OnUpdate", function(self, elapsed)
local alpha = (el <= BLINKRATE) and el or (BLINKRATE*2)-el
frame:SetAlpha(alpha/BLINKRATE)
el = el + elapsed
if el >= (BLINKRATE*2) then el = 0 end
end)
frame:SetScript("OnShow", function(self)
self:SetAlpha(0)
el = 0
end)
 
frame:Hide()
 
return frame
end