c7542a4 - Phasing function changed in 9.0
[wowui.git] / OmaTMW / TirnaHelper.lua
1 -- TirnaHelper.lua
2 local _;
3 local frame = CreateFrame("Frame", "OmaTirna", UIParent);
4
5 local function init()
6     frame:UnregisterAllEvents();
7     frame:SetPoint("TOP", UIParent, "TOP", -300, -250);
8     frame:SetWidth(1);
9     frame:SetHeight(1);
10     for i = 0,2 do
11         for j = 0,3 do
12             local button = CreateFrame("CheckButton", "OmaTirna"..i..j, frame);
13             button:SetPoint("TOPLEFT", frame, "TOPLEFT", i*52, j*42);
14             button:SetWidth(50);
15             button:SetHeight(40);
16             button.normal = button:CreateTexture(nil, "BACKGROUND");
17             button.normal:SetAllPoints();
18             button.normal:SetColorTexture(0.4, 0.4, 0.4);
19             button:SetNormalTexture(button.normal);
20             button.check = button:CreateTexture(nil, "BACKGROUND");
21             button.check:SetAllPoints();
22             button.check:SetColorTexture(0.9, 0.9, 0.9);
23             button:SetCheckedTexture(button.check);
24         end
25     end
26     frame:Hide();
27 end
28
29 frame:SetScript("OnEvent", init);
30 frame:RegisterEvent("PLAYER_LOGIN");
31
32 SLASH_OMATIRNA1 = "/tirna";
33 function SlashCmdList.OMATIRNA()
34     if frame:IsShown() then
35         frame:Hide();
36     else
37         frame:Show();
38     end
39 end