comparison Modules/Collected.lua @ 54:5f0e174c8adc

Hopefully fixed the usage of "mails".
author Zerotorescue
date Sun, 12 Sep 2010 22:07:12 +0200
parents 81e7cfcc36b9
children 75c36b3d5443
comparison
equal deleted inserted replaced
53:6b3d894b20f5 54:5f0e174c8adc
252 printMessage = printMessage .. format("Spent %d minutes and %d seconds collecting mail. ", mailOpened, timeSpentMinutes, timeSpentSeconds); 252 printMessage = printMessage .. format("Spent %d minutes and %d seconds collecting mail. ", mailOpened, timeSpentMinutes, timeSpentSeconds);
253 else 253 else
254 printMessage = printMessage .. format("Spent %d seconds collecting mail. ", mailOpened, timeSpentSeconds); 254 printMessage = printMessage .. format("Spent %d seconds collecting mail. ", mailOpened, timeSpentSeconds);
255 end 255 end
256 end 256 end
257
258 local mailsPrefix = "";
259 if mailOpened == 1 then
260 mailsPrefix = "From this mail";
261 else
262 mailsPrefix = "From these mails";
263 end
264 257
265 -- Did we record any items or gold being looted? 258 -- Did we record any items or gold being looted?
266 if (itemsGained and itemsGained > 0) and (earned and earned > 0) then 259 if (itemsGained and itemsGained > 0) and (earned and earned > 0) then
267 printMessage = printMessage .. format("%s you gained %d items and %s.", mailsPrefix, itemsGained, MailOpener:FormatMoney(earned)); 260 printMessage = printMessage .. format("You gained %d items and %s from this.", itemsGained, MailOpener:FormatMoney(earned));
268 elseif itemsGained and itemsGained > 0 then 261 elseif itemsGained and itemsGained > 0 then
269 printMessage = printMessage .. format("%s you gained %d items.", mailsPrefix, itemsGained); 262 printMessage = printMessage .. format("You gained %d items from this.", itemsGained);
270 elseif earned and earned > 0 then 263 elseif earned and earned > 0 then
271 printMessage = printMessage .. format("%s you gained %s.", mailsPrefix, MailOpener:FormatMoney(earned)); 264 printMessage = printMessage .. format("You gained %s from this.", MailOpener:FormatMoney(earned));
272 end 265 end
273 266
274 -- Did we record anything? print that! 267 -- Did we record anything? print that!
275 if printMessage ~= "" then 268 if printMessage ~= "" then
276 print("|cff15ff00Mail Opener|r: " .. printMessage); 269 print("|cff15ff00Mail Opener|r: " .. printMessage);
302 else 295 else
303 printMessage = printMessage .. format("Spent %d seconds collecting mail this session. ", mailOpened, timeSpentSeconds); 296 printMessage = printMessage .. format("Spent %d seconds collecting mail this session. ", mailOpened, timeSpentSeconds);
304 end 297 end
305 end 298 end
306 299
307 local mailsPrefix = "";
308 if sessionMailOpened == 1 then
309 mailsPrefix = "From this mail";
310 else
311 mailsPrefix = "From these mails";
312 end
313
314 -- Did we record any items or gold being looted? 300 -- Did we record any items or gold being looted?
315 if (sessionItemsgained and sessionItemsgained > 0) and (sessionEarned and sessionEarned > 0) then 301 if (sessionItemsgained and sessionItemsgained > 0) and (sessionEarned and sessionEarned > 0) then
316 printMessage = printMessage .. format("%s you gained %d items and %s.", mailsPrefix, sessionItemsgained, MailOpener:FormatMoney(sessionEarned)); 302 printMessage = printMessage .. format("You gained %d items and %s from this.", sessionItemsgained, MailOpener:FormatMoney(sessionEarned));
317 elseif sessionItemsgained and sessionItemsgained > 0 then 303 elseif sessionItemsgained and sessionItemsgained > 0 then
318 printMessage = printMessage .. format("%s you gained %d items.", mailsPrefix, sessionItemsgained); 304 printMessage = printMessage .. format("You gained %d items from this.", sessionItemsgained);
319 elseif sessionEarned and sessionEarned > 0 then 305 elseif sessionEarned and sessionEarned > 0 then
320 printMessage = printMessage .. format("%s you gained %s.", mailsPrefix, MailOpener:FormatMoney(sessionEarned)); 306 printMessage = printMessage .. format("You gained %s from this.", MailOpener:FormatMoney(sessionEarned));
321 end 307 end
322 308
323 -- Did we record anything? print that! 309 -- Did we record anything? print that!
324 if printMessage ~= "" then 310 if printMessage ~= "" then
325 print(printMessage); 311 print(printMessage);