PDA Ringtone Preference (#70485)

* Creates some new defines for constant values in the Messenger app
* Created a new type of preference, text preferences, with a FeatureShortTextInput TGUI component
* Uses said new preference to re-add a PDA ringtone preference.
This commit is contained in:
GoldenAlpharex
2022-10-16 17:33:40 -04:00
committed by GitHub
parent 6ce946a056
commit e613c875b7
9 changed files with 139 additions and 25 deletions
@@ -146,6 +146,32 @@
explosion(src, devastation_range = -1, heavy_impact_range = -1, light_impact_range = 2, flash_range = 3)
qdel(src)
/**
* A simple helper proc that applies the client's ringtone prefs to the tablet's messenger app,
* if it has one.
*
* Arguments:
* * ringtone_client - The client whose prefs we'll use to set the ringtone of this PDA.
*/
/obj/item/modular_computer/tablet/proc/update_ringtone(client/ringtone_client)
if(!ringtone_client)
return
var/new_ringtone = ringtone_client?.prefs?.read_preference(/datum/preference/text/pda_ringtone)
if(!new_ringtone || new_ringtone == MESSENGER_RINGTONE_DEFAULT)
return
var/obj/item/computer_hardware/hard_drive/drive = all_components[MC_HDD]
if(!drive)
return
for(var/datum/computer_file/program/messenger/messenger_app in drive.stored_files)
messenger_app.ringtone = new_ringtone
// SUBTYPES
/obj/item/modular_computer/tablet/syndicate_contract_uplink