vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1  
2 function DHUD_FrameSlider_OnLoad(low, high, step)
3 getglobal(this:GetName().."Low"):SetText(low);
4 getglobal(this:GetName().."High"):SetText(high);
5 this:SetMinMaxValues(low, high);
6 this:SetValueStep(step);
7  
8 PanelTemplates_SetNumTabs(DHUDOptionsFrame, 3);
9 DHUDOptionsFrame.selectedTab = 1;
10 PanelTemplates_UpdateTabs(DHUDOptionsFrame);
11 end
12  
13 function DHUD_FrameSlider_OnValueChanged(key,text,st)
14  
15 local m;
16 local value;
17  
18 if st == 0 then
19 m = 0;
20 end
21  
22 if st == 1 then
23 m = 10;
24 end
25  
26 if st == 2 then
27 m = 100;
28 end
29  
30 if st == 3 then
31 m = 1000;
32 end
33  
34 if st ~= 0 then
35 value = math.floor( this:GetValue() * m ) / m;
36 else
37 value = math.floor( this:GetValue() );
38 end
39  
40 -- hack ;)
41 if key == "playermanatextx" or key == "targetmanatextx" or key == "petmanatextx" then
42 value = 0 - value;
43 end
44  
45 DHUD_SetConfig(key, value);
46 getglobal(this:GetName().."Text"):SetText(text.." "..value.." ");
47 DHUD_init();
48 end
49  
50 function DHUD_Options_OnShow(key,text)
51 getglobal(this:GetName()):SetValue(DHUD_Config[key]);
52 getglobal(this:GetName().."Text"):SetText(text.." "..DHUD_Config[key].." ");
53 end
54  
55 function DHUD_TabButton_OnClick( )
56  
57 PanelTemplates_Tab_OnClick( DHUDOptionsFrame )
58  
59 local selected = DHUDOptionsFrame.selectedTab
60  
61 if selected == 1 then
62 DHUD_Tab1:Show()
63 else
64 DHUD_Tab1:Hide()
65 end
66  
67 if selected == 2 then
68 DHUD_Tab2:Show()
69 else
70 DHUD_Tab2:Hide()
71 end
72  
73 if selected == 3 then
74 DHUD_Tab3:Show()
75 else
76 DHUD_Tab3:Hide()
77 end
78 end
79  
80  
81 function DHUD_ColorPicker_ColorChanged()
82 local r, g, b = ColorPickerFrame:GetColorRGB();
83  
84 --DHUD_Config[ColorPickerFrame.objindex] = DHUD_DecToHex(r,g,b);
85 DHUD_SetColor(ColorPickerFrame.objindex,DHUD_DecToHex(r,g,b));
86 getglobal(ColorPickerFrame.tohue):SetTexture(r,g,b);
87 DHUD_init();
88 end
89  
90 function DHUD_ColorPicker_OnClick()
91  
92 local Red, Green, Blue
93 Red, Green, Blue = DHUD_hextodec(DHUD_Config[this.objindex]);
94 ColorPickerFrame.previousValues = {Red, Green, Blue}
95 ColorPickerFrame.cancelFunc = DHUD_ColorPicker_Cancelled
96 --ColorPickerFrame.opacityFunc = xxx
97 ColorPickerFrame.func = DHUD_ColorPicker_ColorChanged
98 ColorPickerFrame.objindex = this.objindex
99 ColorPickerFrame.tohue = this.tohue
100 ColorPickerFrame.hasOpacity = false
101 ColorPickerFrame:SetColorRGB(Red, Green, Blue)
102 ColorPickerFrame:ClearAllPoints()
103 local x = DHUDOptionsFrame:GetCenter()
104 if (x < UIParent:GetWidth() / 2) then
105 ColorPickerFrame:SetPoint("LEFT", "DHUDOptionsFrame", "RIGHT", 0, 0)
106 else
107 ColorPickerFrame:SetPoint("RIGHT", "DHUDOptionsFrame", "LEFT", 0, 0)
108 end
109  
110 ColorPickerFrame:Show()
111 end
112  
113 function DHUD_ColorPicker_Cancelled(color)
114  
115 local r,g,b = unpack(color);
116  
117 --DHUD_Config[ColorPickerFrame.objindex] = DHUD_DecToHex(r,g,b);
118 DHUD_SetColor(ColorPickerFrame.objindex,DHUD_DecToHex(r,g,b));
119 getglobal(ColorPickerFrame.tohue):SetTexture(r,g,b);
120 DHUD_init();
121  
122 end