Updated to OTCv8 3.1 rev 217

This commit is contained in:
OTCv8
2022-05-23 21:59:13 +00:00
parent a160f49cc8
commit c70abbdfdd
10 changed files with 76 additions and 3 deletions

View File

@@ -94,6 +94,18 @@ function refreshContainerPages(container)
nextPageButton:setEnabled(true)
nextPageButton.onClick = function() g_game.seekInContainer(container:getId(), container:getFirstIndex() + container:getCapacity()) end
end
local pagePanel = container.window:recursiveGetChildById('pagePanel')
if pagePanel then
pagePanel.onMouseWheel = function(widget, mousePos, mouseWheel)
if pages == 1 then return end
if mouseWheel == MouseWheelUp then
return prevPageButton.onClick()
else
return nextPageButton.onClick()
end
end
end
end
function onContainerOpen(container, previousContainer)
@@ -126,6 +138,20 @@ function onContainerOpen(container, previousContainer)
child:onDrop(widget, mousePos, true)
end
end
containerWindow.onMouseRelease = function(widget, mousePos, mouseButton)
if mouseButton == MouseButton4 then
if container:hasParent() then
return g_game.openParent(container)
end
elseif mouseButton == MouseButton5 then
for i, item in ipairs(container:getItems()) do
if item:isContainer() then
return g_game.open(item, container)
end
end
end
end
-- this disables scrollbar auto hiding
local scrollbar = containerWindow:getChildById('miniwindowScrollBar')