mirror of https://github.com/OpenTTD/OpenTTD
(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
parent
a8c7707fe0
commit
c5387508eb
|
@ -131,7 +131,7 @@
|
|||
extern uint8 GetAirportNoiseLevelForTown(const AirportSpec *as, TileIndex town_tile, TileIndex tile);
|
||||
|
||||
if (!::IsValidTile(tile)) return -1;
|
||||
if (!IsValidAirportType(type)) return -1;
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
|
||||
if (_settings_game.economy.station_noise_level) {
|
||||
const AirportSpec *as = ::AirportSpec::Get(type);
|
||||
|
|
|
@ -180,6 +180,7 @@ public:
|
|||
* built at this tile.
|
||||
* @param tile The tile to check.
|
||||
* @param type The AirportType to check.
|
||||
* @pre IsAirportInformationAvailable(type).
|
||||
* @return The amount of noise added to the nearest town.
|
||||
* @note The noise will be added to the town with TownID GetNearestTown(tile, type).
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "widgets/dropdown_type.h"
|
||||
#include "core/geometry_func.hpp"
|
||||
#include "hotkeys.h"
|
||||
#include "vehicle_func.h"
|
||||
#include "sprite.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
|
@ -195,6 +196,7 @@ Window *ShowBuildAirToolbar()
|
|||
|
||||
EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
{
|
||||
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
|
||||
int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
Window *w = ShowBuildAirToolbar();
|
||||
|
|
|
@ -792,7 +792,7 @@ public:
|
|||
/* 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
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ struct DeterministicSpriteGroup : SpriteGroup {
|
|||
|
||||
VarSpriteGroupScope var_scope;
|
||||
DeterministicSpriteGroupSize size;
|
||||
byte num_adjusts;
|
||||
uint num_adjusts;
|
||||
byte num_ranges;
|
||||
DeterministicSpriteGroupAdjust *adjusts;
|
||||
DeterministicSpriteGroupRange *ranges; // Dynamically allocated
|
||||
|
|
|
@ -240,7 +240,7 @@ public:
|
|||
/* 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
|
||||
* 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();
|
||||
if (y > this->info_height) {
|
||||
BuildObjectWindow *bow = const_cast<BuildObjectWindow *>(this);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "core/geometry_func.hpp"
|
||||
#include "hotkeys.h"
|
||||
#include "engine_base.h"
|
||||
#include "vehicle_func.h"
|
||||
|
||||
#include "station_map.h"
|
||||
#include "tunnelbridge_map.h"
|
||||
|
@ -849,6 +850,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
|
|||
|
||||
EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
{
|
||||
if (!CanBuildVehicleInfrastructure(VEH_TRAIN)) return ES_NOT_HANDLED;
|
||||
extern RailType _last_built_railtype;
|
||||
int num = CheckHotkeyMatch<BuildRailToolbarWindow>(_railtoolbar_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
Loading…
Reference in New Issue