1
0
Fork 0

(svn r22837) [1.1] -Backport from trunk:

- Fix: [NewGRF] Always draw NewGRF supplied texts with a default colour (r22725)
- Fix: [NewGRF] Do not restrict AdvVarAct2 to 255 operations (r22723)
- Fix: If there is no point in opening the rail/air toolbar, do not open it for people who use hotkeys either rather than only for those using GUI elements (r22716, r22715, r22714)
- Fix: [NoAI] Allow AIAirport::GetNoiseLevelIncrease() also for expired airports [FS#4704] (r22710)
release/1.1
rubidium 2011-08-25 13:21:25 +00:00
parent a8c7707fe0
commit c5387508eb
7 changed files with 9 additions and 4 deletions

View File

@ -131,7 +131,7 @@
extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIndex town_tile, TileIndex tile); extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIndex town_tile, TileIndex tile);
if (!::IsValidTile(tile)) return -1; if (!::IsValidTile(tile)) return -1;
if (!IsValidAirportType(type)) return -1; if (!IsAirportInformationAvailable(type)) return -1;
if (_settings_game.economy.station_noise_level) { if (_settings_game.economy.station_noise_level) {
const AirportSpec *as = ::AirportSpec::Get(type); const AirportSpec *as = ::AirportSpec::Get(type);

View File

@ -180,6 +180,7 @@ public:
* built at this tile. * built at this tile.
* @param tile The tile to check. * @param tile The tile to check.
* @param type The AirportType to check. * @param type The AirportType to check.
* @pre IsAirportInformationAvailable(type).
* @return The amount of noise added to the nearest town. * @return The amount of noise added to the nearest town.
* @note The noise will be added to the town with TownID GetNearestTown(tile, type). * @note The noise will be added to the town with TownID GetNearestTown(tile, type).
*/ */

View File

@ -26,6 +26,7 @@
#include "widgets/dropdown_type.h" #include "widgets/dropdown_type.h"
#include "core/geometry_func.hpp" #include "core/geometry_func.hpp"
#include "hotkeys.h" #include "hotkeys.h"
#include "vehicle_func.h"
#include "sprite.h" #include "sprite.h"
#include "table/strings.h" #include "table/strings.h"
@ -195,6 +196,7 @@ Window *ShowBuildAirToolbar()
EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode) EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
{ {
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true); int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
if (num == -1) return ES_NOT_HANDLED; if (num == -1) return ES_NOT_HANDLED;
Window *w = ShowBuildAirToolbar(); Window *w = ShowBuildAirToolbar();

View File

@ -792,7 +792,7 @@ public:
/* Use all the available space left from where we stand up to the /* Use all the available space left from where we stand up to the
* end of the window. We ALSO enlarge the window if needed, so we * end of the window. We ALSO enlarge the window if needed, so we
* can 'go' wild with the bottom of the window. */ * can 'go' wild with the bottom of the window. */
y = DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, y, UINT16_MAX, message); y = DrawStringMultiLine(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, y, UINT16_MAX, message, TC_BLACK);
StopTextRefStackUsage(); StopTextRefStackUsage();
} }
} }

View File

@ -197,7 +197,7 @@ struct DeterministicSpriteGroup : SpriteGroup {
VarSpriteGroupScope var_scope; VarSpriteGroupScope var_scope;
DeterministicSpriteGroupSize size; DeterministicSpriteGroupSize size;
byte num_adjusts; uint num_adjusts;
byte num_ranges; byte num_ranges;
DeterministicSpriteGroupAdjust *adjusts; DeterministicSpriteGroupAdjust *adjusts;
DeterministicSpriteGroupRange *ranges; // Dynamically allocated DeterministicSpriteGroupRange *ranges; // Dynamically allocated

View File

@ -240,7 +240,7 @@ public:
/* Use all the available space left from where we stand up to the /* Use all the available space left from where we stand up to the
* end of the window. We ALSO enlarge the window if needed, so we * end of the window. We ALSO enlarge the window if needed, so we
* can 'go' wild with the bottom of the window. */ * can 'go' wild with the bottom of the window. */
int y = DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, message) - r.top; int y = DrawStringMultiLine(r.left, r.right, r.top, UINT16_MAX, message, TC_ORANGE) - r.top;
StopTextRefStackUsage(); StopTextRefStackUsage();
if (y > this->info_height) { if (y > this->info_height) {
BuildObjectWindow *bow = const_cast<BuildObjectWindow *>(this); BuildObjectWindow *bow = const_cast<BuildObjectWindow *>(this);

View File

@ -31,6 +31,7 @@
#include "core/geometry_func.hpp" #include "core/geometry_func.hpp"
#include "hotkeys.h" #include "hotkeys.h"
#include "engine_base.h" #include "engine_base.h"
#include "vehicle_func.h"
#include "station_map.h" #include "station_map.h"
#include "tunnelbridge_map.h" #include "tunnelbridge_map.h"
@ -849,6 +850,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode) EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode)
{ {
if (!CanBuildVehicleInfrastructure(VEH_TRAIN)) return ES_NOT_HANDLED;
extern RailType _last_built_railtype; extern RailType _last_built_railtype;
int num = CheckHotkeyMatch<BuildRailToolbarWindow>(_railtoolbar_hotkeys, keycode, NULL, true); int num = CheckHotkeyMatch<BuildRailToolbarWindow>(_railtoolbar_hotkeys, keycode, NULL, true);
if (num == -1) return ES_NOT_HANDLED; if (num == -1) return ES_NOT_HANDLED;