comparison Core.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 1805df31794d
children fcc7112cc365
comparison
equal deleted inserted replaced
49:b2b98cc0c544 50:8e2138877ebf
158 158
159 159
160 -- ADDON / MAIL OPENING STATUS TOGGLER 160 -- ADDON / MAIL OPENING STATUS TOGGLER
161 161
162 -- Make the open all checkbox 162 -- Make the open all checkbox
163 local check = CreateFrame("CheckButton", "cbMailOpenerEnable", MailFrame, "ChatConfigCheckButtonTemplate"); 163 local check = CreateFrame("CheckButton", "cbMailOpenerEnable", MailFrame, "OptionsCheckButtonTemplate");
164 check:SetHeight(26); 164 check:SetHeight(26);
165 check:SetWidth(26); 165 check:SetWidth(26);
166 check:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 68, -13);
166 check:SetChecked(true); 167 check:SetChecked(true);
167 check:SetHitRectInsets(0, -80, 0, 0); 168 check:SetHitRectInsets(0, -80, 0, 0);
168 check:SetScript("OnClick", function(self) 169 check:SetScript("OnClick", function(self)
169 if IsShiftKeyDown() then 170 if IsShiftKeyDown() then
170 -- Shift key = toggle addon on or off, since addon is already on there's only one option 171 -- Shift key = toggle addon on or off, since addon is already on there's only one option
198 199
199 AutoOpenMail = false; 200 AutoOpenMail = false;
200 end 201 end
201 end 202 end
202 end); 203 end);
203 check.tooltip = "Toggle automatic mail opening on or off (you can force this by holding shift when opening the mailbox.\n\nHold the |cffffffffSHIFT|r key to disable the entire addon."; 204 check.tooltipTitle = "Mail Opener status";
204 check:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 68, -13); 205 check.tooltip = "Toggle automatic mail opening |cff00ff00on|r or |cffff0000off|r (you can also enforce this by holding shift when opening the mailbox).\n\nYou can also hold the |cfffed000shift|r key while clicking this checkbox to disable the entire addon instead.";
206 check:SetScript("OnEnter", function(self)
207 GameTooltip:SetOwner(self, "ANCHOR_BOTTOM")
208 GameTooltip:SetPoint("BOTTOM", self, "BOTTOM")
209 GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1)
210
211 if type(self.tooltip) == "string" then
212 GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1);
213 end
214
215 GameTooltip:Show();
216 end);
217 button:SetScript("OnLeave", function(self)
218 GameTooltip:Hide();
219 end);
205 220
206 -- Get reference to the text field 221 -- Get reference to the text field
207 local checkboxText = _G[check:GetName() .. "Text"]; 222 local checkboxText = _G[check:GetName() .. "Text"];
208 checkboxText:SetText("Mail Opener"); 223 checkboxText:SetText("Mail Opener");
209 -- We like this color more
210 checkboxText:SetTextColor(1, 0.8, 0, 1);
211 224
212 self.cbOpenAll = check; 225 self.cbOpenAll = check;
213 226
214 227
215 228
228 MailOpenerConfig:Show(); 241 MailOpenerConfig:Show();
229 242
230 --BETA:if MailOpener.db.profile.uses >= 15 then 243 --BETA:if MailOpener.db.profile.uses >= 15 then
231 --BETA: MailOpener:ShowBetaPopup(); 244 --BETA: MailOpener:ShowBetaPopup();
232 --BETA:end 245 --BETA:end
246 end);
247 button.tooltipTitle = "Mail Opener Config";
248 button.tooltip = "Click to open the configuration window for Mail Opener.";
249 button:SetScript("OnEnter", function(self)
250 GameTooltip:SetOwner(self, "ANCHOR_BOTTOM")
251 GameTooltip:SetPoint("BOTTOM", self, "TOP")
252 GameTooltip:SetText(self.tooltipTitle, 1, .82, 0, 1)
253
254 if type(self.tooltip) == "string" then
255 GameTooltip:AddLine(self.tooltip, 1, 1, 1, 1);
256 end
257
258 GameTooltip:Show();
259 end);
260 button:SetScript("OnLeave", function(self)
261 GameTooltip:Hide();
233 end); 262 end);
234 263
235 self.btnConfig = button; 264 self.btnConfig = button;
236 265
237 266