vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --[[
2 The Original UltimateUI UI Configuration values
3  
4 This is the simplest example of how UltimateUIMaster can be used.
5 Simply include this lua file in UltimateUIIncludes.xml file,
6 then register it under the proper event handlers.
7  
8  
9 Original code by Justin Crites (Xiphoris)
10 Registration design by Alex Brazie (AlexanderYoshi)
11 ]]--
12  
13 -- allows you to scroll text in chat with the mouse wheel
14 -- readded OnMouseWheel link in ChatFrame.xml, and made it optional.
15 UltimateUI_UseMouseWheelToScrollChat = false;
16  
17 function UltimateUI_ChangeUseMouseWheelToScrollChat(value)
18 if ( ( value == 1 ) or ( value == true ) ) then
19 UltimateUI_UseMouseWheelToScrollChat = true;
20 else
21 UltimateUI_UseMouseWheelToScrollChat = false;
22 end
23 end
24  
25  
26 UltimateUI_ShiftToSell = false;
27  
28 function UltimateUI_ContainerFrameItemButton_OnClick(button, ignoreShift)
29 if ( button == "RightButton" ) then
30 if ( UltimateUI_ShiftToSell == true ) then
31 if ( MerchantFrame:IsVisible() ) then
32 if ( IsShiftKeyDown() ) then
33 UseContainerItem(this:GetParent():GetID(), this:GetID());
34 end
35 else
36 UseContainerItem(this:GetParent():GetID(), this:GetID());
37 end
38 else
39 UseContainerItem(this:GetParent():GetID(), this:GetID());
40 end
41 else
42 return true;
43 end
44  
45 return false;
46 end
47 -- Sea.util.hook("ContainerFrameItemButton_OnClick", "UltimateUI_ContainerFrameItemButton_OnClick", "hide");
48  
49 -- Adds ALT Invites to WhoLinks
50 function UltimateUI_SetItemRef (link)
51 if ( strsub(link, 1, 6) == "Player" ) then
52 local name = strsub(link, 8);
53 if ( name and (strlen(name) > 0) ) then
54 if ( IsAltKeyDown() ) then
55 InviteByName(name);
56 return false;
57 else
58 end
59 end
60 end
61 return true;
62 end
63 -- Sea.util.hook("SetItemRef", "UltimateUI_SetItemRef", "hide");
64  
65 --[[
66 function UltimateUI_SetPaperDollScale(scale,toggle)
67 if ( scale == 0 or toggle==0 ) then scale=1; end
68 PaperDollFrame:SetScale(scale);
69 end
70 ]]--
71  
72 function UltimateUI_TurnOnFPSMove(toggle)
73 -- Move the FPS
74 if (toggle == 1) then
75 FramerateLabel:ClearAllPoints();
76 FramerateLabel:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 0, 0);
77 else
78 FramerateLabel:ClearAllPoints();
79 FramerateLabel:SetPoint("BOTTOM", "WorldFrame", "BOTTOM", 0, 64);
80 end
81 end
82  
83  
84 -- Begin Keypad stuff
85  
86 UltimateUI_UseAbbreviatedShortcutNames = 0;
87  
88 function UltimateUI_UpdateAllButtonHotKeys()
89 if ( SideBarButton_UpdateAllHotkeys ) then
90 SideBarButton_UpdateAllHotkeys();
91 end
92 if ( PopBar_Update ) then
93 PopBar_Update(true);
94 end
95 if ( SecondActionButton_UpdateAllHotkeys ) then
96 SecondActionButton_UpdateAllHotkeys();
97 end
98 local button = nil;
99 local actionButtonFormatStr = "ActionButton%d";
100 local bonusActionButtonFormatStr = "BonusActionButton%d";
101 for i = 1, 12 do
102 button = getglobal(format(actionButtonFormatStr, i));
103 if ( button ) then
104 if ( SideBarButton_UpdateHotkeys ) then
105 SideBarButton_UpdateHotkeys(nil, button);
106 end
107 end
108 button = getglobal(format(bonusActionButtonFormatStr, i));
109 if ( button ) then
110 if ( SideBarButton_UpdateHotkeys ) then
111 SideBarButton_UpdateHotkeys(nil, button);
112 end
113 end
114 end
115 end
116  
117 function UltimateUI_SetUseAbbreviatedShortcutNames(toggle)
118 if ( UltimateUI_UseAbbreviatedShortcutNames ~= toggle ) then
119 UltimateUI_UseAbbreviatedShortcutNames = toggle;
120 UltimateUI_UpdateAllButtonHotKeys();
121 end
122 end
123  
124 UltimateUI_ShortcutAbbreviations = {
125 ["Shift"] = "S",
126 ["Alt"] = "A",
127 ["Ctrl"] = "C",
128 ["Control"] = "C",
129 ["shift"] = "S",
130 ["alt"] = "A",
131 ["ctrl"] = "C",
132 ["control"] = "C",
133 ["SHIFT"] = "S",
134 ["ALT"] = "A",
135 ["CTRL"] = "C",
136 ["CONTROL"] = "C"
137 };
138  
139 -- Begin Keypad stuff
140 old_KeyBindingFrame_GetLocalizedName = KeyBindingFrame_GetLocalizedName;
141 --[[
142 function KeyBindingFrame_GetLocalizedName(name, prefix)
143 -- call the previous routine
144 local text = old_KeyBindingFrame_GetLocalizedName(name, prefix);
145  
146 -- now rename the numeric keypad names
147 -- Sea.io.print("MyKeyBindingFrame_GetLocalizedName: "..text..".");
148 if (text == "NUMPADEQUALS") then
149 text = "KP =";
150 elseif(string.find(text,"Num Pad ")) then
151 local startpos, endpos = string.find(text,"Num Pad ");
152 if (startpos and (startpos > 1)) then
153 text = string.sub(text, 1, startpos - 1).."KP "..string.sub(text, endpos + 1, strlen(text));
154 else
155 text = "KP"..string.sub(text, 8);
156 end
157 end
158 if ( UltimateUI_UseAbbreviatedShortcutNames == 1 ) then
159 for str, repl in UltimateUI_ShortcutAbbreviations do
160 text = string.gsub(text, str, repl);
161 end
162 end
163  
164 return text;
165 end
166 ]]--
167 -- End Keypad stuff
168  
169 function UltimateUI_ShiftSell(toggle)
170 if ( toggle ~= 0 ) then
171 UltimateUI_ShiftToSell = true;
172 else
173 UltimateUI_ShiftToSell = false;
174 end
175 end
176  
177 -- Quest Scroll speed
178 function UltimateUI_SetQuestTextScrollSpeed(toggle, speed)
179 if ( toggle ~= 0 ) then
180 --setglobal('QUEST_FADING_ENABLE',true);
181 setglobal('QUEST_DESCRIPTION_GRADIENT_CPS',speed);
182 else
183 --setglobal('QUEST_FADING_ENABLE',false);
184 setglobal('QUEST_DESCRIPTION_GRADIENT_CPS',600000);
185 end
186 end
187  
188  
189 function UltimateUI_ResetPartyFrames()
190 local lastFrame = PartyMemberFrame1;
191 lastFrame:ClearAllPoints();
192 lastFrame:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 10, -128);
193 local newFrame = nil;
194 for i = 2, MAX_PARTY_MEMBERS do
195 newFrame = getglobal(string.format("PartyMemberFrame%d", i));
196 if ( newFrame ) then
197 newFrame:ClearAllPoints();
198 newFrame:SetPoint("TOPLEFT", lastFrame:GetName(), "BOTTOMLEFT", 0, -10);
199 end
200 lastFrame = newFrame;
201 end
202 end
203  
204 function UltimateUI_Registers()
205 -- Register with the UltimateUIMaster
206 UltimateUI_RegisterConfiguration(
207 "UUI_COS",
208 "SECTION",
209 TEXT(ULTIMATEUI_CONFIG_SEP),
210 TEXT(ULTIMATEUI_CONFIG_SEP_INFO)
211 );
212 UltimateUI_RegisterConfiguration(
213 "UUI_UUI_DEFAULTSEPARATOR",
214 "SEPARATOR",
215 TEXT(ULTIMATEUI_CONFIG_SEP),
216 TEXT(ULTIMATEUI_CONFIG_SEP_INFO)
217 );
218 UltimateUI_RegisterConfiguration(
219 "UUI_UUI_QUESTSCROLL",
220 "BOTH",
221 ULTIMATEUI_CONFIG_QUESTSCROLL,
222 ULTIMATEUI_CONFIG_QUESTSCROLL_INFO,
223 UltimateUI_SetQuestTextScrollSpeed,
224 0,
225 40, --Default Value
226 40, --Min value
227 400, --Max value
228 ULTIMATEUI_CONFIG_QUESTSCROLL_CHARS, --Slider Text
229 20, --Slider Increment
230 1, --Slider state text on/off
231 ULTIMATEUI_CONFIG_QUESTSCROLL_APPEND, --Slider state text append
232 1 --Slider state text multiplier
233 );
234  
235 UltimateUI_RegisterConfiguration(
236 "UUI_UUI_SHIFTSELL",
237 "CHECKBOX",
238 TEXT(ULTIMATEUI_CONFIG_S2SELL),
239 TEXT(ULTIMATEUI_CONFIG_S2SELL_INFO),
240 UltimateUI_ShiftSell,
241  
242 );
243 UltimateUI_RegisterConfiguration(
244 "UUI_UUI_SCROLLCHATWITHMOUSEWHEEL",
245 "CHECKBOX",
246 TEXT(ULTIMATEUI_CONFIG_MWHEELCHAT),
247 TEXT(ULTIMATEUI_CONFIG_MWHEELCHAT_INFO),
248 UltimateUI_ChangeUseMouseWheelToScrollChat,
249  
250 );
251 UltimateUI_RegisterConfiguration(
252 "UUI_UUI_FPSMOVE",
253 "CHECKBOX",
254 TEXT(ULTIMATEUI_CONFIG_FPSMOVE),
255 TEXT(ULTIMATEUI_CONFIG_FPSMOVE_INFO),
256 UltimateUI_TurnOnFPSMove,
257  
258 );
259 UltimateUI_RegisterConfiguration(
260 "UUI_UUI_SHORTCUT_NAMES",
261 "CHECKBOX",
262 TEXT(ULTIMATEUI_CONFIG_SHORTCUT_NAMES),
263 TEXT(ULTIMATEUI_CONFIG_SHORTCUT_NAMES_INFO),
264 UltimateUI_SetUseAbbreviatedShortcutNames,
265 UltimateUI_UseAbbreviatedShortcutNames
266 );
267 UltimateUI_RegisterConfiguration(
268 "UUI_UUI_RESET_PARTY_FRAMES",
269 "BUTTON",
270 TEXT(ULTIMATEUI_CONFIG_RESET_PARTY_FRAMES),
271 TEXT(ULTIMATEUI_CONFIG_RESET_PARTY_FRAMES_INFO),
272 UltimateUI_ResetPartyFrames,
273 0,
274 0,
275 0,
276 0,
277 TEXT(ULTIMATEUI_CONFIG_RESET_PARTY_FRAMES_TEXT)
278 );
279  
280  
281 --[[
282 -- UltimateUI Help Button
283 UltimateUI_RegisterButton (
284 ULTIMATEUI_BUTTON_ULTIMATEUI_HELP,
285 ULTIMATEUI_BUTTON_ULTIMATEUI_HELP_SUB,
286 ULTIMATEUI_BUTTON_ULTIMATEUI_HELP_TIP,
287 "Interface\\Icons\\INV_Misc_Book_08",
288 function()
289 LaunchURL("http://www.wowwiki.com/index.php/UltimateUI_Portal");
290 end
291 );
292 ]]--
293 -- UltimateUI Configuration Button
294 UltimateUI_RegisterButton (
295 ULTIMATEUI_BUTTON_ULTIMATEUI,
296 ULTIMATEUI_BUTTON_ULTIMATEUI_SUB,
297 ULTIMATEUI_BUTTON_ULTIMATEUI_TIP,
298 "Interface\\Icons\\Ability_Repair",
299 function()
300 if (UltimateUIMasterFrame:IsVisible()) then
301 HideUIPanel(UltimateUIMasterFrame);
302 else
303 PlaySound("igMainMenuOption");
304 ShowUIPanel(UltimateUIMasterFrame);
305 UltimateUIMasterFrame_Show();
306 end
307 end
308 );
309  
310 end