-
Notifications
You must be signed in to change notification settings - Fork 0
/
AccountantButton.lua
48 lines (42 loc) · 1.27 KB
/
AccountantButton.lua
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
--[[
$Id: AccountantButton.lua 77 2013-11-01 08:52:21Z arith $
]]
function AccountantButton_OnEnter(self)
GameTooltip:SetOwner(self, "ANCHOR_LEFT");
GameTooltip:SetText(ACCLOC_TITLE);
GameTooltipTextLeft1:SetTextColor(1, 1, 1);
GameTooltip:AddLine(ACCLOC_TIP);
GameTooltip:Show();
end
function AccountantButton_OnClick()
if AccountantFrame:IsVisible() then
HideUIPanel(AccountantFrame);
else
ShowUIPanel(AccountantFrame);
end
end
function AccountantButton_Init()
if(Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].showbutton) then
AccountantButtonFrame:Show();
else
AccountantButtonFrame:Hide();
end
end
function AccountantButton_Toggle()
if(AccountantButtonFrame:IsVisible()) then
AccountantButtonFrame:Hide();
Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].showbutton = false;
else
AccountantButtonFrame:Show();
Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].showbutton = true;
end
end
function AccountantButton_UpdatePosition()
AccountantButtonFrame:SetPoint(
"TOPLEFT",
"Minimap",
"TOPLEFT",
55 - (75 * cos(Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].buttonpos)),
(75 * sin(Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].buttonpos)) - 55
);
end