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(PERL_LOCALIZED_CONFIG_SMALL); |
||
56 | Perl_Config_CombatDisplay_Frame_Slider1High:SetText(PERL_LOCALIZED_CONFIG_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 | |||
93 | if (vartable["rightclickmenu"] == 1) then |
||
94 | Perl_Config_CombatDisplay_Frame_CheckButton14:SetChecked(1); |
||
95 | else |
||
96 | Perl_Config_CombatDisplay_Frame_CheckButton14:SetChecked(nil); |
||
97 | end |
||
98 | |||
99 | if (vartable["fivesecsupport"] == 1) then |
||
100 | Perl_Config_CombatDisplay_Frame_CheckButton15:SetChecked(1); |
||
101 | else |
||
102 | Perl_Config_CombatDisplay_Frame_CheckButton15:SetChecked(nil); |
||
103 | end |
||
104 | |||
105 | if (vartable["displaypercents"] == 1) then |
||
106 | Perl_Config_CombatDisplay_Frame_CheckButton16:SetChecked(1); |
||
107 | else |
||
108 | Perl_Config_CombatDisplay_Frame_CheckButton16:SetChecked(nil); |
||
109 | end |
||
110 | end |
||
111 | |||
112 | function Perl_Config_CombatDisplay_Mode_Update() |
||
113 | if (Perl_Config_CombatDisplay_Frame_CheckButton1:GetChecked() == 1) then |
||
114 | Perl_CombatDisplay_Set_State(1); |
||
115 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton2:GetChecked() == 1) then |
||
116 | Perl_CombatDisplay_Set_State(2); |
||
117 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton3:GetChecked() == 1) then |
||
118 | Perl_CombatDisplay_Set_State(3); |
||
119 | elseif (Perl_Config_CombatDisplay_Frame_CheckButton4:GetChecked() == 1) then |
||
120 | Perl_CombatDisplay_Set_State(0); |
||
121 | else |
||
122 | Perl_Config_CombatDisplay_Frame_CheckButton4:SetChecked(1); |
||
123 | Perl_CombatDisplay_Set_State(0); |
||
124 | end |
||
125 | end |
||
126 | |||
127 | function Perl_Config_CombatDisplay_Health_Persistance_Update() |
||
128 | if (Perl_Config_CombatDisplay_Frame_CheckButton5:GetChecked() == 1) then |
||
129 | Perl_CombatDisplay_Set_Health_Persistance(1); |
||
130 | else |
||
131 | Perl_CombatDisplay_Set_Health_Persistance(0); |
||
132 | end |
||
133 | end |
||
134 | |||
135 | function Perl_Config_CombatDisplay_Mana_Persistance_Update() |
||
136 | if (Perl_Config_CombatDisplay_Frame_CheckButton6:GetChecked() == 1) then |
||
137 | Perl_CombatDisplay_Set_Mana_Persistance(1); |
||
138 | else |
||
139 | Perl_CombatDisplay_Set_Mana_Persistance(0); |
||
140 | end |
||
141 | end |
||
142 | |||
143 | function Perl_Config_CombatDisplay_Lock_Update() |
||
144 | if (Perl_Config_CombatDisplay_Frame_CheckButton8:GetChecked() == 1) then |
||
145 | Perl_CombatDisplay_Set_Lock(1); |
||
146 | else |
||
147 | Perl_CombatDisplay_Set_Lock(0); |
||
148 | end |
||
149 | end |
||
150 | |||
151 | function Perl_Config_CombatDisplay_Target_Update() |
||
152 | if (Perl_Config_CombatDisplay_Frame_CheckButton10:GetChecked() == 1) then |
||
153 | Perl_CombatDisplay_Set_Target(1); |
||
154 | else |
||
155 | Perl_CombatDisplay_Set_Target(0); |
||
156 | end |
||
157 | end |
||
158 | |||
159 | function Perl_Config_CombatDisplay_MobHealth_Update() |
||
160 | if (Perl_Config_CombatDisplay_Frame_CheckButton11:GetChecked() == 1) then |
||
161 | Perl_CombatDisplay_Set_MobHealth(1); |
||
162 | else |
||
163 | Perl_CombatDisplay_Set_MobHealth(0); |
||
164 | end |
||
165 | end |
||
166 | |||
167 | function Perl_Config_CombatDisplay_DruidBar_Update() |
||
168 | if (Perl_Config_CombatDisplay_Frame_CheckButton12:GetChecked() == 1) then |
||
169 | Perl_CombatDisplay_Set_DruidBar(1); |
||
170 | else |
||
171 | Perl_CombatDisplay_Set_DruidBar(0); |
||
172 | end |
||
173 | end |
||
174 | |||
175 | function Perl_Config_CombatDisplay_PetBars_Update() |
||
176 | if (Perl_Config_CombatDisplay_Frame_CheckButton13:GetChecked() == 1) then |
||
177 | Perl_CombatDisplay_Set_PetBars(1); |
||
178 | else |
||
179 | Perl_CombatDisplay_Set_PetBars(0); |
||
180 | end |
||
181 | end |
||
182 | |||
183 | function Perl_Config_CombatDisplay_Right_Click_Update() |
||
184 | if (Perl_Config_CombatDisplay_Frame_CheckButton14:GetChecked() == 1) then |
||
185 | Perl_CombatDisplay_Set_Right_Click(1); |
||
186 | else |
||
187 | Perl_CombatDisplay_Set_Right_Click(0); |
||
188 | end |
||
189 | end |
||
190 | |||
191 | function Perl_Config_CombatDisplay_FiveSec_Update() |
||
192 | if (Perl_Config_CombatDisplay_Frame_CheckButton15:GetChecked() == 1) then |
||
193 | Perl_CombatDisplay_Set_FiveSec(1); |
||
194 | else |
||
195 | Perl_CombatDisplay_Set_FiveSec(0); |
||
196 | end |
||
197 | end |
||
198 | |||
199 | function Perl_Config_CombatDisplay_Display_Percents_Update() |
||
200 | if (Perl_Config_CombatDisplay_Frame_CheckButton16:GetChecked() == 1) then |
||
201 | Perl_CombatDisplay_Set_Display_Percents(1); |
||
202 | else |
||
203 | Perl_CombatDisplay_Set_Display_Percents(0); |
||
204 | end |
||
205 | end |
||
206 | |||
207 | function Perl_Config_CombatDisplay_Set_Scale(value) |
||
208 | if (Perl_CombatDisplay_Frame) then -- this check is to prevent errors if you aren't using CombatDisplay |
||
209 | if (value == nil) then |
||
210 | value = floor(UIParent:GetScale()*100+0.5); |
||
211 | Perl_Config_CombatDisplay_Frame_Slider1Text:SetText(value); |
||
212 | Perl_Config_CombatDisplay_Frame_Slider1:SetValue(value); |
||
213 | end |
||
214 | Perl_CombatDisplay_Set_Scale(value); |
||
215 | |||
216 | vartable = Perl_CombatDisplay_GetVars(); |
||
217 | if (floor(vartable["scale"]*100+0.5) == floor(UIParent:GetScale()*100+0.5)) then |
||
218 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(1); |
||
219 | else |
||
220 | Perl_Config_CombatDisplay_Frame_CheckButton9:SetChecked(nil); |
||
221 | end |
||
222 | end |
||
223 | end |
||
224 | |||
225 | function Perl_Config_CombatDisplay_Set_Transparency(value) |
||
226 | if (Perl_CombatDisplay_Frame) then -- this check is to prevent errors if you aren't using CombatDisplay |
||
227 | Perl_CombatDisplay_Set_Transparency(value); |
||
228 | end |
||
229 | end |