mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 19:44:54 +02:00
Fixed/Changed Minimap and Game Interface Window Issue.
* Changed minimap navigation to hold right click. * Added MAX_FLOOR_UP and MAX_FLOOR_DOWN for floor changing in the minimap. * Fixed issues with exit window, logout window and count window to stop multiple instances of the window.
This commit is contained in:
@@ -32,14 +32,18 @@ function g_mouse.isPressed(button)
|
||||
return g_window.isMouseButtonPressed(button)
|
||||
end
|
||||
|
||||
function g_mouse.bindAutoPress(widget, callback, delay)
|
||||
function g_mouse.bindAutoPress(widget, callback, delay, button)
|
||||
local button = button or MouseLeftButton
|
||||
connect(widget, { onMousePress = function(widget, mousePos, mouseButton)
|
||||
if(mouseButton ~= button) then
|
||||
return false
|
||||
end
|
||||
local startTime = g_clock.millis()
|
||||
callback(widget, mousePos, mouseButton, 0)
|
||||
periodicalEvent(function()
|
||||
callback(widget, g_window.getMousePosition(), mouseButton, g_clock.millis() - startTime)
|
||||
end, function()
|
||||
return widget:isPressed()
|
||||
return g_mouse.isPressed(mouseButton)
|
||||
end, 30, delay)
|
||||
return true
|
||||
end })
|
||||
|
Reference in New Issue
Block a user