-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccountantOptions.lua
66 lines (57 loc) · 2.24 KB
/
AccountantOptions.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--[[
$Id: AccountantOptions.lua 77 2013-11-01 08:52:21Z arith $
]]
ACCOUNTANT_OPTIONS_TITLE = ACCLOC_OPTS;
function AccountantOptions_Toggle()
--[[
if(AccountantOptionsFrame:IsVisible()) then
AccountantOptionsFrame:Hide();
else
AccountantOptionsFrame:Show();
end
]]
if(InterfaceOptionsFrame:IsVisible()) then
InterfaceOptionsFrame:Hide();
else
InterfaceOptionsFrame_OpenToCategory("Accountant Classic");
InterfaceOptionsFrame_OpenToCategory("Accountant Classic");
end
end
function AccountantOptions_OnLoad(panel)
UIPanelWindows['AccountantOptionsFrame'] = {area = 'center', pushable = 0};
-- panel = _G["AccountantOptionsFrame"];
panel.name = ACCLOC_TITLE;
InterfaceOptions_AddCategory(panel);
if (LibStub:GetLibrary("LibAboutPanel", true)) then
-- lib.new(parent, addonname);
LibStub("LibAboutPanel").new(ACCLOC_TITLE, "Accountant_Classic");
end
end
function AccountantOptions_OnShow()
AccountantOptionsFrameToggleButtonText:SetText(ACCLOC_MINIBUT);
AccountantSliderButtonPosText:SetText(ACCLOC_BUTPOS);
AccountantOptionsFrameWeekLabel:SetText(ACCLOC_STARTWEEK);
AccountantOptionsFrameToggleButton:SetChecked(Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].showbutton);
AccountantSliderButtonPos:SetValue(Accountant_SaveData[GetRealmName()][UnitName("player")]["options"].buttonpos);
UIDropDownMenu_Initialize(AccountantOptionsFrameWeek, AccountantOptionsFrameWeek_Init);
UIDropDownMenu_SetSelectedID(AccountantOptionsFrameWeek, Accountant_SaveData[Accountant_Server][Accountant_Player]["options"].weekstart);
end
function AccountantOptions_OnHide(self)
if(MYADDONS_ACTIVE_OPTIONSFRAME == self) then
ShowUIPanel(myAddOnsFrame);
end
end
function AccountantOptionsFrameWeek_Init()
local info;
Accountant_DayList = {ACCLOC_WD_SUN,ACCLOC_WD_MON,ACCLOC_WD_TUE,ACCLOC_WD_WED,ACCLOC_WD_THU,ACCLOC_WD_FRI,ACCLOC_WD_SAT};
for i = 1, getn(Accountant_DayList), 1 do
info = { };
info.text = Accountant_DayList[i];
info.func = AccountantOptionsFrameWeek_OnClick;
UIDropDownMenu_AddButton(info);
end
end
function AccountantOptionsFrameWeek_OnClick(self)
UIDropDownMenu_SetSelectedID(AccountantOptionsFrameWeek, self:GetID());
Accountant_SaveData[Accountant_Server][Accountant_Player]["options"].weekstart = self:GetID();
end