d76a52e - Change width/height to global setting
[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     AnchorX = 0,
13     AnchorY = -330,
14     Clickheal = {
15     },
16 };
17 local chars = {
18     ["Stormreaver"] = {
19         ["Vildan"] = {
20             AnchorX = 0,
21             AnchorY = -330,
22             Clickheal = {
23                 ["type1"] = "spell",
24                 ["type2"] = "spell",
25                 ["shift-type1"] = "spell",
26                 ["shift-type2"] = "spell",
27                 ["ctrl-type1"] = "spell",
28                 ["alt-type2"] = "spell",
29                 ["alt-shift-type1"] = "spell",
30                 ["alt-shift-type2"] = "spell",
31                 ["spell1"] = "Holy Light",
32                 ["spell2"] = "Bestow Faith",
33                 ["shift-spell1"] = "Flash of Light",
34                 ["shift-spell2"] = "Light of the Martyr",
35                 ["ctrl-spell1"] = "Cleanse",
36                 ["alt-spell2"] = "Lay on Hands",
37                 ["alt-shift-spell1"] = "Beacon of Light",
38                 ["alt-shift-spell2"] = "Beacon of Faith",
39             },
40         },
41         ["Gedren"] = {
42             AnchorX = 0,
43             AnchorY = -330,
44             Clickheal = {
45                 ["type1"] = "spell",
46                 ["type2"] = "spell",
47                 ["shift-type1"] = "spell",
48                 ["shift-type2"] = "spell",
49                 ["ctrl-type1"] = "spell",
50                 ["alt-type2"] = "spell",
51                 ["spell1"] = "Healing Touch",
52                 ["spell2"] = "Lifebloom",
53                 ["shift-spell1"] = "Regrowth",
54                 ["shift-spell2"] = "Swiftmend",
55                 ["ctrl-spell1"] = "Nature's Cure",
56                 ["alt-spell2"] = "Rebirth",
57             },
58         },
59     },
60 };
61
62 -- account-wide settings
63 local settings = {
64     Width = 160,
65     Height = 50,
66     BaseColor = {0, 0, 0, 0.5},
67     BgColor = {0.1, 0.1, 0.1, 0.4},
68     HealthColor = {0.5, 0.5, 0.5},
69     ShieldColor = {0.1, 0.8, 1},
70     ShieldhlColor = {0.5, 0.8, 1},
71     HealpredColor = {0.5, 0.6, 0.5},
72     HealabsorbColor = {0.1, 0.1, 0.1},
73     OverlayColorDispel = {1, 0.5, 0, 0.5},
74     OverlayColorCharm = {0.8, 0, 1, 0.5},
75     OverlayColorAlert = {1, 0, 0, 0.5},
76     PowerColors = {
77         [PowerTypeMana] = {0, 0.5, 1},
78         [PowerTypeRage] = {1, 0, 0},
79         [PowerTypeFocus] = {1, 0.5, 0},
80         [PowerTypeEnergy] = {1, 0.8, 0},
81         [PowerTypeRunic] = {0.8, 0, 0.2},
82     },
83 };
84 OmaUFSettings = settings;
85 -- watch to not remove mana entry
86 setmetatable(settings.PowerColors, {__index = function(t) return rawget(t, PowerTypeMana) end});
87
88 function OmaUFLoadChar()
89     local name, realm = UnitFullName("player");
90     if chars[realm] and chars[realm][name] then
91         settings.Character = chars[realm][name];
92     else
93         settings.Character = charDefaults;
94     end
95 end