Mercurial > wow > mailopener
diff Core.lua @ 91:0a8e4a93316d
Extremely small irrelevant cleaning up changes I made while looking through the code.
| author | Zerotorescue |
|---|---|
| date | Sat, 18 Sep 2010 15:37:27 +0200 |
| parents | c15dbeb84ddc |
| children | d62eaa354443 |
line wrap: on
line diff
--- a/Core.lua Sat Sep 18 15:36:23 2010 +0200 +++ b/Core.lua Sat Sep 18 15:37:27 2010 +0200 @@ -171,36 +171,36 @@ check:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 68, -13); check:SetChecked(true); check:SetHitRectInsets(0, -80, 0, 0); - check:SetScript("OnClick", function(self) + check:SetScript("OnClick", function(cbSelf) if IsShiftKeyDown() then -- Shift key = toggle addon on or off, since addon is already on there's only one option - if not MailOpener:IsEnabled() then - MailOpener:Print(L["Shift key was held down, so |cff00ff00enabling|r the entire addon as well as automatic opening of mail."]); + if not self:IsEnabled() then + self:Print(L["Shift key was held down, so |cff00ff00enabling|r the entire addon as well as automatic opening of mail."]); - MailOpener:Enable(); + self:Enable(); -- The above calls MAIL_SHOW which changes AutoOpenMail, so we can't remember the old setting AutoOpenMail = true; - self:SetChecked(true); + cbSelf:SetChecked(true); else - MailOpener:Print(L["Shift key was held down, so |cffff0000disabling|r the entire addon."]); + self:Print(L["Shift key was held down, so |cffff0000disabling|r the entire addon."]); - MailOpener:Disable(); + self:Disable(); - self:SetChecked(false); + cbSelf:SetChecked(false); end else -- Normal click - if self:GetChecked() then - MailOpener:Print(L["|cff00ff00Enabling|r automatic opening of mail."]); + if cbSelf:GetChecked() then + self:Print(L["|cff00ff00Enabling|r automatic opening of mail."]); AutoOpenMail = true; - MailOpener:ScheduleOpen(false); + self:ScheduleOpen(false); else - MailOpener:Print(L["|cffff0000Disabling|r automatic opening of mail."]); + self:Print(L["|cffff0000Disabling|r automatic opening of mail."]); AutoOpenMail = false; end @@ -208,20 +208,20 @@ end); check.tooltipTitle = L["Mail Opener status"]; check.tooltip = L["Toggle automatic mail opening |cff00ff00on|r or |cffff0000off|r (you can also enforce this by holding shift when opening the mailbox).\n\nYou can toggle this addon |cff00ff00on|r or |cffff0000off|r by |cfffed000shift-clicking|r this checkbox."]; - check:SetScript("OnEnter", function(self) - if MailOpener.db.profile.general.showHelpTooltips then - GameTooltip:SetOwner(self, "ANCHOR_BOTTOM") - GameTooltip:SetPoint("BOTTOM", self, "BOTTOM") - GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1) + check:SetScript("OnEnter", function(cbSelf) + if self.db.profile.general.showHelpTooltips then + GameTooltip:SetOwner(cbSelf, "ANCHOR_BOTTOM") + GameTooltip:SetPoint("BOTTOM", cbSelf, "BOTTOM") + GameTooltip:SetText(cbSelf.tooltipTitle, 1, .82, 0, 1) - if type(self.tooltip) == "string" then - GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1); + if type(cbSelf.tooltip) == "string" then + GameTooltip:AddLine(cbSelf.tooltip, 1, 1, 1, 1); end GameTooltip:Show(); end end); - check:SetScript("OnLeave", function(self) + check:SetScript("OnLeave", function(cbSelf) GameTooltip:Hide(); end); @@ -253,20 +253,20 @@ end); button.tooltipTitle = L["Mail Opener Config"]; button.tooltip = L["Click to open the configuration window for Mail Opener."]; - button:SetScript("OnEnter", function(self) - if MailOpener.db.profile.general.showHelpTooltips then - GameTooltip:SetOwner(self, "ANCHOR_BOTTOM") - GameTooltip:SetPoint("BOTTOM", self, "TOP") - GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1) + button:SetScript("OnEnter", function(btnSelf) + if self.db.profile.general.showHelpTooltips then + GameTooltip:SetOwner(btnSelf, "ANCHOR_BOTTOM") + GameTooltip:SetPoint("BOTTOM", btnSelf, "TOP") + GameTooltip:SetText(btnSelf.tooltipTitle, 1, .82, 0, 1) - if type(self.tooltip) == "string" then - GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1); + if type(btnSelf.tooltip) == "string" then + GameTooltip:AddLine(btnSelf.tooltip, 1, 1, 1, 1); end GameTooltip:Show(); end end); - button:SetScript("OnLeave", function(self) + button:SetScript("OnLeave", function(btnSelf) GameTooltip:Hide(); end); @@ -377,7 +377,7 @@ AutoOpenMail = true; MailOpener:ScheduleOpen(false); end, - OnCancel = function (_,reason) + OnCancel = function () MailOpener:Print(L["You can always change the default status in the General config (|cff00ffff/mo c|r)."]); end, timeout = 0,
