mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 2.6 - http://otclient.net/showthread.php?tid=552
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
local gameStart = 0
|
||||
|
||||
function init()
|
||||
connect(Container, { onOpen = onContainerOpen,
|
||||
onClose = onContainerClose,
|
||||
onSizeChange = onContainerChangeSize,
|
||||
onUpdateItem = onContainerUpdateItem })
|
||||
connect(Game, { onGameEnd = clean() })
|
||||
connect(g_game, {
|
||||
onGameStart = markStart,
|
||||
onGameEnd = clean
|
||||
})
|
||||
|
||||
reloadContainers()
|
||||
end
|
||||
@@ -13,7 +18,10 @@ function terminate()
|
||||
onClose = onContainerClose,
|
||||
onSizeChange = onContainerChangeSize,
|
||||
onUpdateItem = onContainerUpdateItem })
|
||||
disconnect(Game, { onGameEnd = clean() })
|
||||
disconnect(g_game, {
|
||||
onGameStart = markStart,
|
||||
onGameEnd = clean
|
||||
})
|
||||
end
|
||||
|
||||
function reloadContainers()
|
||||
@@ -29,6 +37,10 @@ function clean()
|
||||
end
|
||||
end
|
||||
|
||||
function markStart()
|
||||
gameStart = g_clock.millis()
|
||||
end
|
||||
|
||||
function destroy(container)
|
||||
if container.window then
|
||||
container.window:destroy()
|
||||
@@ -93,7 +105,12 @@ function onContainerOpen(container, previousContainer)
|
||||
else
|
||||
containerWindow = g_ui.createWidget('ContainerWindow', modules.game_interface.getContainerPanel())
|
||||
end
|
||||
containerWindow:setId('container' .. container:getId())
|
||||
|
||||
containerWindow:setId('container' .. container:getId() .. '_' .. container:getName())
|
||||
if gameStart + 1000 < g_clock.millis() then
|
||||
containerWindow:clearSettings()
|
||||
end
|
||||
|
||||
local containerPanel = containerWindow:getChildById('contentsPanel')
|
||||
local containerItemWidget = containerWindow:getChildById('containerItemWidget')
|
||||
containerWindow.onClose = function()
|
||||
|
Reference in New Issue
Block a user