diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 44d4a1cb307..4d3e651c4d5 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -83,8 +83,9 @@ Will print: "/mob/living/carbon/human/death" (you can optionally embed it in a s #define ASFX_FOOTSTEPS 2 #define ASFX_VOTE 4 #define ASFX_VOX 8 +#define ASFX_DROPSOUND 16 -#define ASFX_DEFAULT (ASFX_AMBIENCE|ASFX_FOOTSTEPS|ASFX_VOTE|ASFX_VOX) +#define ASFX_DEFAULT (ASFX_AMBIENCE|ASFX_FOOTSTEPS|ASFX_VOTE|ASFX_VOX|ASFX_DROPSOUND) // For secHUDs and medHUDs and variants. The number is the location of the image on the list hud_list of humans. #define HEALTH_HUD 1 // A simple line rounding the mob's number health. diff --git a/code/_helpers/mobs.dm b/code/_helpers/mobs.dm index 958e21d2a82..89caeaf9c5e 100644 --- a/code/_helpers/mobs.dm +++ b/code/_helpers/mobs.dm @@ -212,5 +212,4 @@ Proc for attack log creation, because really why not // Returns true if the mob was removed form the dead list /mob/proc/remove_from_dead_mob_list() - return dead_mob_list.Remove(src) - + return dead_mob_list.Remove(src) \ No newline at end of file diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 2b1342e138b..b7e588c0881 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -245,7 +245,7 @@ /obj/item/throw_impact(atom/hit_atom) ..() if(drop_sound) - playsound(src, drop_sound, 50, 0) + playsound(src, drop_sound, 50, 0, required_asfx_toggles = ASFX_DROPSOUND) //Apparently called whenever an item is dropped on the floor, thrown, or placed into a container. //It is called after loc is set, so if placed in a container its loc will be that container. diff --git a/code/game/sound.dm b/code/game/sound.dm index 12d691bf781..d11bf2307ed 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -168,7 +168,7 @@ var/list/footstepfx = list("defaultstep","concretestep","grassstep","dirtstep"," //var/list/gun_sound = list('sound/weapons/gunshot/gunshot1.ogg', 'sound/weapons/gunshot/gunshot2.ogg','sound/weapons/gunshot/gunshot3.ogg','sound/weapons/gunshot/gunshot4.ogg') -/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, is_global, usepressure = 1, environment = -1, is_ambience = FALSE, is_footstep = FALSE) +/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, is_global, usepressure = 1, environment = -1, required_preferences = 0, required_asfx_toggles = 0) if (istext(soundin)) soundin = get_sfx(soundin) // same sound for everyone else if (isarea(source)) @@ -194,10 +194,10 @@ var/list/footstepfx = list("defaultstep","concretestep","grassstep","dirtstep"," if (!T || T.z != turf_source.z) continue - if (is_ambience && !(M.client.prefs.toggles & SOUND_AMBIENCE)) + if (required_preferences && (M.client.prefs.toggles & required_preferences) != required_preferences) continue - if (is_footstep && !(M.client.prefs.asfx_togs & ASFX_FOOTSTEPS)) + if (required_asfx_toggles && (M.client.prefs.asfx_togs & required_asfx_toggles) != required_asfx_toggles) continue M.playsound_local(turf_source, soundin, vol, vary, frequency, falloff, is_global, usepressure, environment, S) diff --git a/code/modules/client/preferences_ambience.dm b/code/modules/client/preferences_ambience.dm index c827e091601..af6fbfc270c 100644 --- a/code/modules/client/preferences_ambience.dm +++ b/code/modules/client/preferences_ambience.dm @@ -2,7 +2,8 @@ // /client/proc/Toggle_asfx, // /client/proc/Toggle_footsteps, /client/proc/Toggle_asfx_vote, - /client/proc/toggle_vox_voice + /client/proc/toggle_vox_voice, + /client/proc/Toggle_dropsounds ) /client/verb/asf_toggle() @@ -61,3 +62,15 @@ prefs.asfx_togs ^= ASFX_VOX prefs.save_preferences() to_chat(src, "You will [(prefs.asfx_togs & ASFX_VOX) ? "now" : "no longer"] hear the VOX voice.") + +/client/proc/Toggle_dropsounds() + set name = "Hear/Silence Drop Sounds" + set category = "SoundFx Prefs" + set desc = "Toggles hearing dropping and throwing sound effects" + + prefs.asfx_togs ^= ASFX_DROPSOUND + prefs.save_preferences() + if(prefs.asfx_togs & ASFX_DROPSOUND) + to_chat(src, "You will now hear dropping and throwing sounds.") + else + to_chat(src, "You will no longer hear dropping and throwing sounds.") \ No newline at end of file diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 58025fa5421..8349b4746a5 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -224,4 +224,4 @@ prefs.toggles_secondary ^= SAFETY_CHECK //Held in Parallax because we don't want to deal with an SQL migration right now. prefs.save_preferences() - to_chat(src, "You will [(prefs.toggles_secondary & SAFETY_CHECK) ? "no longer" : "now"] fire your weapon on intents other than harm.") + to_chat(src, "You will [(prefs.toggles_secondary & SAFETY_CHECK) ? "no longer" : "now"] fire your weapon on intents other than harm.") \ No newline at end of file diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index d2ceae8f770..77edea4b104 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -200,11 +200,11 @@ var/list/slot_equipment_priority = list( \ addtimer(CALLBACK(src, .proc/make_item_drop_sound, item_dropped), 1) /mob/proc/make_item_drop_sound(obj/item/I) - if(QDELETED(I)) - return + if(QDELETED(I)) + return - if(I.drop_sound) - playsound(I, I.drop_sound, 25, 0) + if(I.drop_sound) + playsound(I, I.drop_sound, 25, 0, required_asfx_toggles = ASFX_DROPSOUND) /* Removes the object from any slots the mob might have, calling the appropriate icon update proc. diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index a1bccadb758..8f78f00fd62 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -139,11 +139,11 @@ last_x = x last_y = y if (m_intent == "run") - playsound(src, T.footstep_sound, 70, 1, is_footstep = TRUE) + playsound(src, T.footstep_sound, 70, 1, required_asfx_toggles = ASFX_FOOTSTEPS) else footstep++ if (footstep % 2) - playsound(src, T.footstep_sound, 40, 1, is_footstep = TRUE) + playsound(src, T.footstep_sound, 40, 1, required_asfx_toggles = ASFX_FOOTSTEPS) /mob/living/carbon/human/mob_has_gravity() . = ..() diff --git a/code/modules/modular_computers/computers/modular_computer/core.dm b/code/modules/modular_computers/computers/modular_computer/core.dm index da293ddcf3c..18f81b3b952 100644 --- a/code/modules/modular_computers/computers/modular_computer/core.dm +++ b/code/modules/modular_computers/computers/modular_computer/core.dm @@ -35,7 +35,7 @@ check_update_ui_need() if (working && enabled && world.time > ambience_last_played + 30 SECONDS && prob(3)) - playsound(loc, "computerbeep", 30, 1, 10, is_ambience = TRUE) + playsound(loc, "computerbeep", 30, 1, 10, required_preferences = SOUND_AMBIENCE) ambience_last_played = world.time /obj/item/modular_computer/proc/get_preset_programs(var/app_preset_name) @@ -97,7 +97,7 @@ holographic_overlay(src, src.icon, icon_state_screensaver) else add_overlay(icon_state_screensaver) - + if (screensaver_light_range && working) set_light(screensaver_light_range, 1, screensaver_light_color ? screensaver_light_color : "#FFFFFF") else diff --git a/html/changelogs/quietyourthrows.yml b/html/changelogs/quietyourthrows.yml new file mode 100644 index 00000000000..e5b45a72bf7 --- /dev/null +++ b/html/changelogs/quietyourthrows.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Conspiir + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "Added the ability to toggle drop/throw sounds. It is under the ASFX tab."