mirror of https://github.com/OpenTTD/OpenTTD
Codechange: remove has_newindustries global
parent
ce618bf7e9
commit
1507902d00
|
@ -416,10 +416,11 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
case WID_DPI_INFOPANEL: {
|
case WID_DPI_INFOPANEL: {
|
||||||
/* Extra line for cost outside of editor + extra lines for 'extra' information for NewGRFs. */
|
/* Extra line for cost outside of editor. */
|
||||||
int height = 2 + (_game_mode == GM_EDITOR ? 0 : 1) + (_loaded_newgrf_features.has_newindustries ? 4 : 0);
|
int height = 2 + (_game_mode == GM_EDITOR ? 0 : 1);
|
||||||
uint extra_lines_req = 0;
|
uint extra_lines_req = 0;
|
||||||
uint extra_lines_prd = 0;
|
uint extra_lines_prd = 0;
|
||||||
|
uint extra_lines_newgrf = 0;
|
||||||
uint max_minwidth = FONT_HEIGHT_NORMAL * MAX_MINWIDTH_LINEHEIGHTS;
|
uint max_minwidth = FONT_HEIGHT_NORMAL * MAX_MINWIDTH_LINEHEIGHTS;
|
||||||
Dimension d = {0, 0};
|
Dimension d = {0, 0};
|
||||||
for (byte i = 0; i < this->count; i++) {
|
for (byte i = 0; i < this->count; i++) {
|
||||||
|
@ -447,10 +448,15 @@ public:
|
||||||
strdim.width = max_minwidth;
|
strdim.width = max_minwidth;
|
||||||
}
|
}
|
||||||
d = maxdim(d, strdim);
|
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 :) */
|
/* 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->height = height * FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||||
size->width = d.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
size->width = d.width + WD_FRAMERECT_LEFT + WD_FRAMERECT_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -8631,7 +8631,6 @@ void ResetNewGRFData()
|
||||||
|
|
||||||
_loaded_newgrf_features.has_2CC = false;
|
_loaded_newgrf_features.has_2CC = false;
|
||||||
_loaded_newgrf_features.used_liveries = 1 << LS_DEFAULT;
|
_loaded_newgrf_features.used_liveries = 1 << LS_DEFAULT;
|
||||||
_loaded_newgrf_features.has_newindustries = false;
|
|
||||||
_loaded_newgrf_features.shore = SHORE_REPLACE_NONE;
|
_loaded_newgrf_features.shore = SHORE_REPLACE_NONE;
|
||||||
_loaded_newgrf_features.tram = TRAMWAY_REPLACE_DEPOT_NONE;
|
_loaded_newgrf_features.tram = TRAMWAY_REPLACE_DEPOT_NONE;
|
||||||
|
|
||||||
|
@ -9151,7 +9150,6 @@ static void FinaliseIndustriesArray()
|
||||||
}
|
}
|
||||||
|
|
||||||
_industry_mngr.SetEntitySpec(indsp);
|
_industry_mngr.SetEntitySpec(indsp);
|
||||||
_loaded_newgrf_features.has_newindustries = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,6 @@ enum TramReplacement {
|
||||||
struct GRFLoadedFeatures {
|
struct GRFLoadedFeatures {
|
||||||
bool has_2CC; ///< Set if any vehicle is loaded which uses 2cc (two company colours).
|
bool has_2CC; ///< Set if any vehicle is loaded which uses 2cc (two company colours).
|
||||||
uint64 used_liveries; ///< Bitmask of #LiveryScheme used by the defined engines.
|
uint64 used_liveries; ///< Bitmask of #LiveryScheme used by the defined engines.
|
||||||
bool has_newindustries; ///< Set if there are any newindustries loaded.
|
|
||||||
ShoreReplacement shore; ///< In which way shore sprites were replaced.
|
ShoreReplacement shore; ///< In which way shore sprites were replaced.
|
||||||
TramReplacement tram; ///< In which way tram depots were replaced.
|
TramReplacement tram; ///< In which way tram depots were replaced.
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue