mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
move UIWindow to lua
This commit is contained in:
17
modules/core_widgets/uiwindow.lua
Normal file
17
modules/core_widgets/uiwindow.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
UIWindow = extends(UIWidget)
|
||||
|
||||
function UIWindow.create()
|
||||
local window = UIWindow.internalCreate()
|
||||
window:setTextAlign(AlignTopCenter)
|
||||
return window
|
||||
end
|
||||
|
||||
function UIWindow:onKeyPress(keyCode, keyText, keyboardModifiers)
|
||||
if keyboardModifiers == KeyboardNoModifier then
|
||||
if keyCode == KeyReturn or keyCode == KeyEnter then
|
||||
signalcall(self.onEnter, self)
|
||||
elseif keyCode == KeyEscape then
|
||||
signalcall(self.onEscape, self)
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user