/
SI.Cursor:EnableMouseWheel(0) |
SI.Cursor.text:SetText("") |
SI.Cursor:SetScript('OnMouseWheel',function(self,arg1) |
local i = tonumber(self.text:GetText()) or 1 |
local c = i+arg1 |
local i = tonumber(self.text:GetText()) |
local c |
if not i then |
c=arg1%SI.count |
else |
c = i+arg1 |
end |
--if c<0 then it would drop automaticly |
if c<=1 then |
if c==1 then |
ClearCursor() |
if handling=='ITEM_LOCK_CHANGED' then |
SplitContainerItem(SI.bagID,SI.bagSlot,c) |
elseif handling=='GUILDBANK_ITEM_LOCK_CHANGED' then |
SplitGuildBankItem(SI.bagID,SI.bagSlot,c) |
end |
if c==1 then |
ClearCursor() |
if handling=='ITEM_LOCK_CHANGED' then |
SplitContainerItem(SI.bagID,SI.bagSlot,c) |
elseif handling=='GUILDBANK_ITEM_LOCK_CHANGED' then |
SplitGuildBankItem(SI.bagID,SI.bagSlot,c) |
end |
self.text:SetText(1) |
elseif c>=SI.count or c==0 then |
ClearCursor() |
SplitContainerItem(SI.bagID,SI.bagSlot,SI.count) |
self.text:SetText("") |
elseif c>SI.count then |
self.text:SetText(SI.count) |
else |
ClearCursor() |
if handling=='ITEM_LOCK_CHANGED' then |
--Get Count (initial Count) |
_,SI.count,lock = GetContainerItemInfo(...) |
--Item is splitable and got picked up |
if SI.count > 1 and lock then |
if SI.count > 1 and lock and CursorHasItem() then |
--print('EnableMouseWheel') |
SI.Cursor.text:SetPoint('BOTTOMLEFT',SI.Cursor,'BOTTOMLEFT',GetScaledCursorPosition(0,0) ) |
SI.Cursor:EnableMouseWheel(1) |
SI.bagID,SI.bagSlot = ... |
SI.Cursor.text:SetText(SI.count) |
SI.Cursor.text:SetText("") |
--Item isn't splitable and got dropped |
else |
SI.Cursor.text:SetText("") |
if tab and slot then |
_,SI.count,lock = GetGuildBankItemInfo(tab,slot) |
--Item is splitable and got picked up |
if SI.count > 1 and lock then |
if SI.count > 1 and lock and CursorHasItem() then |
--print('EnableMouseWheel') |
SI.Cursor.text:SetPoint('BOTTOMLEFT',SI.Cursor,'BOTTOMLEFT',GetScaledCursorPosition(0,0) ) |
SI.Cursor:EnableMouseWheel(1) |
SI.bagID,SI.bagSlot = tab,slot |
SI.Cursor.text:SetText(SI.count) |
SI.Cursor.text:SetText("") |
--Item isn't splitable and got dropped |
else |
SI.Cursor.text:SetText("") |