9713040 - Incremental refactor of raid frames
[wowui.git] / OmaUF / Settings.lua
1 -- Settings.lua
2 local PowerTypeMana = Enum.PowerType.Mana;
3 local PowerTypeRage = Enum.PowerType.Rage;
4 local PowerTypeFocus = Enum.PowerType.Focus;
5 local PowerTypeEnergy = Enum.PowerType.Energy;
6 local PowerTypeRunic = Enum.PowerType.RunicPower;
7 local rawget = rawget;
8
9 -- configurable settings
10 -- character specific settings
11 local charDefaults = {
12     Clickheal = {},
13 };
14 local chars = {
15     ["Sylvanas"] = {
16         ["Vildana"] = {
17             Clickheal = {
18                 ["type1"] = "spell",
19                 ["type2"] = "spell",
20                 ["shift-type1"] = "spell",
21                 ["shift-type2"] = "spell",
22                 ["ctrl-type1"] = "spell",
23                 ["alt-type2"] = "spell",
24                 ["alt-shift-type1"] = "spell",
25                 ["alt-shift-type2"] = "spell",
26                 ["spell1"] = "Holy Light",
27                 ["spell2"] = "Bestow Faith",
28                 ["shift-spell1"] = "Flash of Light",
29                 ["shift-spell2"] = "Light of the Martyr",
30                 ["ctrl-spell1"] = "Cleanse",
31                 ["alt-spell2"] = "Lay on Hands",
32                 ["alt-shift-spell1"] = "Beacon of Light",
33                 ["alt-shift-spell2"] = "Beacon of Faith",
34             },
35         },
36     },
37     ["Stormreaver"] = {
38         ["Vildan"] = {
39             Clickheal = {
40                 ["type1"] = "spell",
41                 ["type2"] = "spell",
42                 ["shift-type1"] = "spell",
43                 ["shift-type2"] = "spell",
44                 ["ctrl-type1"] = "macro",
45                 ["alt-type2"] = "spell",
46                 ["alt-shift-type1"] = "spell",
47                 ["alt-shift-type2"] = "spell",
48                 ["spell1"] = "Holy Light",
49                 ["spell2"] = "Bestow Faith",
50                 ["shift-spell1"] = "Flash of Light",
51                 ["shift-spell2"] = "Light of the Martyr",
52                 ["ctrl-macro1"] = "Cleansing",
53                 ["alt-spell2"] = "Lay on Hands",
54                 ["alt-shift-spell1"] = "Beacon of Light",
55                 ["alt-shift-spell2"] = "Beacon of Faith",
56             },
57         },
58         ["Gedren"] = {
59             Clickheal = {
60                 ["type1"] = "spell",
61                 ["type2"] = "spell",
62                 ["shift-type1"] = "spell",
63                 ["shift-type2"] = "spell",
64                 ["ctrl-type1"] = "spell",
65                 ["alt-type2"] = "spell",
66                 ["spell1"] = "Healing Touch",
67                 ["spell2"] = "Lifebloom",
68                 ["shift-spell1"] = "Regrowth",
69                 ["shift-spell2"] = "Swiftmend",
70                 ["ctrl-spell1"] = "Nature's Cure",
71                 ["alt-spell2"] = "Rebirth",
72             },
73         },
74         ["Gilden"] = {
75             AnchorX = 0,
76             AnchorY = -330,
77             Clickheal = {
78                 ["type1"] = "spell",
79                 ["type2"] = "spell",
80                 ["shift-type1"] = "spell",
81                 ["shift-type2"] = "spell",
82                 ["ctrl-type1"] = "spell",
83                 ["spell1"] = "Power Word: Shield",
84                 ["spell2"] = "Penance",
85                 ["shift-spell1"] = "Shadow Mend",
86                 ["shift-spell2"] = "Shadow Covenant",
87                 ["ctrl-spell1"] = "Purify",
88             },
89         },
90     },
91 };
92
93 -- account-wide settings
94 local settings = {
95     Player = {
96         Width = 160,
97         Height = 50,
98         AnchorX = -300,
99         AnchorY = -175,
100     },
101     Pet = {
102         Width = 80,
103         Height = 25,
104         AnchorX = -10,
105         AnchorY = 0,
106     },
107     Target = {
108         Width = 160,
109         Height = 50,
110         AnchorX = 300,
111         AnchorY = -175,
112     },
113     Boss = {
114         Width = 140,
115         Height = 30,
116         AnchorX = 550,
117         AnchorY = 300,
118     },
119     BaseColor = {0, 0, 0, 0.5},
120     BgColor = {0.1, 0.1, 0.1, 0.4},
121     HealthColor = {0.5, 0.5, 0.5},
122     ShieldColor = {0.1, 0.8, 1},
123     ShieldhlColor = {0.5, 0.8, 1},
124     HealpredColor = {0.5, 0.6, 0.5},
125     PowerColors = {
126         [PowerTypeMana] = {0, 0.5, 1},
127         [PowerTypeRage] = {1, 0, 0},
128         [PowerTypeFocus] = {1, 0.5, 0},
129         [PowerTypeEnergy] = {1, 0.8, 0},
130         [PowerTypeRunic] = {0.8, 0, 0.2},
131     },
132 };
133 OmaUFSettings = settings;
134 -- watch to not remove mana entry
135 setmetatable(settings.PowerColors, {__index = function(t) return rawget(t, PowerTypeMana) end});
136
137 function OmaUFLoadChar()
138     local name, realm = UnitFullName("player");
139     if chars[realm] and chars[realm][name] then
140         settings.Character = chars[realm][name];
141     else
142         settings.Character = charDefaults;
143     end
144 end