SI.Cursor:EnableMouseWheel(0) |
SI.Cursor.text:SetText("") |
SI.Cursor:SetScript('OnMouseWheel',function(self,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 |
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) |
local i = tonumber(self.text:GetText()) or 0 |
local c |
if handling=='merchant' then |
if not i then |
c=arg1%SI.count |
else |
--c=i+arg1 |
c = i+(arg1*SI.minStack) |
if c<0 then |
c=SI.count |
elseif c>SI.count then |
c=0 |
end |
end |
self.text:SetText(c) |
else |
if not i then |
c=arg1%SI.count |
else |
c=(i+arg1)%SI.count |
end |
--if c<0 then it would drop automaticly |
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("") |
else |
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(c) |
end |
end |
self.text:SetText(1) |
elseif c>=SI.count or c==0 then |
ClearCursor() |
SplitContainerItem(SI.bagID,SI.bagSlot,SI.count) |
self.text:SetText("") |
else |
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(c) |
end |
end) |
|
local events = { } |