vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 UIPanelWindows["UltimateUIFeatureFrame"] = { area = "left", pushable = 10 };
2  
3 ULTIMATEUIFEATUREFRAME_PAGESIZE = 14;
4  
5 UltimateUIFeatureFrame_Offset = 0;
6  
7 function ToggleUltimateUIFeatureFrame()
8 if (UltimateUIFeatureFrame:IsVisible()) then
9 HideUIPanel(UltimateUIFeatureFrame);
10 else
11 ShowUIPanel(UltimateUIFeatureFrame);
12 end
13 end
14  
15 function UltimateUIButton_OnHide()
16 UpdateMicroButtons();
17 PlaySound("igSpellBookClose");
18 end
19  
20 function UltimateUIButtons_UpdateColor()
21 local value = nil;
22 for id = 1, 14 do
23 value = UltimateUIMaster_Buttons[id+UltimateUIFeatureFrame_Offset];
24 if ( value ) then
25 local test_function = value[CSM_TESTFUNCTION];
26 if (test_function ~= nil) then
27 local icon = getglobal("UltimateUIFeaturesButton"..id);
28 local iconTexture = getglobal("UltimateUIFeaturesButton"..id.."IconTexture");
29  
30 if (test_function() == false) then
31 icon:Disable();
32 iconTexture:SetVertexColor(1.00, 0.00, 0.00);
33 else
34 icon:Enable();
35 iconTexture:SetVertexColor(1.00, 1.00, 1.00);
36 end
37 end
38 end
39 end
40 end
41  
42 function UltimateUIButton_OnShow()
43 UpdateMicroButtons();
44 UltimateUIFeaturesTitleText:SetText(TEXT(ULTIMATEUI_FEATURES_TITLE));
45 PlaySound("igSpellBookOpen");
46 UltimateUIButtons_UpdateColor();
47 end
48  
49 function UltimateUIButton_OnEnter()
50 local value = UltimateUIMaster_Buttons[this:GetID()+UltimateUIFeatureFrame_Offset];
51 if (value) then
52 UltimateUITooltip:SetOwner(this, "ANCHOR_RIGHT");
53 UltimateUITooltip:SetText(value[CSM_LONGDESCRIPTION], 1.0, 1.0, 1.0);
54 return;
55 end
56 end
57  
58 function UltimateUIButton_OnClick()
59 local value = UltimateUIMaster_Buttons[this:GetID()+UltimateUIFeatureFrame_Offset];
60 if (value) then
61 local f = value[CSM_CALLBACK];
62 this:SetChecked(0);
63 f();
64 return;
65 end
66 end
67  
68 function UltimateUIButton_UpdateButton()
69 for i = 1, 14, 1 do
70 local icon = getglobal("UltimateUIFeaturesButton"..i);
71 local iconTexture = getglobal("UltimateUIFeaturesButton"..i.."IconTexture");
72 local iconName = getglobal("UltimateUIFeaturesButton"..i.."Name");
73 local iconDescription = getglobal("UltimateUIFeaturesButton"..i.."OtherName");
74  
75 icon:Hide();
76 iconTexture:Hide();
77 iconName:Hide();
78 iconDescription:Hide();
79 end
80 local id = 0;
81 local value = 0;
82 for i = 1, 14 do
83 id = i + UltimateUIFeatureFrame_Offset;
84  
85 value = UltimateUIMaster_Buttons[id];
86 if ( not value ) then
87 break;
88 end
89  
90 local icon = getglobal("UltimateUIFeaturesButton"..i);
91 local iconTexture = getglobal("UltimateUIFeaturesButton"..i.."IconTexture");
92 local iconName = getglobal("UltimateUIFeaturesButton"..i.."Name");
93 local iconDescription = getglobal("UltimateUIFeaturesButton"..i.."OtherName");
94  
95 icon:Show();
96 icon:Enable();
97 iconTexture:Show();
98 iconTexture:SetTexture(value[CSM_ICON]);
99 iconName:Show();
100 iconName:SetText(value[CSM_NAME]);
101 iconDescription:Show();
102 iconDescription:SetText(value[CSM_DESCRIPTION]);
103  
104 end
105 UltimateUIFeatureFrame_UpdatePageArrows();
106 end
107  
108 function UltimateUIFeatureFrame_UpdatePageArrows()
109 local numValues = 0;
110 if ( UltimateUIMaster_Buttons ) then
111 numValues = table.getn(UltimateUIMaster_Buttons);
112 end
113 if ( UltimateUIFeatureFrame_Offset <= 0 ) then
114 UltimateUIFeatureFramePrevPageButton:Disable();
115 else
116 UltimateUIFeatureFramePrevPageButton:Enable();
117 end
118 if ( ( UltimateUIFeatureFrame_Offset + ULTIMATEUIFEATUREFRAME_PAGESIZE ) >= numValues ) then
119 UltimateUIFeatureFrameNextPageButton:Disable();
120 else
121 UltimateUIFeatureFrameNextPageButton:Enable();
122 end
123 end
124  
125 function UltimateUIFeatureFrame_PrevPageButton_OnClick()
126 if ( ( UltimateUIFeatureFrame_Offset - ULTIMATEUIFEATUREFRAME_PAGESIZE ) >= 0 ) then
127 UltimateUIFeatureFrame_Offset = UltimateUIFeatureFrame_Offset - ULTIMATEUIFEATUREFRAME_PAGESIZE;
128 end
129 UltimateUIButton_UpdateButton();
130 end
131  
132 function UltimateUIFeatureFrame_NextPageButton_OnClick()
133 local numValues = table.getn(UltimateUIMaster_Buttons);
134 if ( ( UltimateUIFeatureFrame_Offset + ULTIMATEUIFEATUREFRAME_PAGESIZE ) < numValues ) then
135 UltimateUIFeatureFrame_Offset = UltimateUIFeatureFrame_Offset + ULTIMATEUIFEATUREFRAME_PAGESIZE;
136 end
137 UltimateUIButton_UpdateButton();
138 end