[MIRROR] PDA ringtone QOL (#7331)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
Co-authored-by: Selis <sirlionfur@hotmail.de>
This commit is contained in:
CHOMPStation2
2023-12-04 04:44:10 -07:00
committed by GitHub
parent d84d76e2cf
commit fd2fc75c5a

View File

@@ -22,6 +22,34 @@
S["communicator_visibility"] << pref.communicator_visibility S["communicator_visibility"] << pref.communicator_visibility
S["ttone"] << pref.ringtone // CHOMPEdit - We use ttone in the pref so that it doesnt get reset S["ttone"] << pref.ringtone // CHOMPEdit - We use ttone in the pref so that it doesnt get reset
var/global/list/valid_ringtones = list(
"beep",
"boom",
"slip",
"honk",
"SKREE",
"xeno",
"dust", // CHOMPEdit - Keeps dust as ringtone
"spark",
"rad",
"servo",
// "buh-boop", // CHOMPEdit - No.
"trombone",
"whistle",
"chirp",
"slurp",
"pwing",
"clack",
"bzzt",
"chimes",
"prbt",
"bark",
"bork",
"roark",
"chitter",
"squish"
)
// Moved from /datum/preferences/proc/copy_to() // Moved from /datum/preferences/proc/copy_to()
/datum/category_item/player_setup_item/general/equipment/copy_to_mob(var/mob/living/carbon/human/character) /datum/category_item/player_setup_item/general/equipment/copy_to_mob(var/mob/living/carbon/human/character)
character.all_underwear.Cut() character.all_underwear.Cut()
@@ -151,8 +179,15 @@
pref.communicator_visibility = !pref.communicator_visibility pref.communicator_visibility = !pref.communicator_visibility
return TOPIC_REFRESH return TOPIC_REFRESH
else if(href_list["set_ringtone"]) else if(href_list["set_ringtone"])
if(CanUseTopic(user)) var/choice = tgui_input_list(user, "Please select a ringtone. All of these choices come with an associated preset sound. Alternately, select \"Other\" to specify manually.", "Character Preference", valid_ringtones + "Other", pref.ringtone)
pref.ringtone = sanitize(input(user, "Please enter a new ringtone.", "Character Preference") as null|text, 20) if(!choice || !CanUseTopic(user))
return TOPIC_REFRESH return TOPIC_NOACTION
if(choice == "Other")
var/raw_choice = sanitize(tgui_input_text(user, "Please enter a custom ringtone. If this doesn't match any of the other listed choices, your PDA will use the default (\"beep\") sound.", "Character Preference", null, 20), 20)
if(raw_choice && CanUseTopic(user))
pref.ringtone = raw_choice
else
pref.ringtone = choice
return TOPIC_REFRESH
return ..() return ..()