1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Restored logic of up/down key in town interface

This commit is contained in:
Ivan Savenko 2024-07-03 16:52:50 +00:00
parent 2584432b92
commit 38bcc1e475

View File

@ -1263,8 +1263,8 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
resdatabar = std::make_shared<CResDataBar>(ImagePath::builtin("ARESBAR"), 3, 575, 37, 3, 84, 78);
townlist = std::make_shared<CTownList>(3, Rect(Point(743, 414), Point(48, 128)), Point(1,16), Point(0, 32), LOCPLINT->localState->getOwnedTowns().size() );
townlist->setScrollUpButton( std::make_shared<CButton>( Point(744, 414), AnimationPath::builtin("IAM014"), CButton::tooltipLocalized("core.help.306"), 0, EShortcut::MOVE_UP));
townlist->setScrollDownButton( std::make_shared<CButton>( Point(744, 526), AnimationPath::builtin("IAM015"), CButton::tooltipLocalized("core.help.307"), 0, EShortcut::MOVE_DOWN));
townlist->setScrollUpButton( std::make_shared<CButton>( Point(744, 414), AnimationPath::builtin("IAM014"), CButton::tooltipLocalized("core.help.306"), 0));
townlist->setScrollDownButton( std::make_shared<CButton>( 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<CFortScreen>(town);
break;