mirror of
https://github.com/edubart/otclient.git
synced 2025-05-02 10:39:21 +02:00
focus first choice in modalWindow by default (QoL)
selecting first modalwindow choice by default like in cip client
This commit is contained in:
parent
49e3ded63c
commit
451075516d
@ -78,7 +78,8 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
|
||||
if #choices > 0 then
|
||||
choiceList:setVisible(true)
|
||||
choiceScrollbar:setVisible(true)
|
||||
|
||||
choiceList:focusChild(choiceList:getFirstChild())
|
||||
|
||||
additionalHeight = math.min(modalDialog.maximumChoices, math.max(modalDialog.minimumChoices, #choices)) * labelHeight
|
||||
additionalHeight = additionalHeight + choiceList:getPaddingTop() + choiceList:getPaddingBottom()
|
||||
end
|
||||
@ -114,4 +115,4 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c
|
||||
|
||||
modalDialog.onEnter = enterFunc
|
||||
modalDialog.onEscape = escapeFunc
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user