@@ -1332,25 +1332,30 @@ static void CrashAirplane(Aircraft *v)
if (st == nullptr) {
newsitem = STR_NEWS_PLANE_CRASH_OUT_OF_FUEL;
vt = TileVirtXY(v->x_pos, v->y_pos);
} else {
SetDParam(1, st->index);
newsitem = STR_NEWS_AIRCRAFT_CRASH;
vt = v->tile;
}
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, vt, st == nullptr ? ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT : ScriptEventVehicleCrashed::CRASH_PLANE_LANDING));
AddTileNewsItem(newsitem, NT_ACCIDENT, vt, nullptr, st != nullptr ? st->index : INVALID_STATION);
NewsType newstype = NT_ACCIDENT;
if (v->owner != _local_company) {
newstype = NT_ACCIDENT_OTHER;
AddTileNewsItem(newsitem, newstype, vt, nullptr, st != nullptr ? st->index : INVALID_STATION);
ModifyStationRatingAround(vt, v->owner, -160, 30);
if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v);
/**
* Decide whether aircraft \a v should crash.
* @param v Aircraft to test.
*/
static void MaybeCrashAirplane(Aircraft *v)
{
@@ -1734,24 +1734,27 @@ STR_CONFIG_SETTING_WAGONSPEEDLIMITS_HELP
STR_CONFIG_SETTING_DISABLE_ELRAILS :Disable electric rails: {STRING2}
STR_CONFIG_SETTING_DISABLE_ELRAILS_HELPTEXT :Enabling this setting disables the requirement to electrify tracks to make electric engines run on them
STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN :Arrival of first vehicle at player's station: {STRING2}
STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OWN_HELPTEXT :Display a newspaper when the first vehicle arrives at a new player's station
STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER :Arrival of first vehicle at competitor's station: {STRING2}
STR_CONFIG_SETTING_NEWS_ARRIVAL_FIRST_VEHICLE_OTHER_HELPTEXT :Display a newspaper when the first vehicle arrives at a new competitor's station
STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS :Accidents / disasters: {STRING2}
STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT :Display a newspaper when accidents or disasters occur
STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER :Accidents of competitor's vehicles: {STRING2}
STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT :Display a newspaper about crashed vehicles for competitors
STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION :Company information: {STRING2}
STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT :Display a newspaper when a new company starts, or when companies are risking to bankrupt
STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN :Opening of industries: {STRING2}
STR_CONFIG_SETTING_NEWS_INDUSTRY_OPEN_HELPTEXT :Display a newspaper when new industries open
STR_CONFIG_SETTING_NEWS_INDUSTRY_CLOSE :Closing of industries: {STRING2}
STR_CONFIG_SETTING_NEWS_INDUSTRY_CLOSE_HELPTEXT :Display a newspaper when industries close down
STR_CONFIG_SETTING_NEWS_ECONOMY_CHANGES :Economy changes: {STRING2}
STR_CONFIG_SETTING_NEWS_ECONOMY_CHANGES_HELPTEXT :Display a newspaper about global changes to economy
@@ -222,24 +222,25 @@ WindowDesc* GetNewsWindowLayout(NewsFlag
assert(layout < lengthof(_news_window_layout));
return _news_window_layout[layout];
* Per-NewsType data
static NewsTypeData _news_type_data[] = {
/* name, age, sound, */
NewsTypeData("news_display.arrival_player", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_COMPANY
NewsTypeData("news_display.arrival_other", 60, SND_1D_APPLAUSE ), ///< NT_ARRIVAL_OTHER
NewsTypeData("news_display.accident", 90, SND_BEGIN ), ///< NT_ACCIDENT
NewsTypeData("news_display.accident_other", 90, SND_BEGIN ), ///< NT_ACCIDENT_OTHER
NewsTypeData("news_display.company_info", 60, SND_BEGIN ), ///< NT_COMPANY_INFO
NewsTypeData("news_display.open", 90, SND_BEGIN ), ///< NT_INDUSTRY_OPEN
NewsTypeData("news_display.close", 90, SND_BEGIN ), ///< NT_INDUSTRY_CLOSE
NewsTypeData("news_display.economy", 30, SND_BEGIN ), ///< NT_ECONOMY
NewsTypeData("news_display.production_player", 30, SND_BEGIN ), ///< NT_INDUSTRY_COMPANY
NewsTypeData("news_display.production_other", 30, SND_BEGIN ), ///< NT_INDUSTRY_OTHER
NewsTypeData("news_display.production_nobody", 30, SND_BEGIN ), ///< NT_INDUSTRY_NOBODY
NewsTypeData("news_display.advice", 150, SND_BEGIN ), ///< NT_ADVICE
NewsTypeData("news_display.new_vehicles", 30, SND_1E_NEW_ENGINE), ///< NT_NEW_VEHICLES
NewsTypeData("news_display.acceptance", 90, SND_BEGIN ), ///< NT_ACCEPTANCE
NewsTypeData("news_display.subsidies", 180, SND_BEGIN ), ///< NT_SUBSIDIES
NewsTypeData("news_display.general", 60, SND_BEGIN ), ///< NT_GENERAL
@@ -13,24 +13,25 @@
#include "core/enum_type.hpp"
#include "date_type.h"
#include "strings_type.h"
#include "sound_type.h"
* Type of news.
enum NewsType {
NT_ARRIVAL_COMPANY, ///< First vehicle arrived for company
NT_ARRIVAL_OTHER, ///< First vehicle arrived for competitor
NT_ACCIDENT, ///< An accident or disaster has occurred
NT_ACCIDENT_OTHER, ///< An accident or disaster has occurred
NT_COMPANY_INFO, ///< Company info (new companies, bankruptcy messages)
NT_INDUSTRY_OPEN, ///< Opening of industries
NT_INDUSTRY_CLOSE, ///< Closing of industries
NT_ECONOMY, ///< Economic changes (recession, industry up/dowm)
NT_INDUSTRY_COMPANY,///< Production changes of industry serviced by local company
NT_INDUSTRY_OTHER, ///< Production changes of industry serviced by competitor(s)
NT_INDUSTRY_NOBODY, ///< Other industry production changes
NT_ADVICE, ///< Bits of news about vehicles of the company
NT_NEW_VEHICLES, ///< New vehicle has become available
NT_ACCEPTANCE, ///< A type of cargo is (no longer) accepted
NT_SUBSIDIES, ///< News about subsidies (announcements, expirations, acceptance)
NT_GENERAL, ///< General news (from towns)
@@ -544,25 +544,31 @@ uint RoadVehicle::Crash(bool flooded)
return pass;
static void RoadVehCrash(RoadVehicle *v)
uint pass = v->Crash();
AI::NewEvent(v->owner, new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING));
Game::NewEvent(new ScriptEventVehicleCrashed(v->index, v->tile, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING));
SetDParam(0, pass);
StringID newsitem = (pass == 1) ? STR_NEWS_ROAD_VEHICLE_CRASH_DRIVER : STR_NEWS_ROAD_VEHICLE_CRASH;
AddTileNewsItem(newsitem, NT_ACCIDENT, v->tile);
AddTileNewsItem(newsitem, newstype, v->tile);
ModifyStationRatingAround(v->tile, v->owner, -160, 22);
static bool RoadVehCheckTrainCrash(RoadVehicle *v)
for (RoadVehicle *u = v; u != nullptr; u = u->Next()) {
if (u->state == RVSB_WORMHOLE) continue;
TileIndex tile = u->tile;
@@ -1639,24 +1639,25 @@ static SettingsContainer &GetSettingsTre
interface->Add(new SettingEntry("gui.timetable_in_ticks"));
interface->Add(new SettingEntry("gui.timetable_arrival_departure"));
interface->Add(new SettingEntry("gui.expenses_layout"));
interface->Add(new SettingEntry("gui.show_newgrf_name"));
SettingsPage *advisors = main->Add(new SettingsPage(STR_CONFIG_SETTING_ADVISORS));
advisors->Add(new SettingEntry("gui.coloured_news_year"));
advisors->Add(new SettingEntry("news_display.general"));
advisors->Add(new SettingEntry("news_display.new_vehicles"));
advisors->Add(new SettingEntry("news_display.accident"));
advisors->Add(new SettingEntry("news_display.accident_other"));
advisors->Add(new SettingEntry("news_display.company_info"));
advisors->Add(new SettingEntry("news_display.acceptance"));
advisors->Add(new SettingEntry("news_display.arrival_player"));
advisors->Add(new SettingEntry("news_display.arrival_other"));
advisors->Add(new SettingEntry("news_display.advice"));
advisors->Add(new SettingEntry("gui.order_review_system"));
advisors->Add(new SettingEntry("gui.vehicle_income_warn"));
advisors->Add(new SettingEntry("gui.lost_vehicle_warn"));
advisors->Add(new SettingEntry("gui.show_finances"));
advisors->Add(new SettingEntry("news_display.economy"));
advisors->Add(new SettingEntry("news_display.subsidies"));
advisors->Add(new SettingEntry("news_display.open"));
@@ -233,24 +233,25 @@ struct LocaleSettings {
byte units_force; ///< unit system for force
byte units_height; ///< unit system for height
std::string digit_group_separator; ///< thousand separator for non-currencies
std::string digit_group_separator_currency; ///< thousand separator for currencies
std::string digit_decimal_separator; ///< decimal separator
};
/** Settings related to news */
struct NewsSettings {
uint8 arrival_player; ///< NewsDisplay of vehicles arriving at new stations of current player
uint8 arrival_other; ///< NewsDisplay of vehicles arriving at new stations of other players
uint8 accident; ///< NewsDisplay of accidents that occur
uint8 accident_other; ///< NewsDisplay if a vehicle from another company is involved in an accident
uint8 company_info; ///< NewsDisplay of general company information
uint8 open; ///< NewsDisplay on new industry constructions
uint8 close; ///< NewsDisplay about closing industries
uint8 economy; ///< NewsDisplay on economical changes
uint8 production_player; ///< NewsDisplay of production changes of industries affecting current player
uint8 production_other; ///< NewsDisplay of production changes of industries affecting competitors
uint8 production_nobody; ///< NewsDisplay of production changes of industries affecting no one
uint8 advice; ///< NewsDisplay on advice affecting the player's vehicles
uint8 new_vehicles; ///< NewsDisplay of new vehicles becoming available
uint8 acceptance; ///< NewsDisplay on changes affecting the acceptance of cargo at stations
uint8 subsidies; ///< NewsDisplay of changes on subsidies
uint8 general; ///< NewsDisplay of other topics
@@ -59,24 +59,35 @@ strval = STR_CONFIG_SETTING_NEWS_MESSA
[SDTC_OMANY]
var = news_display.accident
type = SLE_UINT8
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_GUI_DROPDOWN
def = 2
max = 2
full = _news_display
str = STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS
strhelp = STR_CONFIG_SETTING_NEWS_ACCIDENTS_DISASTERS_HELPTEXT
strval = STR_CONFIG_SETTING_NEWS_MESSAGES_OFF
var = news_display.accident_other
str = STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER
strhelp = STR_CONFIG_SETTING_NEWS_ACCIDENT_OTHER_HELPTEXT
var = news_display.company_info
str = STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION
strhelp = STR_CONFIG_SETTING_NEWS_COMPANY_INFORMATION_HELPTEXT
var = news_display.open
Status change: