197ec73 - Tidy up OmaRF files
[wowui.git] / OmaRF / DruidIndicators.lua
1 -- DruidIndicators.lua
2 local pairs = pairs;
3
4 local indSize = OmaRFSettings.IndSize;
5 local rhomb = "Interface\\AddOns\\OmaRF\\images\\rhomb";
6 local square = "Interface\\AddOns\\OmaRF\\images\\square";
7 local positions = {"TOPLEFT"};
8
9 local M = {};
10 OmaRFIndicators.Class["DRUID"] = M;
11 M.Auras = {
12     ["Lifebloom"] = "TOPLEFT",
13     ["Rejuvenation"] = "TR1",
14     ["Cenarion Ward"] = "TR2",
15     ["Spring Blossoms"] = "TR3",
16     ["Regrowth"] = "TR4",
17     ["Cultivation"] = "TR5",
18 }
19
20 function M.Setup(base)
21     local inds = {};
22     for _, pos in pairs(positions) do
23         inds[pos] = base:CreateTexture(nil, "OVERLAY");
24         inds[pos]:SetPoint(pos, base, pos);
25         inds[pos]:SetWidth(indSize);
26         inds[pos]:SetHeight(indSize);
27         inds[pos]:SetTexture(rhomb);
28         inds[pos]:SetVertexColor(0, 1, 0);
29         inds[pos]:Hide();
30         inds[pos].text = base:CreateFontString(nil, "OVERLAY", "GameFontHighlight");
31         inds[pos].text:SetPoint("BOTTOMRIGHT", inds[pos], "BOTTOMRIGHT");
32         inds[pos].text:Hide();
33     end
34     for _, pos in pairs({"TR1", "TR2", "TR3", "TR4", "TR5"}) do
35         inds[pos] = base:CreateTexture(nil, "OVERLAY");
36         inds[pos]:SetWidth(indSize/2);
37         inds[pos]:SetHeight(indSize/2);
38         inds[pos]:SetTexture(square);
39         inds[pos]:Hide();
40     end
41     inds["TR1"]:SetPoint("TOPRIGHT");
42     inds["TR1"]:SetVertexColor(0.8, 0, 1);
43     inds["TR2"]:SetPoint("TOPRIGHT", inds["TR1"], "TOPLEFT");
44     inds["TR2"]:SetVertexColor(0.4, 1, 0);
45     inds["TR3"]:SetPoint("TOPRIGHT", inds["TR1"], "BOTTOMRIGHT");
46     inds["TR3"]:SetVertexColor(1, 0.2, 0);
47     inds["TR4"]:SetPoint("TOPRIGHT", inds["TR2"], "BOTTOMRIGHT");
48     inds["TR4"]:SetVertexColor(0, 1, 0);
49     inds["TR5"]:SetPoint("TOPRIGHT", inds["TR3"], "BOTTOMRIGHT");
50     inds["TR5"]:SetVertexColor(0, 1, 0.5);
51     return inds;
52 end