mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
walk and key event system rework with some regressions
This commit is contained in:
@@ -5,7 +5,7 @@ local displayedMenuList = {}
|
||||
function UIPopupMenu.create()
|
||||
local menu = UIPopupMenu.internalCreate()
|
||||
local layout = UIVerticalLayout.create(menu)
|
||||
layout:setFitParent(true)
|
||||
layout:setFitChildren(true)
|
||||
menu:setLayout(layout)
|
||||
return menu
|
||||
end
|
||||
@@ -53,7 +53,8 @@ function UIPopupMenu:onMousePress(mousePos, mouseButton)
|
||||
return false
|
||||
end
|
||||
|
||||
function UIPopupMenu:onKeyPress(keyCode, keyText, keyboardModifiers)
|
||||
function UIPopupMenu:onKeyPress(keyCode, keyboardModifiers, wouldFilter)
|
||||
if wouldFilter then return end
|
||||
if keyCode == KeyEscape then
|
||||
self:destroy()
|
||||
return true
|
||||
|
@@ -6,7 +6,8 @@ function UIWindow.create()
|
||||
return window
|
||||
end
|
||||
|
||||
function UIWindow:onKeyPress(keyCode, keyText, keyboardModifiers)
|
||||
function UIWindow:onKeyPress(keyCode, keyboardModifiers, wouldFilter)
|
||||
if wouldFilter then return end
|
||||
if keyboardModifiers == KeyboardNoModifier then
|
||||
if keyCode == KeyReturn or keyCode == KeyEnter then
|
||||
signalcall(self.onEnter, self)
|
||||
|
Reference in New Issue
Block a user