renaming
This commit is contained in:
+74
-74
@@ -1,16 +1,16 @@
|
|||||||
mail = CreateFrame('Frame', nil, MailFrame)
|
Mail = CreateFrame('Frame', nil, MailFrame)
|
||||||
local _G = getfenv(0)
|
local _G = getfenv(0)
|
||||||
setfenv(1, setmetatable(mail, {__index=_G}))
|
setfenv(1, setmetatable(Mail, {__index=_G}))
|
||||||
|
|
||||||
do
|
do
|
||||||
local f = CreateFrame'Frame'
|
local f = CreateFrame'Frame'
|
||||||
f:SetScript('OnEvent', function() mail[event]() end)
|
f:SetScript('OnEvent', function() Mail[event]() end)
|
||||||
for _, event in {'ADDON_LOADED', 'PLAYER_LOGIN', 'UI_ERROR_MESSAGE', 'CURSOR_UPDATE', 'BAG_UPDATE', 'MAIL_CLOSED', 'MAIL_SEND_SUCCESS', 'MAIL_INBOX_UPDATE'} do
|
for _, event in {'ADDON_LOADED', 'PLAYER_LOGIN', 'UI_ERROR_MESSAGE', 'CURSOR_UPDATE', 'BAG_UPDATE', 'MAIL_CLOSED', 'MAIL_SEND_SUCCESS', 'MAIL_INBOX_UPDATE'} do
|
||||||
f:RegisterEvent(event)
|
f:RegisterEvent(event)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.mail_AutoCompleteNames = {}
|
_G.Mail_AutoCompleteNames = {}
|
||||||
|
|
||||||
local ATTACHMENTS_MAX = 21
|
local ATTACHMENTS_MAX = 21
|
||||||
local ATTACHMENTS_PER_ROW_SEND = 7
|
local ATTACHMENTS_PER_ROW_SEND = 7
|
||||||
@@ -88,13 +88,13 @@ do
|
|||||||
_G[k] = v
|
_G[k] = v
|
||||||
end
|
end
|
||||||
local key = GetCVar'realmName' .. '|' .. UnitFactionGroup'player'
|
local key = GetCVar'realmName' .. '|' .. UnitFactionGroup'player'
|
||||||
mail_AutoCompleteNames[key] = mail_AutoCompleteNames[key] or {}
|
Mail_AutoCompleteNames[key] = Mail_AutoCompleteNames[key] or {}
|
||||||
for char, lastSeen in mail_AutoCompleteNames[key] do
|
for char, lastSeen in Mail_AutoCompleteNames[key] do
|
||||||
if GetTime() - lastSeen > 60 * 60 * 24 * 30 then
|
if GetTime() - lastSeen > 60 * 60 * 24 * 30 then
|
||||||
mail_AutoCompleteNames[key][char] = nil
|
Mail_AutoCompleteNames[key][char] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mail_AutoCompleteNames[key][UnitName'player'] = GetTime()
|
Mail_AutoCompleteNames[key][UnitName'player'] = GetTime()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -108,14 +108,14 @@ do
|
|||||||
_G[k] = v
|
_G[k] = v
|
||||||
end
|
end
|
||||||
local key = GetCVar'realmName' .. '|' .. UnitFactionGroup'player'
|
local key = GetCVar'realmName' .. '|' .. UnitFactionGroup'player'
|
||||||
mail_AutoCompleteNames[key] = mail_AutoCompleteNames[key] or {}
|
Mail_AutoCompleteNames[key] = Mail_AutoCompleteNames[key] or {}
|
||||||
for char, lastSeen in mail_AutoCompleteNames[key] do
|
for char, lastSeen in Mail_AutoCompleteNames[key] do
|
||||||
if GetTime() - lastSeen > 60 * 60 * 24 * 30 then
|
if GetTime() - lastSeen > 60 * 60 * 24 * 30 then
|
||||||
mail_AutoCompleteNames[key][char] = nil
|
Mail_AutoCompleteNames[key][char] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function addAutoCompleteName(name)
|
function addAutoCompleteName(name)
|
||||||
mail_AutoCompleteNames[key][name] = GetTime()
|
Mail_AutoCompleteNames[key][name] = GetTime()
|
||||||
end
|
end
|
||||||
addAutoCompleteName(UnitName'player')
|
addAutoCompleteName(UnitName'player')
|
||||||
end
|
end
|
||||||
@@ -131,7 +131,7 @@ function MAIL_INBOX_UPDATE()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ADDON_LOADED()
|
function ADDON_LOADED()
|
||||||
if arg1 ~= 'mail' then return end
|
if arg1 ~= 'Mail' then return end
|
||||||
|
|
||||||
MailFrame.pushable = 1
|
MailFrame.pushable = 1
|
||||||
FriendsFrame.pushable = 2
|
FriendsFrame.pushable = 2
|
||||||
@@ -141,7 +141,7 @@ function ADDON_LOADED()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function hook.OpenMail_Reply(...)
|
function hook.OpenMail_Reply(...)
|
||||||
_G.mail_To = nil
|
_G.Mail_To = nil
|
||||||
return orig.OpenMail_Reply(unpack(arg))
|
return orig.OpenMail_Reply(unpack(arg))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -250,7 +250,7 @@ function hook.SendMailFrame_Update()
|
|||||||
local last = SendMail_NumAttachments()
|
local last = SendMail_NumAttachments()
|
||||||
|
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
local btn = _G['mailAttachment' .. i]
|
local btn = _G['MailAttachment' .. i]
|
||||||
|
|
||||||
local texture, count
|
local texture, count
|
||||||
if btn.item then
|
if btn.item then
|
||||||
@@ -307,8 +307,8 @@ function hook.SendMailFrame_Update()
|
|||||||
local marginxl = 8 + 6
|
local marginxl = 8 + 6
|
||||||
local marginxr = 40 + 6
|
local marginxr = 40 + 6
|
||||||
local areax = SendMailFrame:GetWidth() - marginxl - marginxr
|
local areax = SendMailFrame:GetWidth() - marginxl - marginxr
|
||||||
local iconx = mailAttachment1:GetWidth() + 2
|
local iconx = MailAttachment1:GetWidth() + 2
|
||||||
local icony = mailAttachment1:GetHeight() + 2
|
local icony = MailAttachment1:GetHeight() + 2
|
||||||
local gapx1 = floor((areax - (iconx * ATTACHMENTS_PER_ROW_SEND)) / (ATTACHMENTS_PER_ROW_SEND - 1))
|
local gapx1 = floor((areax - (iconx * ATTACHMENTS_PER_ROW_SEND)) / (ATTACHMENTS_PER_ROW_SEND - 1))
|
||||||
local gapx2 = floor((areax - (iconx * ATTACHMENTS_PER_ROW_SEND) - (gapx1 * (ATTACHMENTS_PER_ROW_SEND - 1))) / 2)
|
local gapx2 = floor((areax - (iconx * ATTACHMENTS_PER_ROW_SEND) - (gapx1 * (ATTACHMENTS_PER_ROW_SEND - 1))) / 2)
|
||||||
local gapy1 = 5
|
local gapy1 = 5
|
||||||
@@ -320,7 +320,7 @@ function hook.SendMailFrame_Update()
|
|||||||
local taby = (icony + gapy1)
|
local taby = (icony + gapy1)
|
||||||
local scrollHeight = 249 - areay
|
local scrollHeight = 249 - areay
|
||||||
|
|
||||||
mailHorizontalBarLeft:SetPoint('TOPLEFT', SendMailFrame, 'BOTTOMLEFT', 2 + 15, 184 + areay - 14)
|
MailHorizontalBarLeft:SetPoint('TOPLEFT', SendMailFrame, 'BOTTOMLEFT', 2 + 15, 184 + areay - 14)
|
||||||
|
|
||||||
SendMailScrollFrame:SetHeight(scrollHeight)
|
SendMailScrollFrame:SetHeight(scrollHeight)
|
||||||
SendMailScrollChildFrame:SetHeight(scrollHeight)
|
SendMailScrollChildFrame:SetHeight(scrollHeight)
|
||||||
@@ -339,9 +339,9 @@ function hook.SendMailFrame_Update()
|
|||||||
-- Set Items
|
-- Set Items
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
if cursory >= 0 then
|
if cursory >= 0 then
|
||||||
_G['mailAttachment' .. i]:Enable()
|
_G['MailAttachment' .. i]:Enable()
|
||||||
_G['mailAttachment' .. i]:Show()
|
_G['MailAttachment' .. i]:Show()
|
||||||
_G['mailAttachment' .. i]:SetPoint('TOPLEFT', 'SendMailFrame', 'BOTTOMLEFT', indentx + (tabx * cursorx), indenty + (taby * cursory))
|
_G['MailAttachment' .. i]:SetPoint('TOPLEFT', 'SendMailFrame', 'BOTTOMLEFT', indentx + (tabx * cursorx), indenty + (taby * cursory))
|
||||||
|
|
||||||
cursorx = cursorx + 1
|
cursorx = cursorx + 1
|
||||||
if cursorx >= ATTACHMENTS_PER_ROW_SEND then
|
if cursorx >= ATTACHMENTS_PER_ROW_SEND then
|
||||||
@@ -349,7 +349,7 @@ function hook.SendMailFrame_Update()
|
|||||||
cursorx = 0
|
cursorx = 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
_G['mailAttachment' .. i]:Hide()
|
_G['MailAttachment' .. i]:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -397,15 +397,15 @@ function hook.UseContainerItem(bag, slot, onself)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function mailMailButton_OnClick()
|
function MailMailButton_OnClick()
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
|
|
||||||
_G.mail_To = SendMailNameEditBox:GetText()
|
_G.Mail_To = SendMailNameEditBox:GetText()
|
||||||
SendMailNameEditBox:HighlightText()
|
SendMailNameEditBox:HighlightText()
|
||||||
|
|
||||||
SendMail_state = {
|
SendMail_state = {
|
||||||
to = mail_To,
|
to = Mail_To,
|
||||||
subject = mailSubjectEditBox:GetText(),
|
subject = MailSubjectEditBox:GetText(),
|
||||||
body = SendMailBodyEditBox:GetText(),
|
body = SendMailBodyEditBox:GetText(),
|
||||||
money = MoneyInputFrame_GetCopper(SendMailMoney),
|
money = MoneyInputFrame_GetCopper(SendMailMoney),
|
||||||
cod = SendMailCODButton:GetChecked(),
|
cod = SendMailCODButton:GetChecked(),
|
||||||
@@ -418,17 +418,17 @@ function mailMailButton_OnClick()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function SendMail_Load()
|
function SendMail_Load()
|
||||||
SendMailFrame:CreateTexture('mailHorizontalBarLeft', 'BACKGROUND')
|
SendMailFrame:CreateTexture('MailHorizontalBarLeft', 'BACKGROUND')
|
||||||
mailHorizontalBarLeft:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar]])
|
MailHorizontalBarLeft:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar]])
|
||||||
mailHorizontalBarLeft:SetWidth(256)
|
MailHorizontalBarLeft:SetWidth(256)
|
||||||
mailHorizontalBarLeft:SetHeight(16)
|
MailHorizontalBarLeft:SetHeight(16)
|
||||||
mailHorizontalBarLeft:SetTexCoord(0, 1, 0, .25)
|
MailHorizontalBarLeft:SetTexCoord(0, 1, 0, .25)
|
||||||
SendMailFrame:CreateTexture('mailHorizontalBarRight', 'BACKGROUND')
|
SendMailFrame:CreateTexture('MailHorizontalBarRight', 'BACKGROUND')
|
||||||
mailHorizontalBarRight:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar]])
|
MailHorizontalBarRight:SetTexture([[Interface\ClassTrainerFrame\UI-ClassTrainer-HorizontalBar]])
|
||||||
mailHorizontalBarRight:SetWidth(75)
|
MailHorizontalBarRight:SetWidth(75)
|
||||||
mailHorizontalBarRight:SetHeight(16)
|
MailHorizontalBarRight:SetHeight(16)
|
||||||
mailHorizontalBarRight:SetTexCoord(0, .29296875, .25, .5)
|
MailHorizontalBarRight:SetTexCoord(0, .29296875, .25, .5)
|
||||||
mailHorizontalBarRight:SetPoint('LEFT', mailHorizontalBarLeft, 'RIGHT')
|
MailHorizontalBarRight:SetPoint('LEFT', MailHorizontalBarLeft, 'RIGHT')
|
||||||
|
|
||||||
do
|
do
|
||||||
local background = ({SendMailPackageButton:GetRegions()})[1]
|
local background = ({SendMailPackageButton:GetRegions()})[1]
|
||||||
@@ -458,61 +458,61 @@ function SendMail_Load()
|
|||||||
SendMailSendMoneyButton:SetPoint('TOPLEFT', SendMailMoney, 'TOPRIGHT', 0, 12)
|
SendMailSendMoneyButton:SetPoint('TOPLEFT', SendMailMoney, 'TOPRIGHT', 0, 12)
|
||||||
|
|
||||||
-- hack to avoid automatic subject setting and button disabling from weird blizzard code
|
-- hack to avoid automatic subject setting and button disabling from weird blizzard code
|
||||||
mailMailButton = SendMailMailButton
|
MailMailButton = SendMailMailButton
|
||||||
_G.SendMailMailButton = setmetatable({}, {__index = function() return function() end end})
|
_G.SendMailMailButton = setmetatable({}, {__index = function() return function() end end})
|
||||||
_G.SendMailMailButton_OnClick = mailMailButton_OnClick
|
_G.SendMailMailButton_OnClick = MailMailButton_OnClick
|
||||||
mailSubjectEditBox = SendMailSubjectEditBox
|
MailSubjectEditBox = SendMailSubjectEditBox
|
||||||
_G.SendMailSubjectEditBox = setmetatable({}, {
|
_G.SendMailSubjectEditBox = setmetatable({}, {
|
||||||
__index = function(_, key)
|
__index = function(_, key)
|
||||||
return function(_, ...)
|
return function(_, ...)
|
||||||
return mailSubjectEditBox[key](mailSubjectEditBox, unpack(arg))
|
return MailSubjectEditBox[key](MailSubjectEditBox, unpack(arg))
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
SendMailNameEditBox._SetText = SendMailNameEditBox.SetText
|
SendMailNameEditBox._SetText = SendMailNameEditBox.SetText
|
||||||
function SendMailNameEditBox:SetText(...)
|
function SendMailNameEditBox:SetText(...)
|
||||||
if not mail_To then
|
if not Mail_To then
|
||||||
return self:_SetText(unpack(arg))
|
return self:_SetText(unpack(arg))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
SendMailNameEditBox:SetScript('OnShow', function()
|
SendMailNameEditBox:SetScript('OnShow', function()
|
||||||
if mail_To then
|
if Mail_To then
|
||||||
this:_SetText(mail_To)
|
this:_SetText(Mail_To)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
SendMailNameEditBox:SetScript('OnChar', function()
|
SendMailNameEditBox:SetScript('OnChar', function()
|
||||||
_G.mail_To = nil
|
_G.Mail_To = nil
|
||||||
GetSuggestions()
|
GetSuggestions()
|
||||||
end)
|
end)
|
||||||
SendMailNameEditBox:SetScript('OnTabPressed', function()
|
SendMailNameEditBox:SetScript('OnTabPressed', function()
|
||||||
if mailAutoCompleteBox:IsVisible() then
|
if MailAutoCompleteBox:IsVisible() then
|
||||||
if IsShiftKeyDown() then
|
if IsShiftKeyDown() then
|
||||||
PreviousMatch()
|
PreviousMatch()
|
||||||
else
|
else
|
||||||
NextMatch()
|
NextMatch()
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
mailSubjectEditBox:SetFocus()
|
MailSubjectEditBox:SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
SendMailNameEditBox:SetScript('OnEnterPressed', function()
|
SendMailNameEditBox:SetScript('OnEnterPressed', function()
|
||||||
if mailAutoCompleteBox:IsVisible() then
|
if MailAutoCompleteBox:IsVisible() then
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
this:HighlightText(0, 0)
|
this:HighlightText(0, 0)
|
||||||
else
|
else
|
||||||
mailSubjectEditBox:SetFocus()
|
MailSubjectEditBox:SetFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
SendMailNameEditBox:SetScript('OnEscapePressed', function()
|
SendMailNameEditBox:SetScript('OnEscapePressed', function()
|
||||||
if mailAutoCompleteBox:IsVisible() then
|
if MailAutoCompleteBox:IsVisible() then
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
else
|
else
|
||||||
this:ClearFocus()
|
this:ClearFocus()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
function SendMailNameEditBox.focusLoss()
|
function SendMailNameEditBox.focusLoss()
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
end
|
end
|
||||||
do
|
do
|
||||||
local orig = SendMailNameEditBox:GetScript'OnTextChanged'
|
local orig = SendMailNameEditBox:GetScript'OnTextChanged'
|
||||||
@@ -568,16 +568,16 @@ end
|
|||||||
|
|
||||||
function hook.SendMailFrame_CanSend()
|
function hook.SendMailFrame_CanSend()
|
||||||
if not SendMail_sending and strlen(SendMailNameEditBox:GetText()) > 0 and (SendMailSendMoneyButton:GetChecked() and MoneyInputFrame_GetCopper(SendMailMoney) or 0) + GetSendMailPrice() * max(1, SendMail_NumAttachments()) <= GetMoney() then
|
if not SendMail_sending and strlen(SendMailNameEditBox:GetText()) > 0 and (SendMailSendMoneyButton:GetChecked() and MoneyInputFrame_GetCopper(SendMailMoney) or 0) + GetSendMailPrice() * max(1, SendMail_NumAttachments()) <= GetMoney() then
|
||||||
mailMailButton:Enable()
|
MailMailButton:Enable()
|
||||||
else
|
else
|
||||||
mailMailButton:Disable()
|
MailMailButton:Disable()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SendMail_Attached(bag, slot)
|
function SendMail_Attached(bag, slot)
|
||||||
if not MailFrame:IsVisible() then return false end
|
if not MailFrame:IsVisible() then return false end
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
local btn = _G['mailAttachment' .. i]
|
local btn = _G['MailAttachment' .. i]
|
||||||
if btn.item and btn.item[1] == bag and btn.item[2] == slot then
|
if btn.item and btn.item[1] == bag and btn.item[2] == slot then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@@ -610,8 +610,8 @@ function SendMail_SetAttachment(item, slot)
|
|||||||
return
|
return
|
||||||
elseif not slot then
|
elseif not slot then
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
if not _G['mailAttachment' .. i].item then
|
if not _G['MailAttachment' .. i].item then
|
||||||
slot = _G['mailAttachment' .. i]
|
slot = _G['MailAttachment' .. i]
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -639,7 +639,7 @@ end
|
|||||||
function SendMail_NumAttachments()
|
function SendMail_NumAttachments()
|
||||||
local x = 0
|
local x = 0
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
if _G['mailAttachment' .. i].item then
|
if _G['MailAttachment' .. i].item then
|
||||||
x = x + 1
|
x = x + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -649,7 +649,7 @@ end
|
|||||||
function SendMail_Attachments()
|
function SendMail_Attachments()
|
||||||
local t = {}
|
local t = {}
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
local btn = _G['mailAttachment' .. i]
|
local btn = _G['MailAttachment' .. i]
|
||||||
if btn.item then
|
if btn.item then
|
||||||
tinsert(t, btn.item)
|
tinsert(t, btn.item)
|
||||||
end
|
end
|
||||||
@@ -660,18 +660,18 @@ end
|
|||||||
function SendMail_Clear()
|
function SendMail_Clear()
|
||||||
local anyItem
|
local anyItem
|
||||||
for i = 1, ATTACHMENTS_MAX do
|
for i = 1, ATTACHMENTS_MAX do
|
||||||
anyItem = anyItem or _G['mailAttachment' .. i].item
|
anyItem = anyItem or _G['MailAttachment' .. i].item
|
||||||
_G['mailAttachment' .. i].item = nil
|
_G['MailAttachment' .. i].item = nil
|
||||||
end
|
end
|
||||||
if anyItem then
|
if anyItem then
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
PickupContainerItem(unpack(anyItem))
|
PickupContainerItem(unpack(anyItem))
|
||||||
ClearCursor()
|
ClearCursor()
|
||||||
end
|
end
|
||||||
mailMailButton:Disable()
|
MailMailButton:Disable()
|
||||||
SendMailNameEditBox:SetText''
|
SendMailNameEditBox:SetText''
|
||||||
SendMailNameEditBox:SetFocus()
|
SendMailNameEditBox:SetFocus()
|
||||||
mailSubjectEditBox:SetText''
|
MailSubjectEditBox:SetText''
|
||||||
SendMailBodyEditBox:SetText''
|
SendMailBodyEditBox:SetText''
|
||||||
MoneyInputFrame_ResetMoney(SendMailMoney)
|
MoneyInputFrame_ResetMoney(SendMailMoney)
|
||||||
SendMailRadioButton_OnClick(1)
|
SendMailRadioButton_OnClick(1)
|
||||||
@@ -689,7 +689,7 @@ function SendMail_Send()
|
|||||||
orig.ClickSendMailItemButton()
|
orig.ClickSendMailItemButton()
|
||||||
|
|
||||||
if not GetSendMailItem() then
|
if not GetSendMailItem() then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage('mail: ' .. ERROR_CAPS, 1, 0, 0)
|
DEFAULT_CHAT_FRAME:AddMessage('Mail: ' .. ERROR_CAPS, 1, 0, 0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -733,7 +733,7 @@ do
|
|||||||
SendMailNameEditBox:SetText(matches[index])
|
SendMailNameEditBox:SetText(matches[index])
|
||||||
SendMailNameEditBox:HighlightText(inputLength, -1)
|
SendMailNameEditBox:HighlightText(inputLength, -1)
|
||||||
for i = 1, MAIL_AUTOCOMPLETE_MAX_BUTTONS do
|
for i = 1, MAIL_AUTOCOMPLETE_MAX_BUTTONS do
|
||||||
local button = _G['mailAutoCompleteButton' .. i]
|
local button = _G['MailAutoCompleteButton' .. i]
|
||||||
if i == index then
|
if i == index then
|
||||||
button:LockHighlight()
|
button:LockHighlight()
|
||||||
else
|
else
|
||||||
@@ -759,7 +759,7 @@ do
|
|||||||
function SelectMatch(i)
|
function SelectMatch(i)
|
||||||
index = i
|
index = i
|
||||||
complete()
|
complete()
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
SendMailNameEditBox:HighlightText(0, 0)
|
SendMailNameEditBox:HighlightText(0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -779,7 +779,7 @@ do
|
|||||||
ignore[name] = true
|
ignore[name] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for character in mail_AutoCompleteNames[GetCVar'realmName' .. '|' .. UnitFactionGroup'player'] do
|
for character in Mail_AutoCompleteNames[GetCVar'realmName' .. '|' .. UnitFactionGroup'player'] do
|
||||||
process(character)
|
process(character)
|
||||||
end
|
end
|
||||||
for i = 1, GetNumFriends() do
|
for i = 1, GetNumFriends() do
|
||||||
@@ -792,7 +792,7 @@ do
|
|||||||
table.setn(matches, min(getn(matches), MAIL_AUTOCOMPLETE_MAX_BUTTONS))
|
table.setn(matches, min(getn(matches), MAIL_AUTOCOMPLETE_MAX_BUTTONS))
|
||||||
if getn(matches) > 0 and (getn(matches) > 1 or input ~= matches[1]) then
|
if getn(matches) > 0 and (getn(matches) > 1 or input ~= matches[1]) then
|
||||||
for i = 1, MAIL_AUTOCOMPLETE_MAX_BUTTONS do
|
for i = 1, MAIL_AUTOCOMPLETE_MAX_BUTTONS do
|
||||||
local button = _G['mailAutoCompleteButton' .. i]
|
local button = _G['MailAutoCompleteButton' .. i]
|
||||||
if i <= getn(matches) then
|
if i <= getn(matches) then
|
||||||
button:SetText(matches[i])
|
button:SetText(matches[i])
|
||||||
button:GetFontString():SetPoint('LEFT', button, 'LEFT', 15, 0)
|
button:GetFontString():SetPoint('LEFT', button, 'LEFT', 15, 0)
|
||||||
@@ -801,13 +801,13 @@ do
|
|||||||
button:Hide()
|
button:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
mailAutoCompleteBox:SetHeight(getn(matches) * mailAutoCompleteButton1:GetHeight() + 35)
|
MailAutoCompleteBox:SetHeight(getn(matches) * MailAutoCompleteButton1:GetHeight() + 35)
|
||||||
mailAutoCompleteBox:SetWidth(120)
|
MailAutoCompleteBox:SetWidth(120)
|
||||||
mailAutoCompleteBox:Show()
|
MailAutoCompleteBox:Show()
|
||||||
index = 1
|
index = 1
|
||||||
complete()
|
complete()
|
||||||
else
|
else
|
||||||
mailAutoCompleteBox:Hide()
|
MailAutoCompleteBox:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
## Interface: 11200
|
||||||
|
## Title: Mail
|
||||||
|
## Notes: Mailbox enhancement
|
||||||
|
## Author: shirsig
|
||||||
|
## SavedVariablesPerCharacter: Mail_To
|
||||||
|
## SavedVariables: Mail_AutoCompleteNames
|
||||||
|
Mail.xml
|
||||||
+43
-43
@@ -1,17 +1,17 @@
|
|||||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||||
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
||||||
<Script file="mail.lua"/>
|
<Script file="Mail.lua"/>
|
||||||
|
|
||||||
<Button name="mailAutoCompleteButtonTemplate" virtual="true">
|
<Button name="MailAutoCompleteButtonTemplate" virtual="true">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="120" y="14"/>
|
<AbsDimension x="120" y="14"/>
|
||||||
</Size>
|
</Size>
|
||||||
<Scripts>
|
<Scripts>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
mail.SelectMatch(this:GetID())
|
Mail.SelectMatch(this:GetID())
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnTabPressed>
|
<OnTabPressed>
|
||||||
mail.NextMatch()
|
Mail.NextMatch()
|
||||||
</OnTabPressed>
|
</OnTabPressed>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
<NormalFont inherits="GameFontNormal"/>
|
<NormalFont inherits="GameFontNormal"/>
|
||||||
@@ -19,7 +19,7 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
<DisabledFont inherits="GameFontDisable"/>
|
<DisabledFont inherits="GameFontDisable"/>
|
||||||
<HighlightTexture inherits="UIPanelButtonHighlightTexture"/>
|
<HighlightTexture inherits="UIPanelButtonHighlightTexture"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Frame name="mailAutoCompleteBox" parent="SendMailNameEditBox" frameStrata="DIALOG" hidden="true">
|
<Frame name="MailAutoCompleteBox" parent="SendMailNameEditBox" frameStrata="DIALOG" hidden="true">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="5" y="5"/>
|
<AbsDimension x="5" y="5"/>
|
||||||
</Size>
|
</Size>
|
||||||
@@ -39,7 +39,7 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
</Backdrop>
|
</Backdrop>
|
||||||
<Layers>
|
<Layers>
|
||||||
<Layer level="ARTWORK">
|
<Layer level="ARTWORK">
|
||||||
<FontString name="mailAutoCompleteInstructions" inherits="GameFontDisableSmall">
|
<FontString name="MailAutoCompleteInstructions" inherits="GameFontDisableSmall">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="BOTTOMLEFT">
|
<Anchor point="BOTTOMLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
@@ -51,34 +51,34 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
</Layer>
|
</Layer>
|
||||||
</Layers>
|
</Layers>
|
||||||
<Frames>
|
<Frames>
|
||||||
<Button name="mailAutoCompleteButton1" inherits="mailAutoCompleteButtonTemplate" id="1">
|
<Button name="MailAutoCompleteButton1" inherits="MailAutoCompleteButtonTemplate" id="1">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT">
|
<Anchor point="TOPLEFT">
|
||||||
<Offset>
|
<Offset>
|
||||||
<!--This 10 is a magic number used in mailAutoComplete_Update when checking whether the mailAutoComplete box should be above or below the EditBox. Please update the number there if you change it here-->
|
<!--This 10 is a magic number used in MailAutoComplete_Update when checking whether the MailAutoComplete box should be above or below the EditBox. Please update the number there if you change it here-->
|
||||||
<AbsDimension x="0" y="-10"/>
|
<AbsDimension x="0" y="-10"/>
|
||||||
</Offset>
|
</Offset>
|
||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="mailAutoCompleteButton2" inherits="mailAutoCompleteButtonTemplate" id="2">
|
<Button name="MailAutoCompleteButton2" inherits="MailAutoCompleteButtonTemplate" id="2">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="mailAutoCompleteButton1" relativePoint="BOTTOMLEFT"/>
|
<Anchor point="TOPLEFT" relativeTo="MailAutoCompleteButton1" relativePoint="BOTTOMLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="mailAutoCompleteButton3" inherits="mailAutoCompleteButtonTemplate" id="3">
|
<Button name="MailAutoCompleteButton3" inherits="MailAutoCompleteButtonTemplate" id="3">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="mailAutoCompleteButton2" relativePoint="BOTTOMLEFT"/>
|
<Anchor point="TOPLEFT" relativeTo="MailAutoCompleteButton2" relativePoint="BOTTOMLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="mailAutoCompleteButton4" inherits="mailAutoCompleteButtonTemplate" id="4">
|
<Button name="MailAutoCompleteButton4" inherits="MailAutoCompleteButtonTemplate" id="4">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="mailAutoCompleteButton3" relativePoint="BOTTOMLEFT"/>
|
<Anchor point="TOPLEFT" relativeTo="MailAutoCompleteButton3" relativePoint="BOTTOMLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Button>
|
</Button>
|
||||||
<Button name="mailAutoCompleteButton5" inherits="mailAutoCompleteButtonTemplate" id="5">
|
<Button name="MailAutoCompleteButton5" inherits="MailAutoCompleteButtonTemplate" id="5">
|
||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="mailAutoCompleteButton4" relativePoint="BOTTOMLEFT"/>
|
<Anchor point="TOPLEFT" relativeTo="MailAutoCompleteButton4" relativePoint="BOTTOMLEFT"/>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
</Button>
|
</Button>
|
||||||
</Frames>
|
</Frames>
|
||||||
@@ -87,13 +87,13 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
MAIL_AUTOCOMPLETE_MAX_BUTTONS = 5
|
MAIL_AUTOCOMPLETE_MAX_BUTTONS = 5
|
||||||
this:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b)
|
this:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b)
|
||||||
this:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b)
|
this:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b)
|
||||||
this.maxHeight = MAIL_AUTOCOMPLETE_MAX_BUTTONS * mailAutoCompleteButton1:GetHeight()
|
this.maxHeight = MAIL_AUTOCOMPLETE_MAX_BUTTONS * MailAutoCompleteButton1:GetHeight()
|
||||||
mailAutoCompleteInstructions:SetText("|cffbbbbbbPress Tab|r")
|
MailAutoCompleteInstructions:SetText("|cffbbbbbbPress Tab|r")
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<Button name="mailAttachment" virtual="true">
|
<Button name="MailAttachment" virtual="true">
|
||||||
<Size>
|
<Size>
|
||||||
<AbsDimension x="37" y="37"/>
|
<AbsDimension x="37" y="37"/>
|
||||||
</Size>
|
</Size>
|
||||||
@@ -141,13 +141,13 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
this:RegisterForDrag('LeftButton')
|
this:RegisterForDrag('LeftButton')
|
||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnReceiveDrag>
|
<OnReceiveDrag>
|
||||||
mail.AttachmentButton_OnClick()
|
Mail.AttachmentButton_OnClick()
|
||||||
</OnReceiveDrag>
|
</OnReceiveDrag>
|
||||||
<OnDragStart>
|
<OnDragStart>
|
||||||
mail.AttachmentButton_OnClick()
|
Mail.AttachmentButton_OnClick()
|
||||||
</OnDragStart>
|
</OnDragStart>
|
||||||
<OnClick>
|
<OnClick>
|
||||||
mail.AttachmentButton_OnClick()
|
Mail.AttachmentButton_OnClick()
|
||||||
this:GetScript'OnEnter'()
|
this:GetScript'OnEnter'()
|
||||||
</OnClick>
|
</OnClick>
|
||||||
<OnEnter>
|
<OnEnter>
|
||||||
@@ -165,25 +165,25 @@ C:\Projects\WoW\Bin\Interface\FrameXML\UI.xsd">
|
|||||||
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
|
<HighlightTexture alphaMode="ADD" file="Interface\Buttons\ButtonHilight-Square"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button name="mailAttachment1" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment1" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment2" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment2" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment3" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment3" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment4" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment4" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment5" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment5" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment6" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment6" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment7" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment7" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment8" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment8" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment9" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment9" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment10" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment10" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment11" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment11" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment12" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment12" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment13" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment13" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment14" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment14" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment15" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment15" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment16" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment16" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment17" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment17" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment18" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment18" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment19" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment19" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment20" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment20" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
<Button name="mailAttachment21" parent="SendMailFrame" inherits="mailAttachment"/>
|
<Button name="MailAttachment21" parent="SendMailFrame" inherits="MailAttachment"/>
|
||||||
</Ui>
|
</Ui>
|
||||||
Reference in New Issue
Block a user