summaryrefslogtreecommitdiff
path: root/src/industry_gui.cpp
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2020-06-01 00:44:11 +0200
committerYexo <t.marinussen@gmail.com>2020-06-01 22:46:06 +0200
commit1507902d0083b4983d59efdd3859dde0a9b19fa3 (patch)
treedab5b909290cbdad326ca907319d9b33f109e4f4 /src/industry_gui.cpp
parentce618bf7e96ddc92b1ceb7c82c821af822b3796d (diff)
downloadopenttd-1507902d0083b4983d59efdd3859dde0a9b19fa3.tar.xz
Codechange: remove has_newindustries global
Diffstat (limited to 'src/industry_gui.cpp')
-rw-r--r--src/industry_gui.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp
index c7ba3345c..88cbc91d1 100644
--- a/src/industry_gui.cpp
+++ b/src/industry_gui.cpp
@@ -416,10 +416,11 @@ public:
}
case WID_DPI_INFOPANEL: {
- /* Extra line for cost outside of editor + extra lines for 'extra' information for NewGRFs. */
- int height = 2 + (_game_mode == GM_EDITOR ? 0 : 1) + (_loaded_newgrf_features.has_newindustries ? 4 : 0);
+ /* Extra line for cost outside of editor. */
+ int height = 2 + (_game_mode == GM_EDITOR ? 0 : 1);
uint extra_lines_req = 0;
uint extra_lines_prd = 0;
+ uint extra_lines_newgrf = 0;
uint max_minwidth = FONT_HEIGHT_NORMAL * MAX_MINWIDTH_LINEHEIGHTS;
Dimension d = {0, 0};
for (byte i = 0; i < this->count; i++) {
@@ -447,10 +448,15 @@ public:
strdim.width = max_minwidth;
}
d = maxdim(d, strdim);
+
+ if (indsp->grf_prop.grffile != nullptr) {
+ /* Reserve a few extra lines for text from an industry NewGRF. */
+ extra_lines_newgrf = 4;
+ }
}
/* Set it to something more sane :) */
- height += extra_lines_prd + extra_lines_req;
+ height += extra_lines_prd + extra_lines_req + extra_lines_newgrf;
size->height = height * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
size->width = d.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
break;