vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function Perl_Config_CombatDisplay_Display() |
2 | Perl_Config_Hide_All(); |
||
3 | if (Perl_CombatDisplay_Frame) then |
||
4 | Perl_Config_CombatDisplay_Frame:Show(); |
||
5 | Perl_Config_CombatDisplay_Set_Values(); |
||
6 | else |
||
7 | Perl_Config_CombatDisplay_Frame:Hide(); |
||
8 | Perl_Config_NotInstalled_Frame:Show(); |
||
9 | end |
||
10 | end |
||
11 | |||
12 | function Perl_Config_CombatDisplay_Set_Values() |
||
13 | local vartable = Perl_CombatDisplay_GetVars(); |
||
14 | |||
15 | if (vartable["state"] == 1) then |
||
16 | Perl_Config_CombatDisplay_Frame_CheckButton1:SetChecked(1); |
||
17 | Perl_Config_CombatDisplay_Frame_CheckButton2:SetChecked(nil); |
||
18 | Perl_Config_CombatDisplay_Frame_CheckButton3:SetChecked(nil); |
||
19 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(nil); |
||
20 | elseif (vartable["state"] == 2) then |
||
21 | Perl_Config_CombatDisplay_Frame_CheckButton1:SetChecked(nil); |
||
22 | Perl_Config_CombatDisplay_Frame_CheckButton2:SetChecked(1); |
||
23 | Perl_Config_CombatDisplay_Frame_CheckButton3:SetChecked(nil); |
||
24 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(nil); |
||
25 | elseif (vartable["state"] == 3) then |
||
26 | Perl_Config_CombatDisplay_Frame_CheckButton1:SetChecked(nil); |
||
27 | Perl_Config_CombatDisplay_Frame_CheckButton2:SetChecked(nil); |
||
28 | Perl_Config_CombatDisplay_Frame_CheckButton3:SetChecked(1); |
||
29 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(nil); |
||
30 | else |
||
31 | Perl_Config_CombatDisplay_Frame_CheckButton1:SetChecked(nil); |
||
32 | Perl_Config_CombatDisplay_Frame_CheckButton2:SetChecked(nil); |
||
33 | Perl_Config_CombatDisplay_Frame_CheckButton3:SetChecked(nil); |
||
34 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(1); |
||
35 | end |
||
36 | |||
37 | if (vartable["healthpersist"] == 1) then |
||
38 | Perl_Config_CombatDisplay_Frame_CheckButton5:SetChecked(1); |
||
39 | else |
||
40 | Perl_Config_CombatDisplay_Frame_CheckButton5:SetChecked(nil); |
||
41 | end |
||
42 | |||
43 | if (vartable["manapersist"] == 1) then |
||
44 | Perl_Config_CombatDisplay_Frame_CheckButton6:SetChecked(1); |
||
45 | else |
||
46 | Perl_Config_CombatDisplay_Frame_CheckButton6:SetChecked(nil); |
||
47 | end |
||
48 | |||
49 | if (vartable["locked"] == 1) then |
||
50 | Perl_Config_CombatDisplay_Frame_CheckButton8:SetChecked(1); |
||
51 | else |
||
52 | Perl_Config_CombatDisplay_Frame_CheckButton8:SetChecked(nil); |
||
53 | end |
||
54 | |||
55 | Perl_Config_CombatDisplay_Frame_Slider1Low:SetText("Small"); |
||
56 | Perl_Config_CombatDisplay_Frame_Slider1High:SetText("Big"); |
||
57 | Perl_Config_CombatDisplay_Frame_Slider1:SetValue(floor(vartable["scale"]*100+0.5)); |
||
58 | |||
59 | if (floor(vartable["scale"]*100+0.5) == floor(UIParent:GetScale()*100+0.5)) then |
||
60 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(1); |
||
61 | else |
||
62 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(nil); |
||
63 | end |
||
64 | |||
65 | Perl_Config_CombatDisplay_Frame_Slider2Low:SetText("0"); |
||
66 | Perl_Config_CombatDisplay_Frame_Slider2High:SetText("100"); |
||
67 | Perl_Config_CombatDisplay_Frame_Slider2:SetValue(vartable["transparency"]*100); |
||
68 | |||
69 | if (vartable["showtarget"] == 1) then |
||
70 | Perl_Config_CombatDisplay_Frame_CheckButton10:SetChecked(1); |
||
71 | else |
||
72 | Perl_Config_CombatDisplay_Frame_CheckButton10:SetChecked(nil); |
||
73 | end |
||
74 | |||
75 | if (vartable["mobhealthsupport"] == 1) then |
||
76 | Perl_Config_CombatDisplay_Frame_CheckButton11:SetChecked(1); |
||
77 | else |
||
78 | Perl_Config_CombatDisplay_Frame_CheckButton11:SetChecked(nil); |
||
79 | end |
||
80 | |||
81 | if (vartable["showdruidbar"] == 1) then |
||
82 | Perl_Config_CombatDisplay_Frame_CheckButton12:SetChecked(1); |
||
83 | else |
||
84 | Perl_Config_CombatDisplay_Frame_CheckButton12:SetChecked(nil); |
||
85 | end |
||
86 | |||
87 | if (vartable["showpetbars"] == 1) then |
||
88 | Perl_Config_CombatDisplay_Frame_CheckButton13:SetChecked(1); |
||
89 | else |
||
90 | Perl_Config_CombatDisplay_Frame_CheckButton13:SetChecked(nil); |
||
91 | end |
||
92 | end |
||
93 | |||
94 | function Perl_Config_CombatDisplay_Mode_Update() |
||
95 | if (Perl_Config_CombatDisplay_Frame_CheckButton1:GetChecked() == 1) then |
||
96 | Perl_CombatDisplay_Set_State(1); |
||
97 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton2:GetChecked() == 1) then |
||
98 | Perl_CombatDisplay_Set_State(2); |
||
99 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton3:GetChecked() == 1) then |
||
100 | Perl_CombatDisplay_Set_State(3); |
||
101 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton4:GetChecked() == 1) then |
||
102 | Perl_CombatDisplay_Set_State(0); |
||
103 | else |
||
104 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(1); |
||
105 | Perl_CombatDisplay_Set_State(0); |
||
106 | end |
||
107 | end |
||
108 | |||
109 | function Perl_Config_CombatDisplay_Health_Persistance_Update() |
||
110 | if (Perl_Config_CombatDisplay_Frame_CheckButton5:GetChecked() == 1) then |
||
111 | Perl_CombatDisplay_Set_Health_Persistance(1); |
||
112 | else |
||
113 | Perl_CombatDisplay_Set_Health_Persistance(0); |
||
114 | end |
||
115 | end |
||
116 | |||
117 | function Perl_Config_CombatDisplay_Mana_Persistance_Update() |
||
118 | if (Perl_Config_CombatDisplay_Frame_CheckButton6:GetChecked() == 1) then |
||
119 | Perl_CombatDisplay_Set_Mana_Persistance(1); |
||
120 | else |
||
121 | Perl_CombatDisplay_Set_Mana_Persistance(0); |
||
122 | end |
||
123 | end |
||
124 | |||
125 | function Perl_Config_CombatDisplay_Lock_Update() |
||
126 | if (Perl_Config_CombatDisplay_Frame_CheckButton8:GetChecked() == 1) then |
||
127 | Perl_CombatDisplay_Set_Lock(1); |
||
128 | else |
||
129 | Perl_CombatDisplay_Set_Lock(0); |
||
130 | end |
||
131 | end |
||
132 | |||
133 | function Perl_Config_CombatDisplay_Target_Update() |
||
134 | if (Perl_Config_CombatDisplay_Frame_CheckButton10:GetChecked() == 1) then |
||
135 | Perl_CombatDisplay_Set_Target(1); |
||
136 | else |
||
137 | Perl_CombatDisplay_Set_Target(0); |
||
138 | end |
||
139 | end |
||
140 | |||
141 | function Perl_Config_CombatDisplay_MobHealth_Update() |
||
142 | if (Perl_Config_CombatDisplay_Frame_CheckButton11:GetChecked() == 1) then |
||
143 | Perl_CombatDisplay_Set_MobHealth(1); |
||
144 | else |
||
145 | Perl_CombatDisplay_Set_MobHealth(0); |
||
146 | end |
||
147 | end |
||
148 | |||
149 | function Perl_Config_CombatDisplay_DruidBar_Update() |
||
150 | if (Perl_Config_CombatDisplay_Frame_CheckButton12:GetChecked() == 1) then |
||
151 | Perl_CombatDisplay_Set_DruidBar(1); |
||
152 | else |
||
153 | Perl_CombatDisplay_Set_DruidBar(0); |
||
154 | end |
||
155 | end |
||
156 | |||
157 | function Perl_Config_CombatDisplay_PetBars_Update() |
||
158 | if (Perl_Config_CombatDisplay_Frame_CheckButton13:GetChecked() == 1) then |
||
159 | Perl_CombatDisplay_Set_PetBars(1); |
||
160 | else |
||
161 | Perl_CombatDisplay_Set_PetBars(0); |
||
162 | end |
||
163 | end |
||
164 | |||
165 | function Perl_Config_CombatDisplay_Set_Scale(value) |
||
166 | if (Perl_CombatDisplay_Frame) then -- this check is to prevent errors if you aren't using CombatDisplay |
||
167 | if (value == nil) then |
||
168 | value = floor(UIParent:GetScale()*100+0.5); |
||
169 | Perl_Config_CombatDisplay_Frame_Slider1Text:SetText(value); |
||
170 | Perl_Config_CombatDisplay_Frame_Slider1:SetValue(value); |
||
171 | end |
||
172 | Perl_CombatDisplay_Set_Scale(value); |
||
173 | |||
174 | vartable = Perl_CombatDisplay_GetVars(); |
||
175 | if (floor(vartable["scale"]*100+0.5) == floor(UIParent:GetScale()*100+0.5)) then |
||
176 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(1); |
||
177 | else |
||
178 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(nil); |
||
179 | end |
||
180 | end |
||
181 | end |
||
182 | |||
183 | function Perl_Config_CombatDisplay_Set_Transparency(value) |
||
184 | if (Perl_CombatDisplay_Frame) then -- this check is to prevent errors if you aren't using CombatDisplay |
||
185 | Perl_CombatDisplay_Set_Transparency(value); |
||
186 | end |
||
187 | end |