Merge branch 'master' into jgrpp
# Conflicts: # src/cheat_gui.cpp # src/industry_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc/getoptdata.h # src/music/dmusic.cpp # src/network/core/os_abstraction.cpp # src/newgrf_engine.cpp # src/openttd.cpp # src/order_gui.cpp # src/os/windows/win32.cpp # src/pathfinder/npf/queue.cpp # src/smallmap_gui.cpp # src/strgen/strgen.cpp
This commit is contained in:
@@ -336,39 +336,38 @@ struct CheatWindow : Window {
|
||||
|
||||
uint width = 0;
|
||||
uint lines = 0;
|
||||
for (int i = 0; i != lengthof(_cheats_ui); i++) {
|
||||
const CheatEntry *ce = &_cheats_ui[i];
|
||||
if (!IsCheatAllowed(ce->mode)) continue;
|
||||
for (const CheatEntry &ce : _cheats_ui) {
|
||||
if (!IsCheatAllowed(ce.mode)) continue;
|
||||
lines++;
|
||||
switch (ce->type) {
|
||||
switch (ce.type) {
|
||||
case SLF_ALLOW_CONTROL:
|
||||
/* Change inflation factors */
|
||||
break;
|
||||
|
||||
case SLE_BOOL:
|
||||
SetDParam(0, STR_CONFIG_SETTING_ON);
|
||||
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
||||
width = std::max(width, GetStringBoundingBox(ce.str).width);
|
||||
SetDParam(0, STR_CONFIG_SETTING_OFF);
|
||||
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
||||
width = std::max(width, GetStringBoundingBox(ce.str).width);
|
||||
break;
|
||||
|
||||
default:
|
||||
switch (ce->str) {
|
||||
switch (ce.str) {
|
||||
/* Display date for change date cheat */
|
||||
case STR_CHEAT_CHANGE_DATE:
|
||||
SetDParam(0, CalTime::ConvertYMDToDate(CalTime::MAX_YEAR, 11, 31));
|
||||
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
||||
width = std::max(width, GetStringBoundingBox(ce.str).width);
|
||||
break;
|
||||
|
||||
/* Draw coloured flag for change company cheat */
|
||||
case STR_CHEAT_CHANGE_COMPANY:
|
||||
SetDParamMaxValue(0, MAX_COMPANIES);
|
||||
width = std::max(width, GetStringBoundingBox(ce->str).width + WidgetDimensions::scaled.hsep_wide * 4);
|
||||
width = std::max(width, GetStringBoundingBox(ce.str).width + WidgetDimensions::scaled.hsep_wide * 4);
|
||||
break;
|
||||
|
||||
default:
|
||||
SetDParam(0, INT64_MAX);
|
||||
width = std::max(width, GetStringBoundingBox(ce->str).width);
|
||||
width = std::max(width, GetStringBoundingBox(ce.str).width);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user