Mercurial > hg > openttd
changeset 19913:f4e2c852270b draft
(svn r24846) -Add: Advanced settings to disable certain sound effects.
author | frosch <frosch@openttd.org> |
---|---|
date | Sun, 23 Dec 2012 21:09:09 +0000 |
parents | e06a3b64011f |
children | 6b6c382026ef |
files | src/aircraft_cmd.cpp src/airport_gui.cpp src/bridge_gui.cpp src/company_cmd.cpp src/disaster_cmd.cpp src/dock_gui.cpp src/effectvehicle.cpp src/genworld_gui.cpp src/industry_cmd.cpp src/industry_gui.cpp src/lang/english.txt src/main_gui.cpp src/newgrf_animation_base.h src/newgrf_generic.cpp src/newgrf_sound.cpp src/news_gui.cpp src/rail_cmd.cpp src/rail_gui.cpp src/road_cmd.cpp src/road_gui.cpp src/roadveh_cmd.cpp src/settings_gui.cpp src/settings_type.h src/smallmap_gui.cpp src/table/settings.ini src/terraform_gui.cpp src/toolbar_gui.cpp src/town_gui.cpp src/train_cmd.cpp src/transparency_gui.cpp src/tree_cmd.cpp src/tree_gui.cpp src/water_cmd.cpp |
diffstat | 33 files changed, 185 insertions(+), 100 deletions(-) [+] |
line wrap: on
line diff
--- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1171,7 +1171,7 @@ AddVehicleNewsItem(newsitem, NT_ACCIDENT, v->index, st != NULL ? st->index : INVALID_STATION); ModifyStationRatingAround(v->tile, v->owner, -160, 30); - SndPlayVehicleFx(SND_12_EXPLOSION, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); } /**
--- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -43,7 +43,7 @@ { if (result.Failed()) return; - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } @@ -450,7 +450,7 @@ this->SetWidgetLoweredState(WID_AP_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage); this->SetWidgetLoweredState(WID_AP_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage); this->SetDirty(); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->UpdateSelectSize(); break;
--- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -59,7 +59,7 @@ void CcBuildBridge(const CommandCost &result, TileIndex end_tile, uint32 p1, uint32 p2) { if (result.Failed()) return; - SndPlayTileFx(SND_27_BLACKSMITH_ANVIL, end_tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_27_BLACKSMITH_ANVIL, end_tile); TransportType transport_type = Extract<TransportType, 15, 2>(p2);
--- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -725,9 +725,9 @@ ShowCompanyFinances(_local_company); c = Company::Get(_local_company); if (c->num_valid_stat_ent > 5 && c->old_economy[0].performance_history < c->old_economy[4].performance_history) { - SndPlayFx(SND_01_BAD_YEAR); + if (_settings_client.sound.new_year) SndPlayFx(SND_01_BAD_YEAR); } else { - SndPlayFx(SND_00_GOOD_YEAR); + if (_settings_client.sound.new_year) SndPlayFx(SND_00_GOOD_YEAR); } } }
--- a/src/disaster_cmd.cpp +++ b/src/disaster_cmd.cpp @@ -253,7 +253,7 @@ if (++v->age == 1) { CreateEffectVehicleRel(v, 0, 7, 8, EV_EXPLOSION_LARGE); - SndPlayVehicleFx(SND_12_EXPLOSION, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); v->image_override = SPR_BLIMP_CRASHING; } else if (v->age == 70) { v->image_override = SPR_BLIMP_CRASHED; @@ -361,7 +361,7 @@ /* Destroy? */ if (v->age > 50) { CreateEffectVehicleRel(v, 0, 7, 8, EV_EXPLOSION_LARGE); - SndPlayVehicleFx(SND_12_EXPLOSION, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); delete v; return false; } @@ -431,7 +431,7 @@ SetDParam(0, i->town->index); AddIndustryNewsItem(news_message, NT_ACCIDENT, i->index); // delete the news, when the industry closes - SndPlayTileFx(SND_12_EXPLOSION, i->location.tile); + if (_settings_client.sound.disaster) SndPlayTileFx(SND_12_EXPLOSION, i->location.tile); } } else if (v->current_order.GetDestination() == 0) { int x = v->x_pos + ((leave_at_top ? -15 : 15) * TILE_SIZE); @@ -596,7 +596,7 @@ v->current_order.SetDestination(1); CreateEffectVehicleRel(u, 0, 7, 8, EV_EXPLOSION_LARGE); - SndPlayVehicleFx(SND_12_EXPLOSION, u); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, u); delete u;
--- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -40,13 +40,13 @@ { if (result.Failed()) return; - SndPlayTileFx(SND_02_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } void CcBuildCanal(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { - if (result.Succeeded()) SndPlayTileFx(SND_02_SPLAT, tile); + if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_02_SPLAT, tile); } @@ -436,7 +436,7 @@ this->RaiseWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF); _settings_client.gui.station_show_coverage = (widget != BDSW_LT_OFF); this->LowerWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; } @@ -514,7 +514,7 @@ this->RaiseWidget(_ship_depot_direction + WID_BDD_X); _ship_depot_direction = (widget == WID_BDD_X ? AXIS_X : AXIS_Y); this->LowerWidget(_ship_depot_direction + WID_BDD_X); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); UpdateDocksDirection(); this->SetDirty(); break;
--- a/src/effectvehicle.cpp +++ b/src/effectvehicle.cpp @@ -498,7 +498,7 @@ if (b->y == 4 && b->x == 1) { if (v->z_pos > 180 || Chance16I(1, 96, Random())) { v->spritenum = 5; - SndPlayVehicleFx(SND_2F_POP, v); + if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_2F_POP, v); } anim_state = 0; } @@ -507,7 +507,7 @@ TileIndex tile; anim_state++; - SndPlayVehicleFx(SND_31_EXTRACT, v); + if (_settings_client.sound.ambient) SndPlayVehicleFx(SND_31_EXTRACT, v); tile = TileVirtXY(v->x_pos, v->y_pos); if (IsTileType(tile, MP_INDUSTRY) && GetIndustryGfx(tile) == GFX_BUBBLE_CATCHER) AddAnimatedTile(tile);
--- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -263,7 +263,7 @@ MakeNewgameSettingsLive(); ResetGRFConfig(true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); switch (mode) { case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break; case GLWM_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break;
--- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -540,9 +540,11 @@ if ((_tick_counter & 1) == 0) { byte m = GetAnimationFrame(tile) + 1; - switch (m & 7) { - case 2: SndPlayTileFx(SND_2D_RIP_2, tile); break; - case 6: SndPlayTileFx(SND_29_RIP, tile); break; + if (_settings_client.sound.ambient) { + switch (m & 7) { + case 2: SndPlayTileFx(SND_2D_RIP_2, tile); break; + case 6: SndPlayTileFx(SND_29_RIP, tile); break; + } } if (m >= 96) { @@ -559,7 +561,7 @@ if ((_tick_counter & 3) == 0) { byte m = GetAnimationFrame(tile); - if (_industry_anim_offs_toffee[m] == 0xFF) { + if (_industry_anim_offs_toffee[m] == 0xFF && _settings_client.sound.ambient) { SndPlayTileFx(SND_30_CARTOON_SOUND, tile); } @@ -606,9 +608,9 @@ byte m = GetAnimationFrame(tile) + 1; switch (m) { - case 1: SndPlayTileFx(SND_2C_MACHINERY, tile); break; - case 23: SndPlayTileFx(SND_2B_COMEDY_HIT, tile); break; - case 28: SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile); break; + case 1: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2C_MACHINERY, tile); break; + case 23: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2B_COMEDY_HIT, tile); break; + case 28: if (_settings_client.sound.ambient) SndPlayTileFx(SND_2A_EXTRACT_AND_POP, tile); break; default: if (m >= 50) { int n = GetIndustryAnimationLoop(tile) + 1; @@ -671,7 +673,7 @@ byte m = GetAnimationFrame(tile); if (!(m & 0x40)) { SetAnimationFrame(tile, m | 0x40); - SndPlayTileFx(SND_0B_MINING_MACHINERY, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_0B_MINING_MACHINERY, tile); } if (state & 7) return; } else { @@ -772,7 +774,7 @@ { 49, 59, 60, 65 }, }; - SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_2E_EXTRACT_AND_POP, tile); int dir = Random() & 3; @@ -860,7 +862,7 @@ case GFX_POWERPLANT_SPARKS: if (Chance16(1, 3)) { - SndPlayTileFx(SND_0C_ELECTRIC_SPARK, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_0C_ELECTRIC_SPARK, tile); AddAnimatedTile(tile); } break; @@ -1061,7 +1063,7 @@ _industry_sound_ctr = 1; _industry_sound_tile = tile; - SndPlayTileFx(SND_38_CHAINSAW, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_38_CHAINSAW, tile); DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); @@ -1098,7 +1100,7 @@ if ((i->counter & 0x3F) == 0) { uint32 r; uint num; - if (Chance16R(1, 14, r) && (num = indsp->number_of_sounds) != 0) { + if (Chance16R(1, 14, r) && (num = indsp->number_of_sounds) != 0 && _settings_client.sound.ambient) { SndPlayTileFx( (SoundFx)(indsp->random_sounds[((r >> 16) * num) >> 16]), i->location.tile); @@ -1157,10 +1159,10 @@ _industry_sound_ctr++; if (_industry_sound_ctr == 75) { - SndPlayTileFx(SND_37_BALLOON_SQUEAK, _industry_sound_tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_37_BALLOON_SQUEAK, _industry_sound_tile); } else if (_industry_sound_ctr == 160) { _industry_sound_ctr = 0; - SndPlayTileFx(SND_36_CARTOON_CRASH, _industry_sound_tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_36_CARTOON_CRASH, _industry_sound_tile); } }
--- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -2557,7 +2557,7 @@ case WID_IC_NOTIFY: this->ToggleWidgetLoweredState(WID_IC_NOTIFY); this->SetWidgetDirty(WID_IC_NOTIFY); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); if (this->IsWidgetLowered(WID_IC_NOTIFY)) { if (FindWindowByClass(WC_SMALLMAP) == NULL) ShowSmallMap();
--- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1351,6 +1351,20 @@ STR_CONFIG_SETTING_SOUND_TICKER :News ticker: {STRING2} STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Play sound for summarised news messages +STR_CONFIG_SETTING_SOUND_NEWS :Newspaper: {STRING2} +STR_CONFIG_SETTING_SOUND_NEWS_HELPTEXT :Play sound upon display of newspapers +STR_CONFIG_SETTING_SOUND_NEW_YEAR :End of year: {STRING2} +STR_CONFIG_SETTING_SOUND_NEW_YEAR_HELPTEXT :Play sound effect at the end of a year summarising the company's performance during the year compared to the previous year +STR_CONFIG_SETTING_SOUND_CONFIRM :Construction: {STRING2} +STR_CONFIG_SETTING_SOUND_CONFIRM_HELPTEXT :Play sound effect on successful constructions or other actions +STR_CONFIG_SETTING_SOUND_CLICK :Button clicks: {STRING2} +STR_CONFIG_SETTING_SOUND_CLICK_HELPTEXT :Beep when clicking buttons +STR_CONFIG_SETTING_SOUND_DISASTER :Disasters/accidents: {STRING2} +STR_CONFIG_SETTING_SOUND_DISASTER_HELPTEXT :Play sound effects of accidents and disasters +STR_CONFIG_SETTING_SOUND_VEHICLE :Vehicles: {STRING2} +STR_CONFIG_SETTING_SOUND_VEHICLE_HELPTEXT :Play sound effects of vehicles +STR_CONFIG_SETTING_SOUND_AMBIENT :Ambient: {STRING2} +STR_CONFIG_SETTING_SOUND_AMBIENT_HELPTEXT :Play ambient sound effects of landscape, industries and towns STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING :Disable infrastructure building when no suitable vehicles are available: {STRING2} STR_CONFIG_SETTING_DISABLE_UNSUITABLE_BUILDING_HELPTEXT :When enabled, infrastructure is only available if there are also vehicles available, preventing waste of time and money on unusable infrastructure
--- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -101,7 +101,7 @@ { if (w->IsWidgetDisabled(widget)) return false; - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); w->SetDirty(); if (w->IsWidgetLowered(widget)) { @@ -117,7 +117,7 @@ void CcPlaySound10(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { - if (result.Succeeded()) SndPlayTileFx(SND_12_EXPLOSION, tile); + if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_12_EXPLOSION, tile); } #ifdef ENABLE_NETWORK
--- a/src/newgrf_animation_base.h +++ b/src/newgrf_animation_base.h @@ -85,7 +85,7 @@ /* If the lower 7 bits of the upper byte of the callback * result are not empty, it is a sound effect. */ - if (GB(callback, 8, 7) != 0) PlayTileSound(spec->grf_prop.grffile, GB(callback, 8, 7), tile); + if (GB(callback, 8, 7) != 0 && _settings_client.sound.ambient) PlayTileSound(spec->grf_prop.grffile, GB(callback, 8, 7), tile); } } @@ -134,6 +134,6 @@ /* If the lower 7 bits of the upper byte of the callback * result are not empty, it is a sound effect. */ - if (GB(callback, 8, 7) != 0) PlayTileSound(spec->grf_prop.grffile, GB(callback, 8, 7), tile); + if (GB(callback, 8, 7) != 0 && _settings_client.sound.ambient) PlayTileSound(spec->grf_prop.grffile, GB(callback, 8, 7), tile); } };
--- a/src/newgrf_generic.cpp +++ b/src/newgrf_generic.cpp @@ -254,7 +254,7 @@ /* Only run every 1/200-th time. */ uint32 r; // Save for later - if (!Chance16R(1, 200, r)) return; + if (!Chance16R(1, 200, r) || !_settings_client.sound.ambient) return; /* Prepare resolver object. */ GenericResolverObject object(false, CBID_SOUNDS_AMBIENT_EFFECT);
--- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -18,6 +18,7 @@ #include "sound_func.h" #include "fileio_func.h" #include "debug.h" +#include "settings_type.h" static SmallVector<SoundEntry, 8> _sounds; @@ -167,6 +168,8 @@ */ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event) { + if (!_settings_client.sound.vehicle) return true; + const GRFFile *file = v->GetGRF(); uint16 callback;
--- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -531,7 +531,7 @@ static void ShowNewspaper(const NewsItem *ni) { SoundFx sound = _news_type_data[ni->type].sound; - if (sound != 0) SndPlayFx(sound); + if (sound != 0 && _settings_client.sound.news_full) SndPlayFx(sound); new NewsWindow(GetNewsWindowLayout(ni->flags), ni); }
--- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -842,7 +842,7 @@ CommandCost ret = ValidateAutoDrag(&trackdir, tile, end_tile); if (ret.Failed()) return ret; - if (flags & DC_EXEC) SndPlayTileFx(SND_20_SPLAT_2, tile); + if ((flags & DC_EXEC) && _settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, tile); bool had_success = false; CommandCost last_error = CMD_ERROR;
--- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -85,7 +85,7 @@ void CcPlaySound1E(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { - if (result.Succeeded()) SndPlayTileFx(SND_20_SPLAT_2, tile); + if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, tile); } static void GenericPlaceRail(TileIndex tile, int cmd) @@ -132,7 +132,7 @@ DiagDirection dir = (DiagDirection)p2; - SndPlayTileFx(SND_20_SPLAT_2, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); tile += TileOffsByDiagDir(dir); @@ -170,7 +170,7 @@ { if (result.Failed()) return; - SndPlayTileFx(SND_20_SPLAT_2, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, tile); /* Only close the station builder window if the default station and non persistent building is chosen. */ if (_railstation.station_class == STAT_CLASS_DFLT && _railstation.station_type == 0 && !_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } @@ -271,7 +271,7 @@ void CcBuildRailTunnel(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded()) { - SndPlayTileFx(SND_20_SPLAT_2, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); } else { SetRedErrorSquare(_build_tunnel_endtile); @@ -321,7 +321,7 @@ { if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return; ToggleRailButton_Remove(w); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); /* handle station builder */ if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) { @@ -1162,7 +1162,7 @@ this->RaiseWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X); _railstation.orientation = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X); this->LowerWidget(_railstation.orientation + WID_BRAS_PLATFORM_DIR_X); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1196,7 +1196,7 @@ this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN); this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1231,7 +1231,7 @@ this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN); this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1265,7 +1265,7 @@ this->SetWidgetLoweredState(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN, !_settings_client.gui.station_dragdrop); this->SetWidgetLoweredState(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN, !_settings_client.gui.station_dragdrop); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1277,7 +1277,7 @@ this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage); this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; @@ -1299,7 +1299,7 @@ matrix->SetCount(_railstation.station_count); matrix->SetClicked(_railstation.station_type); } - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1322,7 +1322,7 @@ this->CheckSelectedSize(statspec); this->GetWidget<NWidgetMatrix>(WID_BRAS_MATRIX)->SetClicked(_railstation.station_type); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1653,7 +1653,7 @@ this->RaiseWidget(_build_depot_direction + WID_BRAD_DEPOT_NE); _build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE); this->LowerWidget(_build_depot_direction + WID_BRAD_DEPOT_NE); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; } @@ -1759,7 +1759,7 @@ _cur_waypoint_type = type; this->GetWidget<NWidgetMatrix>(WID_BRW_WAYPOINT_MATRIX)->SetClicked(_cur_waypoint_type); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; }
--- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -1517,7 +1517,7 @@ if (GetFoundationSlope(tile) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile).Succeeded() && Chance16(1, 40)) { StartRoadWorks(tile); - SndPlayTileFx(SND_21_JACKHAMMER, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_21_JACKHAMMER, tile); CreateEffectVehicleAbove( TileX(tile) * TILE_SIZE + 7, TileY(tile) * TILE_SIZE + 7,
--- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -63,7 +63,7 @@ void CcPlaySound1D(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { - if (result.Succeeded()) SndPlayTileFx(SND_1F_SPLAT, tile); + if (result.Succeeded() && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); } /** @@ -93,7 +93,7 @@ void CcBuildRoadTunnel(const CommandCost &result, TileIndex start_tile, uint32 p1, uint32 p2) { if (result.Succeeded()) { - SndPlayTileFx(SND_20_SPLAT_2, start_tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_20_SPLAT_2, start_tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); DiagDirection start_direction = ReverseDiagDir(GetTunnelBridgeDirection(start_tile)); @@ -174,7 +174,7 @@ if (result.Failed()) return; DiagDirection dir = (DiagDirection)GB(p1, 0, 2); - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); ConnectRoadToStructure(tile, dir); } @@ -198,7 +198,7 @@ if (result.Failed()) return; DiagDirection dir = (DiagDirection)GB(p2, 6, 2); - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); TileArea roadstop_area(tile, GB(p1, 0, 8), GB(p1, 8, 8)); TILE_AREA_LOOP(cur_tile, roadstop_area) { @@ -464,7 +464,7 @@ DeleteWindowById(WC_SELECT_STATION, 0); ToggleRoadButton_Remove(this); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; default: NOT_REACHED(); @@ -869,7 +869,7 @@ this->RaiseWidget(_road_depot_orientation + WID_BROD_DEPOT_NE); _road_depot_orientation = (DiagDirection)(widget - WID_BROD_DEPOT_NE); this->LowerWidget(_road_depot_orientation + WID_BROD_DEPOT_NE); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; @@ -998,7 +998,7 @@ this->RaiseWidget(_road_station_picker_orientation + WID_BROS_STATION_NE); _road_station_picker_orientation = (DiagDirection)(widget - WID_BROS_STATION_NE); this->LowerWidget(_road_station_picker_orientation + WID_BROS_STATION_NE); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); DeleteWindowById(WC_SELECT_STATION, 0); break; @@ -1008,7 +1008,7 @@ this->RaiseWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF); _settings_client.gui.station_show_coverage = (widget != WID_BROS_LT_OFF); this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break;
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -548,7 +548,7 @@ ); ModifyStationRatingAround(v->tile, v->owner, -160, 22); - SndPlayVehicleFx(SND_12_EXPLOSION, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); } static bool RoadVehCheckTrainCrash(RoadVehicle *v)
--- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1459,7 +1459,14 @@ static SettingsPage _settings_ui_interaction_page = {_settings_ui_interaction, lengthof(_settings_ui_interaction)}; static SettingEntry _settings_ui_sound[] = { + SettingEntry("sound.click_beep"), + SettingEntry("sound.confirm"), SettingEntry("sound.news_ticker"), + SettingEntry("sound.news_full"), + SettingEntry("sound.new_year"), + SettingEntry("sound.disaster"), + SettingEntry("sound.vehicle"), + SettingEntry("sound.ambient"), }; /** Sound effects sub-page */ static SettingsPage _settings_ui_sound_page = {_settings_ui_sound, lengthof(_settings_ui_sound)};
--- a/src/settings_type.h +++ b/src/settings_type.h @@ -165,6 +165,13 @@ /** Settings related to sound effects. */ struct SoundSettings { bool news_ticker; ///< Play a ticker sound when a news item is published. + bool news_full; ///< Play sound effects associated to certain news types. + bool new_year; ///< Play sound on new year, summarising the performance during the last year. + bool confirm; ///< Play sound effect on succesful constructions or other actions. + bool click_beep; ///< Beep on a random selection of buttons. + bool disaster; ///< Play disaster and accident sounds. + bool vehicle; ///< Play vehicle sound effects. + bool ambient; ///< Play ambient, industry and town sounds. }; /** Settings related to music. */
--- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1343,7 +1343,7 @@ const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP); Point pt = {wid->current_x / 2, wid->current_y / 2}; this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &pt); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; } @@ -1354,13 +1354,13 @@ case WID_SM_VEGETATION: // Show vegetation case WID_SM_OWNERS: // Show land owners this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR)); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_SM_CENTERMAP: // Center the smallmap again this->SmallMapCenterOnCurrentPos(); this->HandleButtonClick(WID_SM_CENTERMAP); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_SM_TOGGLETOWNNAME: // Toggle town names @@ -1368,7 +1368,7 @@ this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns); this->SetDirty(); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); break; case WID_SM_LEGEND: // Legend
--- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -2920,6 +2920,55 @@ str = STR_CONFIG_SETTING_SOUND_TICKER strhelp = STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT +[SDTC_BOOL] +var = sound.news_full +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_NEWS +strhelp = STR_CONFIG_SETTING_SOUND_NEWS_HELPTEXT + +[SDTC_BOOL] +var = sound.new_year +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_NEW_YEAR +strhelp = STR_CONFIG_SETTING_SOUND_NEW_YEAR_HELPTEXT + +[SDTC_BOOL] +var = sound.confirm +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_CONFIRM +strhelp = STR_CONFIG_SETTING_SOUND_CONFIRM_HELPTEXT + +[SDTC_BOOL] +var = sound.click_beep +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_CLICK +strhelp = STR_CONFIG_SETTING_SOUND_CLICK_HELPTEXT + +[SDTC_BOOL] +var = sound.disaster +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_DISASTER +strhelp = STR_CONFIG_SETTING_SOUND_DISASTER_HELPTEXT + +[SDTC_BOOL] +var = sound.vehicle +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_VEHICLE +strhelp = STR_CONFIG_SETTING_SOUND_VEHICLE_HELPTEXT + +[SDTC_BOOL] +var = sound.ambient +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = true +str = STR_CONFIG_SETTING_SOUND_AMBIENT +strhelp = STR_CONFIG_SETTING_SOUND_AMBIENT_HELPTEXT + [SDTC_VAR] var = music.playlist type = SLE_UINT8
--- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -39,7 +39,7 @@ void CcTerraform(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2) { if (result.Succeeded()) { - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); } else { extern TileIndex _terraform_err_tile; SetRedErrorSquare(_terraform_err_tile); @@ -87,7 +87,7 @@ success = true; } - if (success) SndPlayTileFx(SND_1F_SPLAT, end); + if (success && _settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, end); } /** @@ -411,7 +411,7 @@ if (ta.w == 0 || ta.h == 0) return; - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); uint h; if (mode != 0) { @@ -630,7 +630,7 @@ if (!IsInsideMM(size, 1, 8 + 1)) return; _terraform_size = size; - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); this->SetDirty(); break; }
--- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -167,7 +167,7 @@ list->push_back(new DropDownListStringItem(string + i, i, false)); } ShowDropDownList(w, list, 0, widget, 140, true, true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } /** Enum for the Company Toolbar's network related buttons */ @@ -201,7 +201,7 @@ } ShowDropDownList(w, list, _local_company == COMPANY_SPECTATOR ? CTMN_CLIENT_LIST : (int)_local_company, widget, 240, true, true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } @@ -224,7 +224,9 @@ { if (_networking && !_network_server) return CBF_NONE; // only server can pause the game - if (DoCommandP(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, CMD_PAUSE)) SndPlayFx(SND_15_BEEP); + if (DoCommandP(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, CMD_PAUSE)) { + if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); + } return CBF_NONE; } @@ -237,7 +239,7 @@ static CallBackFunction ToolbarFastForwardClick(Window *w) { _fast_forward ^= true; - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -290,7 +292,7 @@ list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS, false, IsTransparencySet(TO_SIGNS))); ShowDropDownList(w, list, 0, WID_TN_SETTINGS, 140, true, true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -753,7 +755,7 @@ { if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) { w->HandleButtonClick((_game_mode == GM_EDITOR) ? (byte)WID_TE_ZOOM_IN : (byte)WID_TN_ZOOM_IN); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } return CBF_NONE; } @@ -764,7 +766,7 @@ { if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) { w->HandleButtonClick((_game_mode == GM_EDITOR) ? (byte)WID_TE_ZOOM_OUT : (byte)WID_TN_ZOOM_OUT); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } return CBF_NONE; } @@ -774,7 +776,7 @@ static CallBackFunction ToolbarBuildRailClick(Window *w) { ShowDropDownList(w, GetRailTypeDropDownList(), _last_built_railtype, WID_TN_RAILS, 140, true, true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -811,7 +813,7 @@ break; } ShowDropDownList(w, list, _last_built_roadtype, WID_TN_ROADS, 140, true, true); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -1059,7 +1061,7 @@ w->ReInit(); w->SetWidgetLoweredState(WID_TN_SWITCH_BAR, _toolbar_mode == TB_LOWER); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return CBF_NONE; } @@ -1107,7 +1109,7 @@ static CallBackFunction ToolbarScenGenLand(Window *w) { w->HandleButtonClick(WID_TE_LAND_GENERATE); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowEditorTerraformToolbar(); return CBF_NONE; @@ -1117,7 +1119,7 @@ static CallBackFunction ToolbarScenGenTown(Window *w) { w->HandleButtonClick(WID_TE_TOWN_GENERATE); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowFoundTownWindow(); return CBF_NONE; } @@ -1125,7 +1127,7 @@ static CallBackFunction ToolbarScenGenIndustry(Window *w) { w->HandleButtonClick(WID_TE_INDUSTRY); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowBuildIndustryWindow(); return CBF_NONE; } @@ -1133,7 +1135,7 @@ static CallBackFunction ToolbarScenBuildRoad(Window *w) { w->HandleButtonClick(WID_TE_ROADS); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowBuildRoadScenToolbar(); return CBF_NONE; } @@ -1141,7 +1143,7 @@ static CallBackFunction ToolbarScenBuildDocks(Window *w) { w->HandleButtonClick(WID_TE_WATER); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowBuildDocksScenToolbar(); return CBF_NONE; } @@ -1149,7 +1151,7 @@ static CallBackFunction ToolbarScenPlantTrees(Window *w) { w->HandleButtonClick(WID_TE_TREES); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); ShowBuildTreesToolbar(); return CBF_NONE; } @@ -1157,7 +1159,7 @@ static CallBackFunction ToolbarScenPlaceSign(Window *w) { w->HandleButtonClick(WID_TE_SIGNS); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); return SelectSignTool(); } @@ -1920,7 +1922,7 @@ if (widget == WID_TE_SMALL_MAP) widget = WID_TN_SMALL_MAP; CallBackFunction cbf = _menu_clicked_procs[widget](index); if (cbf != CBF_NONE) this->last_started_action = cbf; - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); } virtual EventState OnKeyPress(uint16 key, uint16 keycode)
--- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -902,7 +902,7 @@ { if (result.Failed()) return; - SndPlayTileFx(SND_1F_SPLAT, tile); + if (_settings_client.sound.confirm) SndPlayTileFx(SND_1F_SPLAT, tile); if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace(); }
--- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -1660,7 +1660,7 @@ if (new_state != IsCrossingBarred(tile)) { if (new_state && sound) { - SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile); } SetCrossingBarred(tile, new_state); MarkTileDirtyByTile(tile); @@ -1677,7 +1677,7 @@ { if (!IsCrossingBarred(tile)) { BarCrossing(tile); - SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile); + if (_settings_client.sound.ambient) SndPlayTileFx(SND_0E_LEVEL_CROSSING, tile); MarkTileDirtyByTile(tile); } } @@ -3034,7 +3034,7 @@ AddVehicleNewsItem(STR_NEWS_TRAIN_CRASH, NT_ACCIDENT, v->index); ModifyStationRatingAround(v->tile, v->owner, -160, 30); - SndPlayVehicleFx(SND_13_BIG_CRASH, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_13_BIG_CRASH, v); return true; } @@ -3277,7 +3277,7 @@ /* If we are approaching a crossing that is reserved, play the sound now. */ TileIndex crossing = TrainApproachingCrossingTile(v); - if (crossing != INVALID_TILE && HasCrossingReservation(crossing)) SndPlayTileFx(SND_0E_LEVEL_CROSSING, crossing); + if (crossing != INVALID_TILE && HasCrossingReservation(crossing) && _settings_client.sound.new_year) SndPlayTileFx(SND_0E_LEVEL_CROSSING, crossing); /* Always try to extend the reservation when entering a tile. */ CheckNextTrainTile(v);
--- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -13,6 +13,7 @@ #include "window_gui.h" #include "transparency.h" #include "sound_func.h" +#include "settings_type.h" #include "widgets/transparency_widget.h" @@ -76,7 +77,7 @@ } else { /* toggle the bit of the transparencies variable and play a sound */ ToggleTransparency((TransparencyOption)(widget - WID_TT_BEGIN)); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); MarkWholeScreenDirty(); } } else if (widget == WID_TT_BUTTONS) { @@ -90,7 +91,7 @@ if (i == WID_TT_LOADING || i == WID_TT_END) return; ToggleInvisibility((TransparencyOption)(i - WID_TT_BEGIN)); - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP); /* Redraw whole screen only if transparency is set */ if (IsTransparencySet((TransparencyOption)(i - WID_TT_BEGIN))) {
--- a/src/tree_cmd.cpp +++ b/src/tree_cmd.cpp @@ -592,7 +592,7 @@ }; uint32 r = Random(); - if (Chance16I(1, 200, r)) SndPlayTileFx(forest_sounds[GB(r, 16, 2)], tile); + if (Chance16I(1, 200, r) && _settings_client.sound.ambient) SndPlayTileFx(forest_sounds[GB(r, 16, 2)], tile); break; } @@ -621,7 +621,7 @@ } else { if (GetTreeDensity(tile) == 3) { uint32 r = Random(); - if (Chance16I(1, 200, r)) { + if (Chance16I(1, 200, r) && _settings_client.sound.ambient) { SndPlayTileFx((r & 0x80000000) ? SND_39_HEAVY_WIND : SND_34_WIND, tile); } }
--- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -134,7 +134,7 @@ break; case WID_BT_MANY_RANDOM: // place trees randomly over the landscape - SndPlayFx(SND_15_BEEP); + if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP); PlaceTreesRandomly(); MarkWholeScreenDirty(); break;
--- a/src/water_cmd.cpp +++ b/src/water_cmd.cpp @@ -915,7 +915,7 @@ SetDParam(0, pass); AddVehicleNewsItem(STR_NEWS_DISASTER_FLOOD_VEHICLE, NT_ACCIDENT, v->index); CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE); - SndPlayVehicleFx(SND_12_EXPLOSION, v); + if (_settings_client.sound.disaster) SndPlayVehicleFx(SND_12_EXPLOSION, v); } /**