center towns laels on minimap

This commit is contained in:
Pavel Stupnikov
2015-03-20 20:50:33 +03:00
parent 3e116e19c9
commit e164352e19
4 changed files with 8 additions and 51 deletions
+4 -1
View File
@@ -1365,7 +1365,7 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
* @param top the new top of the sign
* @param str the string to show in the sign
*/
void ViewportSign::UpdatePosition(int center, int top, StringID str)
void ViewportSign::UpdatePosition(int center, int top, StringID str, StringID small_str)
{
if (this->width_normal != 0) this->MarkDirty();
@@ -1378,6 +1378,9 @@ void ViewportSign::UpdatePosition(int center, int top, StringID str)
this->center = center;
/* zoomed out version */
if (small_str != STR_NULL) {
GetString(buffer, small_str, lastof(buffer));
}
this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + VPSM_RIGHT;
this->MarkDirty();