3 local frame = CreateFrame("Frame", "OmaTirna", UIParent);
7 frame:UnregisterAllEvents();
8 frame:SetPoint("TOP", UIParent, "TOP", -300, -250);
13 local button = CreateFrame("CheckButton", "OmaTirna"..i..j, frame);
14 button:SetPoint("TOPLEFT", frame, "TOPLEFT", i*52, j*42);
17 button.bg = button:CreateTexture(nil, "BACKGROUND");
18 button.bg:SetAllPoints();
19 button.bg:SetColorTexture(1, 1, 1);
20 button.bg:SetVertexColor(0.2, 0.2, 0.2, 0.3);
21 button.normal = button:CreateTexture(nil, "BORDER");
22 button.normal:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2);
23 button.normal:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2);
24 button.normal:SetColorTexture(0.5, 0.5, 0.5);
25 button:SetNormalTexture(button.normal);
26 button.check = button:CreateTexture(nil, "BORDER");
27 button.check:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2);
28 button.check:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2);
29 button.check:SetColorTexture(0.9, 0.9, 0.9);
30 button:SetCheckedTexture(button.check);
31 button:SetScript("OnClick", function(self)
34 local check, notcheck;
36 local f = frames[i*4+j+1];
37 f.bg:SetVertexColor(0.2, 0.2, 0.2, 0.3);
38 if f:GetChecked() then
46 check.bg:SetVertexColor(1, 0.2, 0.1, 0.9);
48 notcheck.bg:SetVertexColor(1, 0.2, 0.1, 0.9);
52 frames[i*4+j+1] = button;
55 local button = CreateFrame("Button", "OmaTirnaReset", frame);
56 button:SetPoint("TOPRIGHT", frame, "TOPLEFT", -2, 0);
59 button.normal = button:CreateTexture(nil, "BACKGROUND");
60 button.normal:SetAllPoints();
61 button.normal:SetColorTexture(0.4, 0.4, 0.4);
62 button:SetNormalTexture(button.normal);
63 button:SetScript("OnClick", function()
64 for _, f in ipairs(frames) do
66 f.bg:SetVertexColor(0.2, 0.2, 0.2, 0.3);
69 frame.leaf = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight");
70 frame.leaf:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 0, 42*3);
71 frame.leaf:SetText("Lehti");
72 frame.fill = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight");
73 frame.fill:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 52, 42*3);
74 frame.fill:SetText("Täysi");
75 frame.circle = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight");
76 frame.circle:SetPoint("BOTTOMLEFT", frame, "TOPLEFT", 104, 42*3);
77 frame.circle:SetText("Kehä");
81 frame:SetScript("OnEvent", init);
82 frame:RegisterEvent("PLAYER_LOGIN");
84 SLASH_OMATIRNA1 = "/tirna";
85 function SlashCmdList.OMATIRNA()
86 if frame:IsShown() then