From cf0bff67031285748a3041cb9bc729719a6da5c5 Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 22 Feb 2016 09:38:03 +0100 Subject: [PATCH] refactorings --- Postal.lua | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/Postal.lua b/Postal.lua index 9971742..f20579e 100644 --- a/Postal.lua +++ b/Postal.lua @@ -163,7 +163,6 @@ function Postal:OnEnable() self:Hook('SendMailFrame_CanSend') self:Hook('ContainerFrame_Update') self:Hook('InboxFrame_OnClick') - self:Hook('ClickSendMailItemButton') self:HookScript(TradeFrame, 'OnShow', 'TF_Show') self:Hook('InboxFrameItem_OnEnter') self:Hook('InboxFrame_Update') @@ -330,14 +329,6 @@ function Postal:UseContainerItem(bag, slot) self.hooks["UseContainerItem"].orig(bag, slot) end -function Postal:ClickSendMailItemButton() - if not GetSendMailItem() then - PostalFrame.mailbag = PostalFrame.bag - PostalFrame.mailitem = PostalFrame.slot - end - self.hooks["ClickSendMailItemButton"].orig() -end - -- Handle the dragging of items function Postal:AttachmentButton_OnClick(button) if not button then button = this end @@ -462,20 +453,10 @@ function Postal:SendMail() end if item then - if GetSendMailItem() and PostalFrame.mailbag and PostalFrame.mailitem then - -- There's already an item in the slot - ClickSendMailItemButton() - self.hooks["PickupContainerItem"].orig(PostalFrame.mailbag, PostalFrame.mailitem) - PostalFrame.mailbag = nil - PostalFrame.mailitem = nil - elseif CursorHasItem() and PostalFrame.bag and PostalFrame.slot then - ClearCursor() - PostalFrame.bag = nil - PostalFrame.slot = nil - end - + ClearCursor() + ClickSendMailItemButton() + ClearCursor() self.hooks["PickupContainerItem"].orig(item.bag, item.slot) - ClickSendMailItemButton() local name, _, count = GetSendMailItem()