vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --===========================================================================--
2 ---------------------------- LootTracker by PNB ----------------------------
3 --===========================================================================--
4 -- LootTrackerGeneralSettingsUI.lua
5 --
6 -- Code behind the general settings UI
7 --===========================================================================--
8  
9  
10 ------------------------------------------------------------------------------
11 -- ShowChatColorPicker
12 ------------------------------------------------------------------------------
13  
14 function LT_ShowChatColorPicker()
15  
16 local color = LT_White;
17  
18 -- Get our current chat color
19 local settings = LT_GetSettings();
20 if (settings ~= nil) then
21 color = settings.ChatColor;
22 end
23  
24 -- Initialize the color picker
25 ColorPickerFrame.func = LT_ColorPickerUpdate;
26 ColorPickerFrame.cancelFunc = LT_ColorPickerCancel;
27 ColorPickerFrame.hasOpacity = false;
28 ColorPickerFrame.previousValue = color;
29 ColorPickerFrame:SetColorRGB(color.r, color.g, color.b);
30  
31 -- Show the color picker
32 ColorPickerFrame:Show();
33  
34 end
35  
36  
37 ------------------------------------------------------------------------------
38 -- ColorPickerUpdate
39 ------------------------------------------------------------------------------
40  
41 function LT_ColorPickerUpdate()
42 local color = {}
43 color.r, color.g, color.b = ColorPickerFrame:GetColorRGB();
44  
45 -- Set the new chat color
46 local settings = LT_GetSettings();
47 if (settings ~= nil) then
48 settings.ChatColor = color;
49 end
50 end
51  
52  
53 ------------------------------------------------------------------------------
54 -- ColorPickerCancel
55 ------------------------------------------------------------------------------
56  
57 function LT_ColorPickerCancel()
58 -- Reset the value
59 local settings = LT_GetSettings();
60 if (settings ~= nil) then
61 settings.ChatColor = ColorPickerFrame.previousValue;
62 end
63 end