Hi buddies,
There is a button on TSM auto mail, that on press, send all u listed goods by mail to another character.
But this button dont have a name, and so, cannot make a macro to use it.
I tried by myself adding a name on it, but it gave me errors.
If i can give it a name, i could keybind the macro and then keyspam.
Well, here is the code:
Code:
function AutoMail:OnEnable()
local button = CreateFrame("Button", nil, MailFrame, "UIPanelButtonTemplate")
button:SetHeight(26)
button:SetWidth(250)
button:SetText(L["TradeSkillMaster_Mailing: Auto-Mail"])
button:SetFrameStrata("HIGH")
button:SetScript("OnEnter", function(self)
GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT")
GameTooltip:SetText(self.tooltip, 1, 1, 1, nil, true)
GameTooltip:Show()
end)
button:SetScript("OnLeave", function() GameTooltip:Hide() end)
button:SetScript("OnHide", function()
private:StopAutoMailing()
end)
button:SetScript("OnClick", function(self)
private:StartAutoMailing()
end)
button:SetPoint("TOPLEFT", MailFrame, "TOPLEFT", 70, 13)
button.tooltip = L["Runs TradeSkillMaster_Mailing's auto mailer, the last patch of mails will take ~10 seconds to send.\n\n[WARNING!] You will not get any confirmation before it starts to send mails, it is your own fault if you mistype your bankers name."]
private.button = button
if ElvUI then
ElvUI[1]:GetModule("Skins"):HandleButton(button)
end
end
I think the name should go on the place of the nil on
Code:
local button = CreateFrame("Button", nil, MailFrame, "UIPanelButtonTemplate")
But just replacing it with "TSMAutoMailButton", give me error.
Anyone can help me fix this addon?
Thanks