mirror of https://github.com/OpenTTD/OpenTTD
(svn r18486) -Fix: when switching language and you're getting a different font, recalculate the coordinates/sizes of the viewport signs. Otherwise it gets glitchy or abbreviated (in the smallmap)
parent
43abfbd426
commit
0e78fdb54c
|
@ -188,8 +188,6 @@ void ZoomInOrOutToCursorWindow(bool in, Window *w)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void UpdateAllStationVirtCoords();
|
|
||||||
|
|
||||||
/** Widgets of the main window. */
|
/** Widgets of the main window. */
|
||||||
enum MainWindowWidgets {
|
enum MainWindowWidgets {
|
||||||
MW_VIEWPORT, ///< Main window viewport.
|
MW_VIEWPORT, ///< Main window viewport.
|
||||||
|
@ -293,7 +291,7 @@ struct MainWindow : Window
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '2' | WKC_ALT: // Update the coordinates of all station signs
|
case '2' | WKC_ALT: // Update the coordinates of all station signs
|
||||||
UpdateAllStationVirtCoords();
|
UpdateAllVirtCoords();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,16 @@ static inline RailType UpdateRailType(RailType rt, RailType min)
|
||||||
return rt >= min ? (RailType)(rt + 1): rt;
|
return rt >= min ? (RailType)(rt + 1): rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the viewport coordinates of all signs.
|
||||||
|
*/
|
||||||
|
void UpdateAllVirtCoords()
|
||||||
|
{
|
||||||
|
UpdateAllStationVirtCoords();
|
||||||
|
UpdateAllSignVirtCoords();
|
||||||
|
UpdateAllTownVirtCoords();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialization of the windows and several kinds of caches.
|
* Initialization of the windows and several kinds of caches.
|
||||||
* This is not done directly in AfterLoadGame because these
|
* This is not done directly in AfterLoadGame because these
|
||||||
|
@ -224,12 +234,9 @@ static void InitializeWindowsAndCaches()
|
||||||
ResetWindowSystem();
|
ResetWindowSystem();
|
||||||
SetupColoursAndInitialWindow();
|
SetupColoursAndInitialWindow();
|
||||||
|
|
||||||
ResetViewportAfterLoadGame();
|
|
||||||
|
|
||||||
/* Update coordinates of the signs. */
|
/* Update coordinates of the signs. */
|
||||||
UpdateAllStationVirtCoords();
|
UpdateAllVirtCoords();
|
||||||
UpdateAllSignVirtCoords();
|
ResetViewportAfterLoadGame();
|
||||||
UpdateAllTownVirtCoords();
|
|
||||||
|
|
||||||
Company *c;
|
Company *c;
|
||||||
FOR_ALL_COMPANIES(c) {
|
FOR_ALL_COMPANIES(c) {
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "base_media_base.h"
|
#include "base_media_base.h"
|
||||||
#include "company_base.h"
|
#include "company_base.h"
|
||||||
#include "company_func.h"
|
#include "company_func.h"
|
||||||
|
#include "viewport_func.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
|
@ -380,7 +381,7 @@ struct GameOptionsWindow : Window {
|
||||||
case GOW_LANG_DROPDOWN: // Change interface language
|
case GOW_LANG_DROPDOWN: // Change interface language
|
||||||
ReadLanguagePack(index);
|
ReadLanguagePack(index);
|
||||||
CheckForMissingGlyphsInLoadedLanguagePack();
|
CheckForMissingGlyphsInLoadedLanguagePack();
|
||||||
UpdateAllStationVirtCoords();
|
UpdateAllVirtCoords();
|
||||||
ReInitAllWindows();
|
ReInitAllWindows();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,8 @@ bool ScrollWindowTo(int x, int y, int z, Window *w, bool instant = false);
|
||||||
bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
|
bool ScrollMainWindowToTile(TileIndex tile, bool instant = false);
|
||||||
bool ScrollMainWindowTo(int x, int y, int z = -1, bool instant = false);
|
bool ScrollMainWindowTo(int x, int y, int z = -1, bool instant = false);
|
||||||
|
|
||||||
|
void UpdateAllVirtCoords();
|
||||||
|
|
||||||
extern Point _tile_fract_coords;
|
extern Point _tile_fract_coords;
|
||||||
|
|
||||||
#endif /* VIEWPORT_FUNC_H */
|
#endif /* VIEWPORT_FUNC_H */
|
||||||
|
|
Loading…
Reference in New Issue