1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

Correctly update hero list on reordering via radial menu

This commit is contained in:
Ivan Savenko 2023-12-23 18:13:55 +02:00
parent 50536e28da
commit a08546e964
3 changed files with 10 additions and 0 deletions

View File

@ -239,6 +239,8 @@ void PlayerLocalState::swapWanderingHero(int pos1, int pos2)
{
assert(wanderingHeroes[pos1] && wanderingHeroes[pos2]);
std::swap(wanderingHeroes[pos1], wanderingHeroes[pos2]);
adventureInt->onHeroOrderChanged();
}
const std::vector<const CGTownInstance *> & PlayerLocalState::getOwnedTowns()

View File

@ -331,6 +331,11 @@ void AdventureMapInterface::onTownOrderChanged()
widget->getTownList()->updateWidget();
}
void AdventureMapInterface::onHeroOrderChanged()
{
widget->getHeroList()->updateWidget();
}
void AdventureMapInterface::onMapTilesChanged(boost::optional<std::unordered_set<int3>> positions)
{
if (positions)

View File

@ -149,6 +149,9 @@ public:
/// Called when town order changes
void onTownOrderChanged();
/// Called when hero order changes
void onHeroOrderChanged();
/// Called when map audio should be paused, e.g. on combat or town screen access
void onAudioPaused();