mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
display window on screen center
This commit is contained in:
@@ -19,7 +19,7 @@ function UIPopupMenu.display(menu, pos)
|
||||
end
|
||||
|
||||
function UIPopupMenu.addOption(menu, optionName, optionCallback)
|
||||
local optionWidget = createWidget(menu.buttonStyle, menu)
|
||||
local optionWidget = createWidget(menu:getStyleName() .. 'Button', menu)
|
||||
local lastOptionWidget = menu:getLastChild()
|
||||
optionWidget.onClick = function()
|
||||
optionCallback()
|
||||
@@ -29,7 +29,7 @@ function UIPopupMenu.addOption(menu, optionName, optionCallback)
|
||||
end
|
||||
|
||||
function UIPopupMenu.addSeparator(menu)
|
||||
local separatorWidget = createWidget(menu.separatorStyle, separator)
|
||||
local separatorWidget = createWidget(menu:getStyleName() .. 'Separator', separator)
|
||||
end
|
||||
|
||||
-- hooked events
|
||||
@@ -49,12 +49,3 @@ function UIPopupMenu.onKeyPress(menu, keyCode, keyText, keyboardModifiers)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function UIPopupMenu.onStyleApply(menu, style)
|
||||
if style['button-style'] then
|
||||
menu.buttonStyle = style['button-style']
|
||||
end
|
||||
if style['separator-style'] then
|
||||
menu.separatorStyle = style['separator-style']
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user