comparison Core.lua @ 118:13243f627bf4 v1.2.5

ZA compatability fix.
author Zerotorescue
date Tue, 12 Oct 2010 12:44:45 +0200
parents cff956d6e9d0
children b21c39ea338c
comparison
equal deleted inserted replaced
117:f15324cdda27 118:13243f627bf4
294 294
295 -- Ensure this addon is loaded if AddonLoader is installed 295 -- Ensure this addon is loaded if AddonLoader is installed
296 if AddonLoader and AddonLoader.LoadAddOn then 296 if AddonLoader and AddonLoader.LoadAddOn then
297 AddonLoader:LoadAddOn("QuickAuctions"); 297 AddonLoader:LoadAddOn("QuickAuctions");
298 end 298 end
299 elseif select(6, GetAddOnInfo("ZeroAuctions")) == nil then 299 end
300 self.QuickAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules 300 if select(6, GetAddOnInfo("ZeroAuctions")) == nil then
301 self.ZeroAuctionsEnabled = true; -- Set this as an object variable so we can use it in our modules
301 302
302 -- Ensure this addon is loaded if AddonLoader is installed 303 -- Ensure this addon is loaded if AddonLoader is installed
303 if AddonLoader and AddonLoader.LoadAddOn then 304 if AddonLoader and AddonLoader.LoadAddOn then
304 AddonLoader:LoadAddOn("ZeroAuctions"); 305 AddonLoader:LoadAddOn("ZeroAuctions");
305 end 306 end
309 310
310 311
311 312
312 -- ADJUST POSITIONS 313 -- ADJUST POSITIONS
313 314
314 if self.QuickAuctionsEnabled then 315 if self.QuickAuctionsEnabled or self.ZeroAuctionsEnabled then
315 -- QA is enabled so move the checkbox further to the right 316 -- QA is enabled so move the checkbox further to the right
316 317
317 self.cbOpenAll:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 155, -13); 318 self.cbOpenAll:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 155, -13);
318 end 319 end
319 320
436 -- Hide the InboxTooMuchMail warning to allow room for our mail remaining info line 437 -- Hide the InboxTooMuchMail warning to allow room for our mail remaining info line
437 InboxTooMuchMail:Hide() 438 InboxTooMuchMail:Hide()
438 InboxTooMuchMail.Show = function() end 439 InboxTooMuchMail.Show = function() end
439 440
440 if self.QuickAuctionsEnabled then 441 if self.QuickAuctionsEnabled then
441 local QAMail = LibStub("AceAddon-3.0"):GetAddon("QuickAuctions", true):GetModule("Mail", true); 442 local QAMail = LibStub("AceAddon-3.0"):GetAddon("QuickAuctions", true):GetModule("Mail", true)
442 443
443 if QAMail then 444 if QAMail then
444 -- Hide the open all button 445 -- Hide the open all button
445 QAMail.massOpening:Hide(); 446 QAMail.massOpening:Hide();
446 -- Hide the x mail remaining text 447 -- Hide the x mail remaining text
447 QAMail.totalMail:Hide(); 448 QAMail.totalMail:Hide();
448 else 449 end
449 local ZAMail = LibStub("AceAddon-3.0"):GetAddon("ZeroAuctions", true):GetModule("Mail", true); 450 end
450 451
451 if ZAMail then 452 if self.ZeroAuctionsEnabled then
452 -- Hide the open all button 453 local QAMail = LibStub("AceAddon-3.0"):GetAddon("ZeroAuctions", true):GetModule("Mail", true)
453 ZAMail.massOpening:Hide(); 454
454 -- Hide the x mail remaining text 455 if QAMail then
455 ZAMail.totalMail:Hide(); 456 -- Hide the open all button
456 end 457 QAMail.massOpening:Hide();
458 -- Hide the x mail remaining text
459 QAMail.totalMail:Hide();
457 end 460 end
458 end 461 end
459 462
460 hasOpenedMailAlready = nil; 463 hasOpenedMailAlready = nil;
461 mailboxEmptySoundPlayed = nil; 464 mailboxEmptySoundPlayed = nil;
568 if not MailAddonBusy then 571 if not MailAddonBusy then
569 -- No other addon is currently active 572 -- No other addon is currently active
570 573
571 self:CancelTimer(self.tmrTryAgain, true); -- Insurance 574 self:CancelTimer(self.tmrTryAgain, true); -- Insurance
572 575
573 if QuickAuctionsAutoMail then 576 if self.QuickAuctionsEnabled and QuickAuctionsAutoMail then
574 -- Remember the last known quick auctions status 577 -- Remember the last known quick auctions status
575 lastQuickAuctionsStatus = QuickAuctionsAutoMail:GetChecked(); 578 lastQuickAuctionsStatus = QuickAuctionsAutoMail:GetChecked();
579 end
580 if self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail then
581 -- Remember the last known quick auctions status
582 lastQuickAuctionsStatus = ZeroAuctionsAutoMail:GetChecked();
576 end 583 end
577 if self.db.profile.general.autoDisableQAAutoMail and self.QuickAuctionsEnabled and QuickAuctionsAutoMail and QuickAuctionsAutoMail:GetChecked() then 584 if self.db.profile.general.autoDisableQAAutoMail and self.QuickAuctionsEnabled and QuickAuctionsAutoMail and QuickAuctionsAutoMail:GetChecked() then
578 -- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off 585 -- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off
579 -- We need to do this with a :click to trigger the right events 586 -- We need to do this with a :click to trigger the right events
580 587
581 self:Debug("Turning automail |cffff0000off|r."); 588 self:Debug("Turning automail |cffff0000off|r.");
582 589
583 QuickAuctionsAutoMail:Click(); 590 QuickAuctionsAutoMail:Click();
584 end 591 end
592 if self.db.profile.general.autoDisableQAAutoMail and self.ZeroAuctionsEnabled and ZeroAuctionsAutoMail and ZeroAuctionsAutoMail:GetChecked() then
593 -- If auto disable "QA Auto mail" is enabled and QA's auto mail is currently toggled on, turn it off
594 -- We need to do this with a :click to trigger the right events
595
596 self:Debug("Turning automail |cffff0000off|r.");
597
598 ZeroAuctionsAutoMail:Click();
599 end
600
585 601
586 MailAddonBusy = self:GetName(); 602 MailAddonBusy = self:GetName();
587 603
588 self:Debug("MO_OPEN_MAIL"); 604 self:Debug("MO_OPEN_MAIL");
589 605
645 661
646 QuickAuctionsAutoMail:Click(); 662 QuickAuctionsAutoMail:Click();
647 end 663 end
648 end 664 end
649 665
666 if self.ZeroAuctionsEnabled then
667 -- Zero Auctions enabled?
668 -- Toggle automailing as per settings
669
670 if self.db.profile.general.autoReenableQAAutoMail and ZeroAuctionsAutoMail and not ZeroAuctionsAutoMail:GetChecked() then
671 -- If auto re-enable "QA Auto mail" is enabled and QA's auto mail is currently toggled OFF, turn it on
672 -- We need to do this with a :click to trigger the right events
673
674 self:Debug("Turning automail |cff00ff00on|r.");
675
676 ZeroAuctionsAutoMail:Click();
677 elseif self.db.profile.general.autoSetBackQAAutoMail and ZeroAuctionsAutoMail and lastQuickAuctionsStatus ~= ZeroAuctionsAutoMail:GetChecked() then
678 -- If auto set back "QA Auto mail" is enabled and QA's auto mail is currently not the same as it was before starting, toggle it
679 -- We need to do this with a :click to trigger the right events
680
681 if lastQuickAuctionsStatus then
682 self:Debug("Turning automail |cff00ff00on|r.");
683 else
684 self:Debug("Turning automail |cffff0000off|r.");
685 end
686
687 ZeroAuctionsAutoMail:Click();
688 end
689 end
690
650 if self.db.profile.general.continueOpening then 691 if self.db.profile.general.continueOpening then
651 self:ScheduleOpen(true); 692 self:ScheduleOpen(true);
652 end 693 end
653 end 694 end
654 695
760 QuickAuctionsAutoMail:Click(); 801 QuickAuctionsAutoMail:Click();
761 elseif self.db.profile.general.defaultQAStatus == "disabled" and QuickAuctionsAutoMail:GetChecked() then 802 elseif self.db.profile.general.defaultQAStatus == "disabled" and QuickAuctionsAutoMail:GetChecked() then
762 self:Debug("Turning automail |cffff0000off|r."); 803 self:Debug("Turning automail |cffff0000off|r.");
763 804
764 QuickAuctionsAutoMail:Click(); 805 QuickAuctionsAutoMail:Click();
806 end
807 end
808 if self.ZeroAuctionsEnabled and self.db.profile.general.defaultQAStatus ~= "__remember" and ZeroAuctionsAutoMail then
809 if self.db.profile.general.defaultQAStatus == "_enabled" and not ZeroAuctionsAutoMail:GetChecked() then
810 self:Debug("Turning automail |cff00ff00on|r.");
811
812 ZeroAuctionsAutoMail:Click();
813 elseif self.db.profile.general.defaultQAStatus == "disabled" and ZeroAuctionsAutoMail:GetChecked() then
814 self:Debug("Turning automail |cffff0000off|r.");
815
816 ZeroAuctionsAutoMail:Click();
765 end 817 end
766 end 818 end
767 end 819 end
768 820
769 function MailOpener:FormatMoney(copper) 821 function MailOpener:FormatMoney(copper)