vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | ---------------------------------------------------------------------------------------------------- |
2 | -- ChatBox Slash Commands |
||
3 | ---------------------------------------------------------------------------------------------------- |
||
4 | function ChatBox_Commands(msg) |
||
5 | if msg == nil then msg = "" end |
||
6 | |||
7 | msg = string.lower(msg) |
||
8 | |||
9 | -- No parameter or not one listed from above |
||
10 | if msg == "" or msg == "?" or msg == string.lower(CB_OPTIONS) or msg == string.lower(CB_HELP) then |
||
11 | |||
12 | cb_display("\n"); |
||
13 | cb_display(YEL..CB_HELPTITLE.." /ts and /plm are also valid options.".."\n") |
||
14 | cb_display(YEL .. CB_SHORTCUTS); |
||
15 | cb_display(WHT .. CB_STICKY .. " : " .. RED .. ChatBox_check(ChatBox.setSticky) ..GRN.. CB_STICKY_HELP_TEXT) |
||
16 | cb_display(WHT .. CB_SHORTLFG .. " : " .. RED .. ChatBox_check(ChatBox.shortLFG) ..GRN..CB_SHORTLFG_HELP_TEXT) |
||
17 | cb_display(WHT .. CB_HIDEBOTTOMBUTTON .. " : " .. RED .. ChatBox_check(ChatBox.hideBottomButton) ..GRN..CB_HIDEBOTTOMBUTTON_HELP_TEXT) |
||
18 | cb_display(WHT .. CB_THROTTLE .. " : " .. RED .. ChatBox_check(ChatBox.throttle) ..GRN..CB_THROTTLE_HELP_TEXTA) |
||
19 | cb_display(RED .. " 0 "..GRN..CB_THROTTLE_HELP_TEXTB..RED.."1-20"..GRN..CB_THROTTLE_HELP_TEXTC) |
||
20 | cb_display(WHT .. CB_GTHROTTLE .. " : " .. RED .. ChatBox_check(ChatBox.gthrottle) ..GRN..CB_GTHROTTLE_HELP_TEXTA) |
||
21 | cb_display(RED .. " 0 "..GRN..CB_GTHROTTLE_HELP_TEXTB..RED.."1-30"..GRN..CB_GTHROTTLE_HELP_TEXTC) |
||
22 | cb_display(WHT .. CB_HIDEGOSSIP .. " : " .. RED .. ChatBox_check(ChatBox.hideGossip) ..GRN..CB_HIDEGOSSIP_HELP_TEXT) |
||
23 | cb_display(WHT .. CB_USEARROWS .. " : " .. RED .. ChatBox_check(ChatBox.useArrows) ..GRN..CB_USEARROWS_HELP_TEXT) |
||
24 | cb_display(WHT .. CB_EDITATTOP .. " : " .. RED .. ChatBox_check(ChatBox.editAtTop) ..GRN..CB_EDITATTOP_HELP_TEXT) |
||
25 | cb_display(WHT .. CB_HIDEEMOTEBUTTON .. " : " .. RED .. ChatBox_check(ChatBox.hideEmoteButton) ..GRN..CB_HIDEEMOTEBUTTON_HELP_TEXT) |
||
26 | cb_display(WHT .. CB_MENUSIDE .. " : " .. RED .. ChatBox_check(ChatBox.menuOnLeft) ..GRN..CB_MENUSIDE_HELP_TEXT) |
||
27 | cb_display(WHT .. CB_COLORNAMES .. " : " .. RED .. ChatBox_check(ChatBox.colorNames) ..GRN..CB_COLORNAMES_HELP_TEXT) |
||
28 | cb_display(WHT .. CB_COLORRANDOM .. " : " .. RED .. ChatBox_check(ChatBox.colorRandom) ..GRN..CB_COLORRANDOM_HELP_TEXT) |
||
29 | cb_display(WHT .. CB_LONGSTRINGS .. " : " .. RED .. ChatBox_check(ChatBox.longStrings) ..GRN..CB_LONGSTRINGS_HELP_TEXT) |
||
30 | cb_display(WHT .. CB_TRUNCLENGTH .. " : " .. RED .. ChatBox_check(ChatBox.truncLength) ..GRN..CB_TRUNCLENGTH_HELP_TEXTA) |
||
31 | cb_display(RED .. " 100 "..GRN..CB_TRUNCLENGTH_HELP_TEXTB..RED.."0-20"..GRN..CB_TRUNCLENGTH_HELP_TEXTC) |
||
32 | cb_display(WHT .. CB_CLINK .. " : " .. RED .. ChatBox_check(ChatBox.CLINK) ..GRN..CB_CLINK_HELP_TEXT) |
||
33 | cb_display(WHT .. CB_NORRIS .. " : " .. RED .. ChatBox_check(ChatBox.chuckNorris) ..GRN..CB_NORRIS_HELP_TEXT) |
||
34 | |||
35 | --to change the sticky |
||
36 | elseif ( string.find(msg, string.lower(CB_STICKY_SHORT))) then |
||
37 | if ChatBox.setSticky then |
||
38 | cb_display(WHT..CB_STICKY_TEXT..RED..CB_OFF); |
||
39 | ChatBox.setSticky = false; |
||
40 | else |
||
41 | cb_display(WHT..CB_STICKY_TEXT..RED..CB_ON); |
||
42 | ChatBox.setSticky = true; |
||
43 | end |
||
44 | ChatBox_SetSticky(); |
||
45 | |||
46 | |||
47 | --to change the shortLFG tag (Change LookingForGroup to LFG) TODO possilby add more. (G, T, WD, LD)? |
||
48 | elseif ( string.find(msg, string.lower(CB_SHORTLFG_SHORT))) then |
||
49 | if ChatBox.shortLFG then |
||
50 | cb_display(WHT..CB_SHORTLFG_TEXT..RED..CB_OFF); |
||
51 | ChatBox.shortLFG = false; |
||
52 | else |
||
53 | cb_display(WHT..CB_SHORTLFG_TEXT..RED..CB_ON); |
||
54 | ChatBox.shortLFG = true; |
||
55 | end |
||
56 | |||
57 | --to change the scroll to bottom button display |
||
58 | elseif ( string.find(msg, string.lower(CB_HIDEBOTTOMBUTTON_SHORT))) then |
||
59 | if ChatBox.hideBottomButton then |
||
60 | cb_display(WHT..CB_HIDEBOTTOMBUTTON_TEXT..RED..CB_ON); |
||
61 | ChatBox.hideBottomButton = false; |
||
62 | else |
||
63 | cb_display(WHT..CB_HIDEBOTTOMBUTTON_TEXT..RED..CB_OFF); |
||
64 | ChatBox.hideBottomButton = true; |
||
65 | end |
||
66 | |||
67 | |||
68 | --to change the emote/language button display |
||
69 | elseif ( string.find(msg, string.lower(CB_HIDEEMOTEBUTTON_SHORT))) then |
||
70 | if ChatBox.hideEmoteButton then |
||
71 | cb_display(WHT..CB_HIDEEMOTEBUTTON_TEXT..RED..CB_ON); |
||
72 | ChatFrameMenuButton:Show(); |
||
73 | ChatBox.hideEmoteButton = false; |
||
74 | else |
||
75 | cb_display(WHT..CB_HIDEEMOTEBUTTON_TEXT..RED..CB_OFF); |
||
76 | ChatFrameMenuButton:Hide(); |
||
77 | ChatBox.hideEmoteButton = true; |
||
78 | end |
||
79 | |||
80 | |||
81 | --to change the hideGossip display |
||
82 | elseif ( string.find(msg, string.lower(CB_HIDEGOSSIP_SHORT))) then |
||
83 | if ChatBox.hideGossip then |
||
84 | cb_display(WHT..CB_HIDEGOSSIP_TEXT..RED..CB_OFF); |
||
85 | ChatBox.hideGossip = false; |
||
86 | else |
||
87 | cb_display(WHT..CB_HIDEGOSSIP_TEXT..RED..CB_ON); |
||
88 | ChatBox.hideGossip = true; |
||
89 | end |
||
90 | |||
91 | --to change the useArrows behavior |
||
92 | elseif ( string.find(msg, string.lower(CB_USEARROWS_SHORT))) then |
||
93 | if ChatBox.useArrows then |
||
94 | cb_display(WHT..CB_USEARROWS_TEXT.. RED .. CB_OFF); |
||
95 | ChatFrameEditBox:SetAltArrowKeyMode(true); |
||
96 | ChatBox.useArrows = false; |
||
97 | else |
||
98 | cb_display(WHT..CB_USEARROWS_TEXT .. RED .. CB_ON); |
||
99 | ChatFrameEditBox:SetAltArrowKeyMode(false); |
||
100 | ChatBox.useArrows = true; |
||
101 | end |
||
102 | |||
103 | --to change the editAtTop display |
||
104 | elseif ( string.find(msg, string.lower(CB_EDITATTOP_SHORT)) ) then |
||
105 | if ChatBox.editAtTop then |
||
106 | cb_display(WHT..CB_EDITATTOP_TEXTA..RED..CB_BOTTOM..WHT..CB_EDITATTOP_TEXTB); |
||
107 | ChatFrameEditBox:ClearAllPoints(); |
||
108 | ChatFrameEditBox:SetPoint("TOPLEFT", "ChatFrame1", "BOTTOMLEFT", 0, 2); |
||
109 | ChatFrameEditBox:SetPoint("TOPRIGHT", "ChatFrame1", "BOTTOMRIGHT", 0, 2); |
||
110 | ChatBox.editAtTop = false; |
||
111 | else |
||
112 | cb_display(WHT..CB_EDITATTOP_TEXTA..RED..CB_TOP..WHT..CB_EDITATTOP_TEXTB); |
||
113 | ChatFrameEditBox:ClearAllPoints(); |
||
114 | ChatFrameEditBox:SetPoint("BOTTOMLEFT", "ChatFrame1", "TOPLEFT", 0, 2); |
||
115 | ChatFrameEditBox:SetPoint("BOTTOMRIGHT", "ChatFrame1", "TOPRIGHT", 0, 2); |
||
116 | ChatBox.editAtTop = true; |
||
117 | end |
||
118 | |||
119 | |||
120 | --to change the throttle |
||
121 | elseif ( string.find(msg, string.lower(CB_THROTTLE_SHORT)) ) then |
||
122 | local index = string.find(msg, " "); |
||
123 | if (index) then |
||
124 | local test = tonumber(strsub(msg, index+1)); |
||
125 | if ( test and test == 0 ) then |
||
126 | cb_display(WHT..CB_THROTTLE_TEXTA..RED..CB_OFF); |
||
127 | ChatBox.throttle = false; |
||
128 | elseif ( test and test > 0 and test < 21 ) then |
||
129 | ChatBox.throttle = test; |
||
130 | cb_display(WHT..CB_THROTTLE_TEXTA..RED..ChatBox.throttle); |
||
131 | else |
||
132 | cb_display(WHT..CB_THROTTLE_TEXTB..RED.."1-20"); |
||
133 | end |
||
134 | else |
||
135 | cb_display(WHT..CB_THROTTLE_TEXTA..RED..ChatBox_check(ChatBox.throttle)); |
||
136 | end |
||
137 | |||
138 | --to change the guild throttle |
||
139 | elseif ( string.find(msg, string.lower(CB_GTHROTTLE_SHORT)) ) then |
||
140 | local index = string.find(msg, " "); |
||
141 | if (index) then |
||
142 | local test = tonumber(strsub(msg, index+1)); |
||
143 | if ( test and test == 0 ) then |
||
144 | cb_display(WHT..CB_GTHROTTLE_TEXTA..RED..CB_OFF); |
||
145 | ChatBox.gthrottle = false; |
||
146 | elseif ( test and test > 0 and test < 31 ) then |
||
147 | ChatBox.gthrottle = test; |
||
148 | cb_display(WHT..CB_GTHROTTLE_TEXTA..RED..ChatBox.gthrottle); |
||
149 | else |
||
150 | cb_display(WHT..CB_GTHROTTLE_TEXTB..RED.."1-30"); |
||
151 | end |
||
152 | else |
||
153 | cb_display(WHT..CB_GTHROTTLE_TEXTA..RED..ChatBox_check(ChatBox.gthrottle)); |
||
154 | end |
||
155 | |||
156 | --to change the truncLength for channel names in chat |
||
157 | elseif ( string.find(msg, string.lower(CB_TRUNCLENGTH_SHORT)) ) then |
||
158 | local index = string.find(msg, " "); |
||
159 | if (index) then |
||
160 | local test = tonumber(strsub(msg, index+1)); |
||
161 | if ( test and test == 100 ) then |
||
162 | cb_display(WHT..CB_TRUNCLENGTH_TEXTA..RED..CB_OFF); |
||
163 | ChatBox.truncLength = 100; |
||
164 | elseif ( test and test >= 0 and test < 21 ) then |
||
165 | ChatBox.truncLength = test; |
||
166 | cb_display(WHT..CB_TRUNCLENGTH_TEXTA..RED..ChatBox.truncLength); |
||
167 | else |
||
168 | cb_display(WHT..CB_TRUNCLENGTH_TEXTB..RED.."0-20"); |
||
169 | end |
||
170 | else |
||
171 | cb_display(WHT..CB_TRUNCLENGTH_TEXTA..RED..ChatBox_check(ChatBox.truncLength)); |
||
172 | end |
||
173 | |||
174 | --to change which side the buttons are on. |
||
175 | elseif ( string.find(msg, string.lower(CB_MENUSIDE_SHORT)) ) then |
||
176 | if ChatBox.menuOnLeft then |
||
177 | cb_display(WHT..CB_MENUSIDE_TEXT.. RED .. CB_OFF); |
||
178 | ChatBox.menuOnLeft = false; |
||
179 | else |
||
180 | cb_display(WHT..CB_MENUSIDE_TEXT .. RED .. CB_ON); |
||
181 | ChatBox.menuOnLeft = true; |
||
182 | end |
||
183 | ChatBox_Relocate_Buttons() |
||
184 | |||
185 | --to change the color of names in chat behavior |
||
186 | elseif ( string.find(msg, string.lower(CB_COLORNAMES_SHORT))) then |
||
187 | if ChatBox.colorNames then |
||
188 | cb_display(WHT..CB_COLORNAMES_TEXT.. RED .. CB_OFF); |
||
189 | ChatBox.colorNames = false; |
||
190 | else |
||
191 | cb_display(WHT..CB_COLORNAMES_TEXT .. RED .. CB_ON); |
||
192 | ChatBox.colorNames = true; |
||
193 | end |
||
194 | ChatBox_SetStrings(); |
||
195 | |||
196 | --to change the RANDOM color of names in chat behavior |
||
197 | elseif ( string.find(msg, string.lower(CB_COLORRANDOM_SHORT))) then |
||
198 | if ChatBox.colorRandom then |
||
199 | cb_display(WHT..CB_COLORRANDOM_TEXT.. RED .. CB_OFF); |
||
200 | ChatBox.colorRandom = false; |
||
201 | else |
||
202 | cb_display(WHT..CB_COLORRANDOM_TEXT .. RED .. CB_ON); |
||
203 | ChatBox.colorRandom = true; |
||
204 | end |
||
205 | |||
206 | --to change showing [Party] [Guild] [Raid] in chat. |
||
207 | elseif ( string.find(msg, string.lower(CB_LONGSTRINGS_SHORT))) then |
||
208 | if ChatBox.longStrings then |
||
209 | cb_display(WHT..CB_LONGSTRINGS_TEXT.. RED .. CB_OFF); |
||
210 | ChatBox.longStrings = false; |
||
211 | else |
||
212 | cb_display(WHT..CB_LONGSTRINGS_TEXT .. RED .. CB_ON); |
||
213 | ChatBox.longStrings = true; |
||
214 | end |
||
215 | ChatBox_SetStrings(); |
||
216 | |||
217 | --to change if you want to use the CLINK tag |
||
218 | elseif ( string.find(msg, string.lower(CB_CLINK_SHORT))) then |
||
219 | if ChatBox.CLINK then |
||
220 | cb_display(WHT..CB_CLINK_TEXT..RED..CB_OFF); |
||
221 | ChatBox.CLINK = false; |
||
222 | else |
||
223 | cb_display(WHT..CB_CLINK_TEXT..RED..CB_ON); |
||
224 | ChatBox.CLINK = true; |
||
225 | end |
||
226 | |||
227 | --to change if you want to use the Chuck Norris spam nuker |
||
228 | elseif ( string.find(msg, string.lower(CB_NORRIS_SHORT))) then |
||
229 | if ( string.find(msg, string.lower(CB_VERBOSE))) then |
||
230 | cb_display(WHT..CB_NORRIS_TEXT..RED..CB_ON.." ("..CB_VERBOSE..")"); |
||
231 | ChatBox.chuckNorris = CB_VERBOSE; |
||
232 | else |
||
233 | if ChatBox.chuckNorris then |
||
234 | cb_display(WHT..CB_NORRIS_TEXT..RED..CB_OFF); |
||
235 | ChatBox.chuckNorris = false; |
||
236 | else |
||
237 | cb_display(WHT..CB_NORRIS_TEXT..RED..CB_ON); |
||
238 | ChatBox.chuckNorris = true; |
||
239 | end |
||
240 | end |
||
241 | |||
242 | --no idea what they typed!!! |
||
243 | else |
||
244 | cb_display(RED .. CB_ERRORMSG) |
||
245 | end |
||
246 | end |
||
247 | |||
248 | ---------------------------------------------------------------------------------------------------- |
||
249 | -- TimeStamp Commands |
||
250 | ---------------------------------------------------------------------------------------------------- |
||
251 | |||
252 | -- Handles a slash command |
||
253 | function ChatBox_TimeStamp_Commands(msg) |
||
254 | |||
255 | if msg == nil then msg = "" end |
||
256 | |||
257 | if not (string.find(msg, CB_TS_FORMAT)) then |
||
258 | msg = string.lower(msg) |
||
259 | end |
||
260 | |||
261 | -- No parameter or not one listed from above |
||
262 | if msg == "" or msg == "?" or msg == string.lower(CB_OPTIONS) or msg == string.lower(CB_HELP) then |
||
263 | |||
264 | cb_display("\n"); |
||
265 | cb_display(YEL..CB_TS_HELPTITLE.." /cb and /plm are also valid options.".."\n") |
||
266 | -- List all chat frames and their status |
||
267 | for i = 1, 7 do |
||
268 | local name = "ChatFrame"..i; |
||
269 | local status = ChatBox.TimeStamp_Settings.frames[name]; |
||
270 | local tabtext = getglobal(name .. "TabText"):GetText(); |
||
271 | if (tabtext) then |
||
272 | name = name .. " (" .. tabtext .. ")"; |
||
273 | end |
||
274 | if (status and status == CB_ON) then |
||
275 | cb_display(string.format(" " .. CB_TS_FRAMESTATUS_TEXT, WHT .. name .. END, GRN .. CB_ON)); |
||
276 | else |
||
277 | cb_display(string.format(" " .. CB_TS_FRAMESTATUS_TEXT, WHT .. name .. END, RED .. CB_OFF)); |
||
278 | end |
||
279 | end |
||
280 | cb_display(YEL .. " " .. CB_TIMESTAMP_FRAME_HELP1); |
||
281 | cb_display(YEL .. " " .. CB_TIMESTAMP_FRAME_HELP2); |
||
282 | cb_display("\n"); |
||
283 | |||
284 | cb_display(WHT .. CB_TS_COLOR .. " : " .. ChatBox_check_color() ..GRN.. CB_TS_COLOR_HELP_TEXT) |
||
285 | cb_display(WHT .. CB_TS_FORMAT .. " : " .. RED .. ChatBox_check(ChatBox.TimeStamp_Settings.format).. GRN.. CB_TS_FORMAT_HELP_TEXTA) |
||
286 | cb_display(WHT .. CB_TS_FORMAT_HELP_TEXTB); |
||
287 | cb_display(WHT .. CB_TS_RESET .. GRN.. CB_TS_RESET_HELP_TEXT) |
||
288 | |||
289 | |||
290 | |||
291 | elseif (msg == CB_TS_COLOR) then |
||
292 | -- Change the color of the timestamps using a color picker |
||
293 | ChatBox_TimeStamp_ColorPicker(); |
||
294 | |||
295 | elseif (msg == CB_TS_COLOR .. " " .. string.lower(CB_OFF)) then |
||
296 | -- Disable the coloring of the timestamps |
||
297 | ChatBox.TimeStamp_Settings.color = false; |
||
298 | --ChatBox_TimeStamp_Set(CB_TS_COLOR, CB_OFF); |
||
299 | cb_display(WHT..CB_TS_COLOR_TEXT .. " " .. ChatBox_check_color()); |
||
300 | |||
301 | elseif (string.find(msg, CB_TS_FORMAT)) then |
||
302 | local index = string.find(msg, " "); |
||
303 | if (index) then |
||
304 | local test = string.sub(msg, index+1) |
||
305 | if ( test ) then |
||
306 | ChatBox.TimeStamp_Settings.format = test; |
||
307 | else |
||
308 | ChatBox.TimeStamp_Settings.format = "[%H:%M:%S]"; |
||
309 | end |
||
310 | else |
||
311 | ChatBox.TimeStamp_Settings.format = "[%H:%M:%S]"; |
||
312 | end |
||
313 | |||
314 | -- Show a message notifying the user what happened |
||
315 | cb_display(WHT..CB_TS_FORMAT_TEXT .. " " .. RED .. ChatBox.TimeStamp_Settings.format); |
||
316 | |||
317 | elseif (string.find(msg, string.lower(CB_ON))) then |
||
318 | local index = string.find(msg, " "); |
||
319 | if (index) then |
||
320 | local test = string.sub(msg, index+1) |
||
321 | if ( test ) then |
||
322 | test = "ChatFrame"..tostring(test) |
||
323 | ChatBox.TimeStamp_Settings.frames[test] = CB_ON; |
||
324 | cb_display(string.format(CB_TIMESTAMP_FRAMEENABLED, GRN .. test .. END)); |
||
325 | else |
||
326 | cb_display(RED .. CB_ERRORMSG) |
||
327 | end |
||
328 | else |
||
329 | cb_display(RED .. CB_ERRORMSG) |
||
330 | end |
||
331 | |||
332 | elseif (string.find(msg, string.lower(CB_OFF))) then |
||
333 | local index = string.find(msg, " "); |
||
334 | if (index) then |
||
335 | local test = string.sub(msg, index+1) |
||
336 | if ( test ) then |
||
337 | test = "ChatFrame"..tostring(test) |
||
338 | ChatBox.TimeStamp_Settings.frames[test] = CB_OFF; |
||
339 | cb_display(string.format(CB_TIMESTAMP_FRAMEDISABLED, GRN .. test .. END)); |
||
340 | else |
||
341 | cb_display(RED .. CB_ERRORMSG) |
||
342 | end |
||
343 | else |
||
344 | cb_display(RED .. CB_ERRORMSG) |
||
345 | end |
||
346 | |||
347 | elseif (msg == CB_TS_RESET) then |
||
348 | -- Reset the settings of the current character back to defaults |
||
349 | ChatBox.TimeStamp_Settings = { |
||
350 | color = false, |
||
351 | format = "[%H:%M:%S]", |
||
352 | frames = { |
||
353 | ChatFrame1 = CB_OFF, |
||
354 | ChatFrame2 = CB_OFF, |
||
355 | ChatFrame3 = CB_OFF, |
||
356 | ChatFrame4 = CB_OFF, |
||
357 | ChatFrame5 = CB_OFF, |
||
358 | ChatFrame6 = CB_OFF, |
||
359 | ChatFrame7 = CB_OFF, |
||
360 | }, |
||
361 | }; |
||
362 | |||
363 | -- Show a message notifying the user what happened |
||
364 | cb_display(RED .. CB_TS_RESET_TEXT); |
||
365 | |||
366 | --no idea what they typed!!! |
||
367 | else |
||
368 | cb_display(RED .. CB_ERRORMSG) |
||
369 | end |
||
370 | end |
||
371 | |||
372 | ---------------------------------------------------------------------------------------------------- |
||
373 | -- PLM Slash Commands |
||
374 | ---------------------------------------------------------------------------------------------------- |
||
375 | function ChatBox_PLM_Commands(msg) |
||
376 | if msg == nil then msg = "" end |
||
377 | |||
378 | msg = string.lower(msg) |
||
379 | |||
380 | -- No parameter or not one listed from above |
||
381 | if msg == "" or msg == "?" or msg == string.lower(CB_OPTIONS) or msg == string.lower(CB_HELP) then |
||
382 | cb_display("\n"); |
||
383 | cb_display(YEL..CB_HELPTITLE.." /cb and /ts are also valid options.".."\n"); |
||
384 | cb_display(WHT .. CB_PLM_TEXT .. RED .. ChatBox_check(ChatBox.plm)) |
||
385 | cb_display(" " .. GRN .. CB_PLM_HELP_TEXT); |
||
386 | cb_display(GRY .. CB_PLM_HELPA); |
||
387 | cb_display(GRY .. CB_PLM_HELPB .. WHT .. CB_PLM_HELPC); |
||
388 | cb_display(ORN .. CB_PLM_HELPD); |
||
389 | cb_display("\n"); |
||
390 | cb_display(WHT .. CB_PLM_ALT_TEXT_HELP .. RED .. ChatBox_check(ChatBox.plm_alt_name)); |
||
391 | cb_display(WHT .. CB_PLM_SHIFT_TEXT_HELP .. RED .. ChatBox_check(ChatBox.plm_shift_name)); |
||
392 | cb_display(WHT .. CB_PLM_CTRL_TEXT_HELP .. RED .. ChatBox_check(ChatBox.plm_ctrl_name)); |
||
393 | |||
394 | |||
395 | --to toggle the Player Link Menu. |
||
396 | elseif ( msg == string.lower(CB_ON) or msg == string.lower(CB_OFF) ) then |
||
397 | if ChatBox.plm then |
||
398 | cb_display(WHT..CB_PLM_TEXT..RED..CB_OFF); |
||
399 | ChatBox.plm = false; |
||
400 | else |
||
401 | cb_display(WHT..CB_PLM_TEXT..RED..CB_ON); |
||
402 | ChatBox.plm = true; |
||
403 | end |
||
404 | SetupPLM(); |
||
405 | |||
406 | |||
407 | --to change the alt key functionality |
||
408 | elseif (string.find(msg, string.lower(CB_PLM_ALT))) then |
||
409 | local index = string.find(msg, " "); |
||
410 | if (index) then |
||
411 | local test = string.sub(msg, index+1) |
||
412 | if ( test ) then |
||
413 | if test == string.lower(WHO) then |
||
414 | ChatBox.plm_alt = ChatBox_specialSendWho; |
||
415 | ChatBox.plm_alt_name = WHO; |
||
416 | elseif test == string.lower(CB_TARGET) then |
||
417 | ChatBox.plm_alt = TargetByName; |
||
418 | ChatBox.plm_alt_name = CB_TARGET; |
||
419 | elseif test == string.lower(WHISPER) then |
||
420 | ChatBox.plm_alt = ChatFrame_SendTell; |
||
421 | ChatBox.plm_alt_name = WHISPER; |
||
422 | elseif test == string.lower(PARTY_INVITE) then |
||
423 | ChatBox.plm_alt = InviteByName; |
||
424 | ChatBox.plm_alt_name = PARTY_INVITE; |
||
425 | elseif test == string.lower(IGNORE) then |
||
426 | ChatBox.plm_alt = AddIgnore; |
||
427 | ChatBox.plm_alt_name = IGNORE; |
||
428 | end |
||
429 | cb_display(WHT .. CB_PLM_ALT_TEXT_HELP .. RED .. ChatBox.plm_alt_name); |
||
430 | end |
||
431 | else |
||
432 | ChatBox.plm_alt = false; |
||
433 | ChatBox.plm_alt_name = CB_OFF; |
||
434 | cb_display(WHT .. CB_PLM_ALT_TEXT_HELP .. RED .. CB_OFF); |
||
435 | end |
||
436 | |||
437 | --to change the shift key functionality |
||
438 | elseif (string.find(msg, string.lower(CB_PLM_SHIFT))) then |
||
439 | local index = string.find(msg, " "); |
||
440 | if (index) then |
||
441 | local test = string.sub(msg, index+1) |
||
442 | if ( test ) then |
||
443 | if test == string.lower(WHO) then |
||
444 | ChatBox.plm_shift = ChatBox_specialSendWho; |
||
445 | ChatBox.plm_shift_name = WHO; |
||
446 | elseif test == string.lower(CB_TARGET) then |
||
447 | ChatBox.plm_shift = TargetByName; |
||
448 | ChatBox.plm_shift_name = CB_TARGET; |
||
449 | elseif test == string.lower(WHISPER) then |
||
450 | ChatBox.plm_shift = ChatFrame_SendTell; |
||
451 | ChatBox.plm_shift_name = WHISPER; |
||
452 | elseif test == string.lower(PARTY_INVITE) then |
||
453 | ChatBox.plm_shift = InviteByName; |
||
454 | ChatBox.plm_shift_name = PARTY_INVITE; |
||
455 | elseif test == string.lower(IGNORE) then |
||
456 | ChatBox.plm_shift = AddIgnore; |
||
457 | ChatBox.plm_shift_name = IGNORE; |
||
458 | end |
||
459 | cb_display(WHT .. CB_PLM_SHIFT_TEXT_HELP .. RED .. ChatBox.plm_shift_name); |
||
460 | end |
||
461 | else |
||
462 | ChatBox.plm_shift = false; |
||
463 | ChatBox.plm_shift_name = CB_OFF; |
||
464 | cb_display(WHT .. CB_PLM_SHIFT_TEXT_HELP .. RED .. CB_OFF); |
||
465 | end |
||
466 | |||
467 | --to change the control key functionality |
||
468 | elseif (string.find(msg, string.lower(CB_PLM_CTRL))) then |
||
469 | local index = string.find(msg, " "); |
||
470 | if (index) then |
||
471 | local test = string.sub(msg, index+1) |
||
472 | if ( test ) then |
||
473 | if test == string.lower(WHO) then |
||
474 | ChatBox.plm_ctrl = ChatBox_specialSendWho; |
||
475 | ChatBox.plm_ctrl_name = WHO; |
||
476 | elseif test == string.lower(CB_TARGET) then |
||
477 | ChatBox.plm_ctrl = TargetByName; |
||
478 | ChatBox.plm_ctrl_name = CB_TARGET; |
||
479 | elseif test == string.lower(WHISPER) then |
||
480 | ChatBox.plm_ctrl = ChatFrame_SendTell; |
||
481 | ChatBox.plm_ctrl_name = WHISPER; |
||
482 | elseif test == string.lower(PARTY_INVITE) then |
||
483 | ChatBox.plm_ctrl = InviteByName; |
||
484 | ChatBox.plm_ctrl_name = PARTY_INVITE; |
||
485 | elseif test == string.lower(IGNORE) then |
||
486 | ChatBox.plm_ctrl = AddIgnore; |
||
487 | ChatBox.plm_ctrl_name = IGNORE; |
||
488 | end |
||
489 | cb_display(WHT .. CB_PLM_CTRL_TEXT_HELP .. RED .. ChatBox.plm_ctrl_name ); |
||
490 | end |
||
491 | else |
||
492 | ChatBox.plm_ctrl = false; |
||
493 | ChatBox.plm_ctrl_name = CB_OFF; |
||
494 | cb_display(WHT .. CB_PLM_CTRL_TEXT_HELP .. RED .. CB_OFF); |
||
495 | end |
||
496 | |||
497 | --no idea what they typed!!! |
||
498 | else |
||
499 | cb_display(RED .. CB_ERRORMSG) |
||
500 | end |
||
501 | end |