mirror of https://github.com/OpenTTD/OpenTTD
Fix #7899, 196d5868: don't trigger filter changes more than expected
parent
ac3bc30a30
commit
39e6247bec
|
@ -162,6 +162,7 @@ enum TownRatingCheckType {
|
||||||
enum TownDirectoryInvalidateWindowData {
|
enum TownDirectoryInvalidateWindowData {
|
||||||
TDIWD_FORCE_REBUILD,
|
TDIWD_FORCE_REBUILD,
|
||||||
TDIWD_FILTER_CHANGES, ///< The filename filter has changed (via the editbox)
|
TDIWD_FILTER_CHANGES, ///< The filename filter has changed (via the editbox)
|
||||||
|
TDIWD_FORCE_RESORT,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -153,7 +153,7 @@ Town::~Town()
|
||||||
*/
|
*/
|
||||||
void Town::PostDestructor(size_t index)
|
void Town::PostDestructor(size_t index)
|
||||||
{
|
{
|
||||||
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 0);
|
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, TDIWD_FORCE_REBUILD);
|
||||||
UpdateNearestTownForRoadTiles(false);
|
UpdateNearestTownForRoadTiles(false);
|
||||||
|
|
||||||
/* Give objects a new home! */
|
/* Give objects a new home! */
|
||||||
|
@ -423,7 +423,7 @@ static void ChangePopulation(Town *t, int mod)
|
||||||
InvalidateWindowData(WC_TOWN_VIEW, t->index); // Cargo requirements may appear/vanish for small populations
|
InvalidateWindowData(WC_TOWN_VIEW, t->index); // Cargo requirements may appear/vanish for small populations
|
||||||
if (_settings_client.gui.population_in_label) t->UpdateVirtCoord();
|
if (_settings_client.gui.population_in_label) t->UpdateVirtCoord();
|
||||||
|
|
||||||
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 1);
|
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, TDIWD_FORCE_RESORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1777,7 +1777,7 @@ static void DoCreateTown(Town *t, TileIndex tile, uint32 townnameparts, TownSize
|
||||||
t->townnameparts = townnameparts;
|
t->townnameparts = townnameparts;
|
||||||
|
|
||||||
t->UpdateVirtCoord();
|
t->UpdateVirtCoord();
|
||||||
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 0);
|
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, TDIWD_FORCE_REBUILD);
|
||||||
|
|
||||||
t->InitializeLayout(layout);
|
t->InitializeLayout(layout);
|
||||||
|
|
||||||
|
@ -2685,7 +2685,7 @@ CommandCost CmdRenameTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||||
t->name = reset ? nullptr : stredup(text);
|
t->name = reset ? nullptr : stredup(text);
|
||||||
|
|
||||||
t->UpdateVirtCoord();
|
t->UpdateVirtCoord();
|
||||||
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 1);
|
InvalidateWindowData(WC_TOWN_DIRECTORY, 0, TDIWD_FORCE_RESORT);
|
||||||
UpdateAllStationVirtCoords();
|
UpdateAllStationVirtCoords();
|
||||||
}
|
}
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
|
|
Loading…
Reference in New Issue