center towns laels on minimap
This commit is contained in:
+4
-1
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user