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

Merge pull request #4221 from IvanSavenko/bugfixing

[1.5.4] Bugfixing
This commit is contained in:
Ivan Savenko 2024-07-05 15:34:15 +03:00 committed by GitHub
commit 4695c88705
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 20 additions and 9 deletions

View File

@ -26,7 +26,7 @@ android {
minSdk = qtMinSdkVersion as Integer
targetSdk = qtTargetSdkVersion as Integer // ANDROID_TARGET_SDK_VERSION in the CMake project
versionCode 1533
versionCode 1535
versionName "1.5.3"
setProperty("archivesBaseName", "vcmi")

View File

@ -1225,13 +1225,14 @@ void CPlayerInterface::loadGame( BinaryDeserializer & h )
void CPlayerInterface::moveHero( const CGHeroInstance *h, const CGPath& path )
{
LOG_TRACE(logGlobal);
if (!LOCPLINT->makingTurn)
return;
assert(h);
assert(!showingDialog->isBusy());
assert(dialogs.empty());
LOG_TRACE(logGlobal);
if (!LOCPLINT->makingTurn)
return;
if (!h)
return; //can't find hero

View File

@ -168,7 +168,7 @@ void PlayerLocalState::setSelection(const CArmedInstance * selection)
currentSelection = selection;
if (selection)
if (adventureInt && selection)
adventureInt->onSelectionChanged(selection);
}
@ -212,6 +212,9 @@ void PlayerLocalState::addWanderingHero(const CGHeroInstance * hero)
assert(hero);
assert(!vstd::contains(wanderingHeroes, hero));
wanderingHeroes.push_back(hero);
if (currentSelection == nullptr)
setSelection(hero);
}
void PlayerLocalState::removeWanderingHero(const CGHeroInstance * hero)
@ -260,6 +263,9 @@ void PlayerLocalState::addOwnedTown(const CGTownInstance * town)
assert(town);
assert(!vstd::contains(ownedTowns, town));
ownedTowns.push_back(town);
if (currentSelection == nullptr)
setSelection(town);
}
void PlayerLocalState::removeOwnedTown(const CGTownInstance * town)

View File

@ -395,8 +395,6 @@ void AdventureMapInterface::adjustActiveness()
void AdventureMapInterface::onCurrentPlayerChanged(PlayerColor playerID)
{
LOCPLINT->localState->setSelection(nullptr);
if (playerID == currentPlayerID)
return;

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;