vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 function AtlasButton_OnClick()
2 Atlas_Toggle();
3 end
4  
5 function AtlasButton_Init()
6 if(AtlasOptions.AtlasButtonShown) then
7 AtlasButtonFrame:Show();
8 else
9 AtlasButtonFrame:Hide();
10 end
11 end
12  
13 function AtlasButton_Toggle()
14 if(AtlasButtonFrame:IsVisible()) then
15 AtlasButtonFrame:Hide();
16 AtlasOptions.AtlasButtonShown = false;
17 else
18 AtlasButtonFrame:Show();
19 AtlasOptions.AtlasButtonShown = true;
20 end
21 AtlasOptions_Init();
22 end
23  
24 function AtlasButton_UpdatePosition()
25 AtlasButtonFrame:SetPoint(
26 "TOPLEFT",
27 "Minimap",
28 "TOPLEFT",
29 54 - (78 * cos(AtlasOptions.AtlasButtonPosition)),
30 (78 * sin(AtlasOptions.AtlasButtonPosition)) - 55
31 );
32 AtlasOptions_Init();
33 end
34  
35 -- Thanks to Yatlas for this code
36 function AtlasButton_BeingDragged()
37 -- Thanks to Gello for this code
38 local xpos,ypos = GetCursorPosition()
39 local xmin,ymin = Minimap:GetLeft(), Minimap:GetBottom()
40  
41 xpos = xmin-xpos/UIParent:GetScale()+70
42 ypos = ypos/UIParent:GetScale()-ymin-70
43  
44 AtlasButton_SetPosition(math.deg(math.atan2(ypos,xpos)));
45 end
46  
47 function AtlasButton_SetPosition(v)
48 if(v < 0) then
49 v = v + 360;
50 end
51  
52 AtlasOptions.AtlasButtonPosition = v;
53 AtlasButton_UpdatePosition();
54 end
55  
56 function AtlasButton_OnEnter()
57 GameTooltip:SetOwner(this, "ANCHOR_LEFT");
58 GameTooltip:SetText(ATLAS_BUTTON_TOOLTIP);
59 GameTooltip:AddLine(ATLAS_BUTTON_TOOLTIP2);
60 GameTooltip:AddLine(ATLAS_BUTTON_TOOLTIP3);
61 GameTooltip:Show();
62 end