Mercurial > wow > mailopener
diff Modules/OpenAll.lua @ 50:8e2138877ebf
Added neat(er) tooltips for both the mail opener status toggler as the config button.
Added an option below the filters to disable the shift click functionality of the open all button.
| author | Zerotorescue |
|---|---|
| date | Sun, 12 Sep 2010 21:06:05 +0200 |
| parents | f630d882d008 |
| children | fcc7112cc365 |
line wrap: on
line diff
--- a/Modules/OpenAll.lua Sun Sep 12 20:35:37 2010 +0200 +++ b/Modules/OpenAll.lua Sun Sep 12 21:06:05 2010 +0200 @@ -26,6 +26,7 @@ }, normalAttachments = false, normalMoney = true, + allowShiftClick = true, }, }, }; @@ -40,8 +41,7 @@ if not self.btnOpenAll then -- Open all button local button = CreateFrame("Button", "btnMailOpenerOpenAll", InboxFrame, "UIPanelButtonTemplate"); - button.originalText = "Open all"; -- we will use this in the tooltip and to set this text back after opening - button:SetText(button.originalText); + button:SetText("Open all"); button:SetHeight(26); button:SetWidth(120); button:SetPoint("BOTTOM", InboxFrame, "CENTER", -10, -165); @@ -136,14 +136,15 @@ mod:Open(true, IsShiftKeyDown()); end end); + button.tooltipTitle = "Open all"; button.tooltip = "Hold |cfffed000shift|r while clicking this button to temporarily override your filters and loot every single mail contain attachments and gold.\n\n|cfffed000Right|r click this button to quickly adjust mail opening filters for this profile."; button:SetScript("OnEnter", function(self) GameTooltip:SetOwner(self, "ANCHOR_NONE") GameTooltip:SetPoint("BOTTOM", self, "TOP") - GameTooltip:SetText(self.originalText, 1, .82, 0, 1) + GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1) - if type(button.tooltip) == "string" then - GameTooltip:AddLine(button.tooltip, 1, 1, 1, 1); + if type(self.tooltip) == "string" then + GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1); end GameTooltip:Show(); @@ -374,7 +375,7 @@ -- Update the caret MAIL_ITEM_INDEX = newMailItemIndex; -- Do we want to override filters and open every single mail? - if everything then + if everything and self.db.profile.filter.allowShiftClick then MAIL_OPEN_EVERYTHING = true; print("|cff15ff00Mail Opener|r: Shift key was held while pressing the open all button. Temporarily overriding filters; going to open every mail with attachments."); @@ -738,7 +739,7 @@ if openingStatus then self.btnOpenAll:SetText("Opening..."); else - self.btnOpenAll:SetText(self.btnOpenAll.originalText); + self.btnOpenAll:SetText("Open all"); end end @@ -833,6 +834,15 @@ get = function() return self.db.profile.filter.normalMoney; end, width = "double", }, + allowShiftClick = { + order = 60, + type = "toggle", + name = "Allow shift-clicking of the |cfffed000Open All|r button to autoloot |cfffed000everything|r, regardless of the above filters.", + desc = "Allow shift-clicking of the |cfffed000Open All|r button to autoloot |cfffed000everything|r with attachments, temporarily overriding all filters.", + set = function(i, v) self.db.profile.filter.allowShiftClick = v; end, + get = function() return self.db.profile.filter.allowShiftClick; end, + width = "full", + }, }, }, -- Continuous opening config inline group
