From 45b14060f66a1cdd1762d86ab4d161928dc8702e Mon Sep 17 00:00:00 2001 From: Zbizu Date: Sat, 14 Dec 2019 04:11:44 +0100 Subject: [PATCH] allow using up/down arrows in modalWindow QoL change, that's how it works in the official client --- modules/game_modaldialog/modaldialog.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/game_modaldialog/modaldialog.lua b/modules/game_modaldialog/modaldialog.lua index b23a8641..c15c174c 100644 --- a/modules/game_modaldialog/modaldialog.lua +++ b/modules/game_modaldialog/modaldialog.lua @@ -55,6 +55,9 @@ function onModalDialog(id, title, message, buttons, enterButton, escapeButton, c end choiceList:focusChild(choiceList:getFirstChild()) + g_keyboard.bindKeyPress('Down', function() choiceList:focusNextChild(KeyboardFocusReason) end, modalDialog) + g_keyboard.bindKeyPress('Up', function() choiceList:focusPreviousChild(KeyboardFocusReason) end, modalDialog) + local buttonsWidth = 0 for i = 1, #buttons do local buttonId = buttons[i][1]