Skip to content

Commit

Permalink
LOOC sound
Browse files Browse the repository at this point in the history
Adds a new notification sound for LOOC messages.

Similar to the other sounds, this one also has a verb associated for turning it on/off, "Sound-Toggle-LOOC" in the preferences tab
  • Loading branch information
Very-Soft committed Nov 12, 2023
1 parent 627c35c commit 7aba38d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
10 changes: 9 additions & 1 deletion code/modules/client/preference_setup/global/setting_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,14 @@ var/list/_client_preferences_by_type
enabled_description = "On"
disabled_description = "Off"

//RS ADDITION
/datum/client_preference/looc_sounds
description = "LOOC Sound"
key = "LOOC_SOUNDS"
enabled_description = "On"
disabled_description = "Off"
//RS ADDITION END

/datum/client_preference/runechat_mob
description = "Runechat (Mobs)"
key = "RUNECHAT_MOB"
Expand Down Expand Up @@ -373,7 +381,7 @@ var/list/_client_preferences_by_type
key = "RECEIVE_TIPS"
enabled_description = "Enabled"
disabled_description = "Disabled"

/datum/client_preference/pain_frequency
description = "Pain Messages Cooldown"
key = "PAIN_FREQUENCY"
Expand Down
15 changes: 15 additions & 0 deletions code/modules/client/preferences_toggle_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,21 @@

feedback_add_details("admin_verb","TSubtleSounds")

//RS ADDITION
/client/verb/toggle_looc_sounds()
set name = "Sound-Toggle-LOOC"
set category = "Preferences"
set desc = "Toggle hearing a sound when somebody uses LOOC."

var/pref_path = /datum/client_preference/looc_sounds
toggle_preference(pref_path)
SScharacter_setup.queue_preferences_save(prefs)

to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/looc_sounds)) ? "hear" : "not hear"] LOOC sounds.")

feedback_add_details("admin_verb","TLOOCSounds")
//RS ADDITION END

// Not attached to a pref datum because those are strict binary toggles
/client/verb/toggle_examine_mode()
set name = "Toggle Examine Mode"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
admin_stuff += "/([key])"

to_chat(target, "<span class='looc'>" + create_text_tag("looc", "LOOC:", target) + " <EM>[display_name][admin_stuff]:</EM> <span class='message'>[msg]</span></span>")
//RS ADDITION
if(target.is_preference_enabled(/datum/client_preference/looc_sounds))
target << sound('sound/talksounds/looc_sound.ogg', volume = 50)
//RS ADDITION END

for(var/client/target in r_receivers)
var/admin_stuff = "/([key])([admin_jump_link(mob, target.holder)])"
Expand Down
Binary file added sound/talksounds/looc_sound.ogg
Binary file not shown.

0 comments on commit 7aba38d

Please sign in to comment.