1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #2324 from mikeiit/develop

Fixed selection update in saving screen
This commit is contained in:
Ivan Savenko
2023-07-13 12:57:06 +03:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -36,10 +36,10 @@ CSavingScreen::CSavingScreen()
localMi->mapHeader = std::unique_ptr<CMapHeader>(new CMapHeader(*LOCPLINT->cb->getMapHeader()));
tabSel = std::make_shared<SelectionTab>(screenType);
curTab = tabSel;
tabSel->toggleMode();
tabSel->callOnSelect = std::bind(&CSavingScreen::changeSelection, this, _1);
tabSel->toggleMode();
curTab = tabSel;
buttonStart = std::make_shared<CButton>(Point(411, 535), "SCNRSAV.DEF", CGI->generaltexth->zelp[103], std::bind(&CSavingScreen::saveGame, this), EShortcut::LOBBY_SAVE_GAME);
}
@@ -62,6 +62,7 @@ void CSavingScreen::changeSelection(std::shared_ptr<CMapInfo> to)
localMi = to;
card->changeSelection();
card->redraw();
}
void CSavingScreen::saveGame()

View File

@@ -419,7 +419,9 @@ void SelectionTab::select(int position)
auto filename = *CResourceHandler::get("local")->getResourceName(ResourceID(curItems[py]->fileURI, EResType::CLIENT_SAVEGAME));
inputName->setText(filename.stem().string());
}
updateListItems();
redraw();
if(callOnSelect)
callOnSelect(curItems[py]);
}