mirror of https://github.com/OpenTTD/OpenTTD
(svn r21180) [1.0] -Backport from trunk:
- Fix: Default service interval for ships/aircraft got switched [FS#4222] (r21155) - Fix: Sort arrow was not accounted for in two windows causing it to be overwritten by the 'sort by' string [FS#4221] (r21151) - Fix: Upper limit for snowline was too low [FS#4203] (r21078) - Fix: Wrong (maximum) value shown for generation seed in the in-game console [FS#4192] (r21075) - Fix: [NewGRF] Crash when getting an industry ID at an offset that uses some 'old' style industry tile [FS#4157] (r20912)release/1.0
parent
63e1927b23
commit
b38a14458e
|
@ -28,6 +28,7 @@
|
|||
#include "widgets/dropdown_func.h"
|
||||
#include "engine_gui.h"
|
||||
#include "cargotype.h"
|
||||
#include "core/geometry_func.hpp"
|
||||
|
||||
#include "table/sprites.h"
|
||||
#include "table/strings.h"
|
||||
|
@ -1087,6 +1088,14 @@ struct BuildVehicleWindow : Window {
|
|||
case BUILD_VEHICLE_WIDGET_PANEL:
|
||||
size->height = this->details_height;
|
||||
break;
|
||||
|
||||
case BUILD_VEHICLE_WIDGET_SORT_ASSENDING_DESCENDING: {
|
||||
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
|
||||
d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the string is centred and it also looks better.
|
||||
d.height += padding.height;
|
||||
*size = maxdim(*size, d);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1804,6 +1804,15 @@ public:
|
|||
resize->height = FONT_HEIGHT_NORMAL;
|
||||
size->height = resize->height * 10 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
|
||||
break;
|
||||
|
||||
case SLWW_SORT_BYNAME:
|
||||
case SLWW_SORT_BYDATE: {
|
||||
Dimension d = GetStringBoundingBox(this->GetWidget<NWidgetCore>(widget)->widget_data);
|
||||
d.width += padding.width + WD_SORTBUTTON_ARROW_WIDTH * 2; // Doubled since the string is centred and it also looks better.
|
||||
d.height += padding.height;
|
||||
*size = maxdim(*size, d);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ uint32 GetIndustryIDAtOffset(TileIndex tile, const Industry *i, uint32 cur_grfid
|
|||
IndustryGfx gfx = GetCleanIndustryGfx(tile);
|
||||
const IndustryTileSpec *indtsp = GetIndustryTileSpec(gfx);
|
||||
|
||||
if (gfx < NEW_INDUSTRYOFFSET) { // Does it belongs to an old type?
|
||||
if (gfx < NEW_INDUSTRYTILEOFFSET) { // Does it belongs to an old type?
|
||||
/* It is an old tile. We have to see if it's been overriden */
|
||||
if (indtsp->grf_prop.override == INVALID_INDUSTRYTILE) { // has it been overridden?
|
||||
return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile
|
||||
|
|
|
@ -737,8 +737,8 @@ static bool CheckInterval(int32 p1)
|
|||
} else {
|
||||
vds->servint_trains = 150;
|
||||
vds->servint_roadveh = 150;
|
||||
vds->servint_aircraft = 360;
|
||||
vds->servint_ships = 100;
|
||||
vds->servint_aircraft = 100;
|
||||
vds->servint_ships = 360;
|
||||
}
|
||||
|
||||
InvalidateDetailsWindow(0);
|
||||
|
@ -1770,10 +1770,10 @@ void IConsoleGetSetting(const char *name, bool force_newgame)
|
|||
if (sd->desc.cmd == SDT_BOOLX) {
|
||||
snprintf(value, sizeof(value), (*(bool*)ptr == 1) ? "on" : "off");
|
||||
} else {
|
||||
snprintf(value, sizeof(value), "%d", (int32)ReadValue(ptr, sd->save.conv));
|
||||
snprintf(value, sizeof(value), sd->desc.min < 0 ? "%d" : "%u", (int32)ReadValue(ptr, sd->save.conv));
|
||||
}
|
||||
|
||||
IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s' (min: %s%d, max: %d)",
|
||||
IConsolePrintF(CC_WARNING, "Current value for '%s' is: '%s' (min: %s%d, max: %u)",
|
||||
name, value, (sd->desc.flags & SGF_0ISDISABLED) ? "(0) " : "", sd->desc.min, sd->desc.max);
|
||||
}
|
||||
}
|
||||
|
@ -1798,7 +1798,7 @@ void IConsoleListSettings(const char *prefilter)
|
|||
} else if (sd->desc.cmd == SDT_STRING) {
|
||||
snprintf(value, sizeof(value), "%s", (GetVarMemType(sd->save.conv) == SLE_VAR_STRQ) ? *(const char **)ptr : (const char *)ptr);
|
||||
} else {
|
||||
snprintf(value, lengthof(value), "%d", (uint32)ReadValue(ptr, sd->save.conv));
|
||||
snprintf(value, lengthof(value), sd->desc.min < 0 ? "%d" : "%u", (int32)ReadValue(ptr, sd->save.conv));
|
||||
}
|
||||
IConsolePrintF(CC_DEFAULT, "%s = %s", sd->desc.name, value);
|
||||
}
|
||||
|
|
|
@ -315,7 +315,7 @@ static const SettingDesc _gameopt_settings[] = {
|
|||
/* There are only 21 predefined town_name values (0-20), but you can have more with newgrf action F so allow these bigger values (21-255). Invalid values will fallback to english on use and (undefined string) in GUI. */
|
||||
SDT_OMANY(GameSettings, game_creation.town_name, SLE_UINT8, 0, 0, 0, 255, _town_names, STR_NULL, NULL, NULL),
|
||||
SDT_OMANY(GameSettings, game_creation.landscape, SLE_UINT8, 0, 0, 0, 3, _climates, STR_NULL, NULL, ConvertLandscape),
|
||||
SDT_VAR(GameSettings, game_creation.snow_line, SLE_UINT8, 0, 0, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, MIN_SNOWLINE_HEIGHT * TILE_HEIGHT, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, 0, STR_NULL, NULL),
|
||||
SDT_VAR(GameSettings, game_creation.snow_line, SLE_UINT8, 0, 0, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, MIN_SNOWLINE_HEIGHT * TILE_HEIGHT, MAX_SNOWLINE_HEIGHT * TILE_HEIGHT, 0, STR_NULL, NULL),
|
||||
SDT_CONDNULL( 1, 0, 22),
|
||||
SDTC_CONDOMANY( gui.autosave, SLE_UINT8, 23, SL_MAX_VERSION, S, 0, 1, 4, _autosave_interval, STR_NULL, NULL),
|
||||
SDT_OMANY(GameSettings, vehicle.road_side, SLE_UINT8, 0, 0, 1, 1, _roadsides, STR_NULL, NULL, NULL),
|
||||
|
@ -358,7 +358,7 @@ const SettingDesc _settings[] = {
|
|||
/* There are only 21 predefined town_name values (0-20), but you can have more with newgrf action F so allow these bigger values (21-255). Invalid values will fallback to english on use and (undefined string) in GUI. */
|
||||
SDT_CONDOMANY(GameSettings, game_creation.town_name, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, 0, 255, _town_names, STR_NULL, NULL, NULL),
|
||||
SDT_CONDOMANY(GameSettings, game_creation.landscape, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, 0, 3, _climates, STR_NULL, NULL, ConvertLandscape),
|
||||
SDT_CONDVAR(GameSettings, game_creation.snow_line, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, MIN_SNOWLINE_HEIGHT * TILE_HEIGHT, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, 0, STR_NULL, NULL),
|
||||
SDT_CONDVAR(GameSettings, game_creation.snow_line, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, DEF_SNOWLINE_HEIGHT * TILE_HEIGHT, MIN_SNOWLINE_HEIGHT * TILE_HEIGHT, MAX_SNOWLINE_HEIGHT * TILE_HEIGHT, 0, STR_NULL, NULL),
|
||||
SDT_CONDOMANY(GameSettings, vehicle.road_side, SLE_UINT8, 97, SL_MAX_VERSION, 0,NN, 1, 1, _roadsides, STR_NULL, CheckRoadSide, NULL),
|
||||
|
||||
SDT_BOOL(GameSettings, construction.build_on_slopes, 0,NN, true, STR_CONFIG_SETTING_BUILDONSLOPES, NULL),
|
||||
|
@ -429,7 +429,7 @@ const SettingDesc _settings[] = {
|
|||
SDT_BOOL(GameSettings, economy.bribe, 0, 0, true, STR_CONFIG_SETTING_BRIBE, NULL),
|
||||
SDT_CONDBOOL(GameSettings, economy.exclusive_rights, 79, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_EXCLUSIVE, NULL),
|
||||
SDT_CONDBOOL(GameSettings, economy.give_money, 79, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_GIVE_MONEY, NULL),
|
||||
SDT_VAR(GameSettings, game_creation.snow_line_height, SLE_UINT8, 0, 0, DEF_SNOWLINE_HEIGHT, MIN_SNOWLINE_HEIGHT, DEF_SNOWLINE_HEIGHT, 0, STR_CONFIG_SETTING_SNOWLINE_HEIGHT, NULL),
|
||||
SDT_VAR(GameSettings, game_creation.snow_line_height, SLE_UINT8, 0, 0, DEF_SNOWLINE_HEIGHT, MIN_SNOWLINE_HEIGHT, MAX_SNOWLINE_HEIGHT, 0, STR_CONFIG_SETTING_SNOWLINE_HEIGHT, NULL),
|
||||
SDT_CONDNULL( 4, 0, 143),
|
||||
SDT_VAR(GameSettings, game_creation.starting_year, SLE_INT32, 0,NC,DEF_START_YEAR,MIN_YEAR,MAX_YEAR,1,STR_CONFIG_SETTING_STARTING_YEAR, NULL),
|
||||
SDT_CONDNULL( 4, 0, 104),
|
||||
|
|
Loading…
Reference in New Issue