From 38bcc1e4754c64c9e0d8759e2b9637805dd0d51c Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 3 Jul 2024 16:52:50 +0000 Subject: [PATCH] Restored logic of up/down key in town interface --- client/windows/CCastleInterface.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/windows/CCastleInterface.cpp b/client/windows/CCastleInterface.cpp index f4bda6475..077269bc8 100644 --- a/client/windows/CCastleInterface.cpp +++ b/client/windows/CCastleInterface.cpp @@ -1263,8 +1263,8 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst resdatabar = std::make_shared(ImagePath::builtin("ARESBAR"), 3, 575, 37, 3, 84, 78); townlist = std::make_shared(3, Rect(Point(743, 414), Point(48, 128)), Point(1,16), Point(0, 32), LOCPLINT->localState->getOwnedTowns().size() ); - townlist->setScrollUpButton( std::make_shared( Point(744, 414), AnimationPath::builtin("IAM014"), CButton::tooltipLocalized("core.help.306"), 0, EShortcut::MOVE_UP)); - townlist->setScrollDownButton( std::make_shared( Point(744, 526), AnimationPath::builtin("IAM015"), CButton::tooltipLocalized("core.help.307"), 0, EShortcut::MOVE_DOWN)); + townlist->setScrollUpButton( std::make_shared( Point(744, 414), AnimationPath::builtin("IAM014"), CButton::tooltipLocalized("core.help.306"), 0)); + townlist->setScrollDownButton( std::make_shared( Point(744, 526), AnimationPath::builtin("IAM015"), CButton::tooltipLocalized("core.help.307"), 0)); if(from) townlist->select(from); @@ -1399,6 +1399,12 @@ void CCastleInterface::keyPressed(EShortcut key) { switch(key) { + case EShortcut::MOVE_UP: + townlist->selectPrev(); + break; + case EShortcut::MOVE_DOWN: + townlist->selectNext(); + break; case EShortcut::TOWN_OPEN_FORT: GH.windows().createAndPushWindow(town); break;