Ports Ambience Subsystem (#15613)

* Ports Ambience Subsystem

* re-include
This commit is contained in:
Fox McCloud
2021-02-27 11:41:30 +00:00
committed by GitHub
parent 9b81728cc4
commit e5446277e1
9 changed files with 62 additions and 18 deletions
+2 -2
View File
@@ -30,8 +30,8 @@
///////////////
//SOUND STUFF//
///////////////
var/ambience_playing = 0
var/played = 0
var/ambience_playing = FALSE
////////////
//SECURITY//
+10
View File
@@ -368,6 +368,8 @@
if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them.
to_chat(src, "<span class='warning'>Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.</span>")
update_ambience_pref()
//This is down here because of the browse() calls in tooltip/New()
if(!tooltips)
tooltips = new /datum/tooltip(src)
@@ -422,6 +424,7 @@
if(movingmob)
movingmob.client_mobs_in_contents -= mob
UNSETEMPTY(movingmob.client_mobs_in_contents)
SSambience.ambience_listening_clients -= src
Master.UpdateTickRate()
..() //Even though we're going to be hard deleted there are still some things that want to know the destroy is happening
return QDEL_HINT_HARDDEL_NOW
@@ -1218,6 +1221,13 @@
if(show_warning)
message_admins("<font color='red'>[ckey] has just connected and has a history of [cidcount] different CIDs.</font> (<a href='?_src_=holder;webtools=[ckey]'>WebInfo</a>) (<a href='?_src_=holder;suppresscidwarning=[ckey]'>Suppress Warning</a>)")
/client/proc/update_ambience_pref()
if(prefs.sound & SOUND_AMBIENCE)
if(SSambience.ambience_listening_clients[src] > world.time)
return // If already properly set we don't want to reset the timer.
SSambience.ambience_listening_clients[src] = world.time + 10 SECONDS //Just wait 10 seconds before the next one aight mate? cheers.
else
SSambience.ambience_listening_clients -= src
#undef LIMITER_SIZE
#undef CURRENT_SECOND
@@ -179,6 +179,7 @@
else
to_chat(src, "You will no longer hear ambient sounds.")
usr.stop_sound_channel(CHANNEL_AMBIENCE)
update_ambience_pref()
SSblackbox.record_feedback("tally", "toggle_verbs", 1, "Toggle Ambience") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/Toggle_Buzz() //No more headaches because headphones bump up shipambience.ogg to insanity levels.