mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 00:55:20 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user