[MIRROR] Revert "Revert "/tg/ preference datums part 1: take two"" (#8929)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2
2024-09-14 03:30:15 -07:00
committed by GitHub
parent a8318eb241
commit 2986497a43
204 changed files with 5174 additions and 2371 deletions

View File

@@ -51,7 +51,7 @@
for(var/mob/target in players)
to_chat(target, finalized_announcement)
//if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
if(play_sound && target.client?.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
SEND_SOUND(target, sound(sound_override))
else
to_chat(world, finalized_announcement)
@@ -61,7 +61,7 @@
for(var/mob/player in player_list)
//if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
if(player.client?.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
if(player.client?.prefs.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
SEND_SOUND(player, sound(sound_override))
/**

View File

@@ -89,5 +89,5 @@
if(!has_gravity(source) && prob(75))
return
playsound(source.loc, S, volume, FALSE, preference = /datum/client_preference/digestion_noises)
playsound(source.loc, S, volume, FALSE, preference = /datum/preference/toggle/digestion_noises)
return

View File

@@ -22,7 +22,7 @@
for(var/mob/M in hearers)
runechat_enabled = M.client?.is_preference_enabled(/datum/client_preference/runechat_mob)
runechat_enabled = M.client.prefs?.read_preference(/datum/preference/toggle/runechat_mob)
if(M.client && !runechat_enabled)
continue

View File

@@ -1,11 +0,0 @@
/datum/client_preference/random_emote_pitch
description ="Random emote pitch"
key = "EMOTE_VARY"
enabled_description = "Will be Random"
disabled_description = "Will not be Random"
/datum/client_preference/autotranscore
description = "Automatic Transcore Notification"
key = "AUTOTRANSCORE"
enabled_description = "Automatic notification"
disabled_description = "No automatic notification"

View File

@@ -8,36 +8,6 @@
var/job_other_med = 0
var/job_other_high = 0
/client/verb/toggle_random_emote_pitch()
set name = "Toggle Random Emote Pitch"
set category = "Preferences.Character"
set desc = "Toggles whether or not emotes with sound you make will have random pitch."
var/pref_path = /datum/client_preference/random_emote_pitch
toggle_preference(pref_path)
to_chat(src, "Audible emotes you make will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] have a random pitch applied to them.")
SScharacter_setup.queue_preferences_save(prefs)
feedback_add_details("admin_verb","TRandomEmotePitch") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/verb/toggle_autotranscore()
set name = "Toggle Automatic Transcore Notification"
set category = "Preferences.Character"
set desc = "Toggles whether or not your death with a backup implant will automatically trigger a transcore notification after a few minutes."
var/pref_path = /datum/client_preference/autotranscore
toggle_preference(pref_path)
to_chat(src, "Your death with a backup implant will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] trigger an automatic transcore notification.")
SScharacter_setup.queue_preferences_save(prefs)
feedback_add_details("admin_verb","TAutoTranscore") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/preferences/proc/vanity_copy_to(var/mob/living/carbon/human/character, var/copy_name, var/copy_flavour = TRUE, var/copy_ooc_notes = FALSE, var/convert_to_prosthetics = FALSE)
//snowflake copy_to, does not copy anything but the vanity things
//does not check if the name is the same, do that in any proc that calls this proc

View File

@@ -0,0 +1,9 @@
/datum/preference/toggle/random_emote_pitch
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "EMOTE_VARY"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/autotranscore
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "AUTOTRANSCORE"
savefile_identifier = PREFERENCE_PLAYER

View File

@@ -0,0 +1,14 @@
/datum/preference/toggle/looping_alarms
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "SOUND_ALARMLOOP"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/fridge_hum
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "SOUND_FRIDGEHUM"
savefile_identifier = PREFERENCE_PLAYER
/datum/preference/toggle/sleep_music
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "SLEEP_MUSIC"
savefile_identifier = PREFERENCE_PLAYER

View File

@@ -375,15 +375,15 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
if(level == 1)
for (var/client/C in GLOB.mentors)
if (C.is_preference_enabled(/datum/client_preference/play_mentorhelp_ping))
if (C.prefs?.read_preference(/datum/preference/toggle/play_mentorhelp_ping))
C << 'sound/effects/mentorhelp.mp3'
for (var/client/C in GLOB.admins)
if (C.is_preference_enabled(/datum/client_preference/play_mentorhelp_ping))
if (C.prefs?.read_preference(/datum/preference/toggle/play_mentorhelp_ping))
C << 'sound/effects/mentorhelp.mp3'
message_mentors(chat_msg)
else if(level == 0)
for(var/client/X in GLOB.admins)
if(X.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
if(X.prefs?.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
X << 'sound/effects/adminhelp.ogg'
window_flash(X)
to_chat(X, chat_msg)
@@ -515,7 +515,7 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
return
if(initiator)
if(initiator.is_preference_enabled(/datum/client_preference/holder/play_adminhelp_ping))
if(initiator.prefs?.read_preference(/datum/preference/toggle/holder/play_adminhelp_ping))
initiator << 'sound/effects/adminhelp.ogg'
to_chat(initiator, "<span class='filter_pm'>[span_red("<font size='4'><b>- AdminHelp Rejected! -</b></font>")]<br>\