Adds PDA ringtone to character preferences (#27365)

* Adds PDA ringtone to character preferences

* Two fixes

* Reset option

* Contra request

* DB update

* linter fix

* SQL update

* file rename

---------

Signed-off-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Adri
2024-11-30 11:53:19 +01:00
committed by GitHub
parent c21be0b102
commit fca84e2e7e
12 changed files with 56 additions and 30 deletions
@@ -63,7 +63,8 @@
physique,
height,
cyborg_brain_type,
body_type
body_type,
pda_ringtone
FROM characters WHERE ckey=:ckey"}, list(
"ckey" = C.ckey
))
+11 -4
View File
@@ -108,6 +108,8 @@
var/list/custom_emotes = list()
/// Runechat color
var/runechat_color = "#FFFFFF"
/// The ringtone their PDA should start with
var/pda_ringtone
// Fuckery to prevent null characters
/datum/character_save/New()
@@ -199,7 +201,8 @@
custom_emotes=:custom_emotes,
runechat_color=:runechat_color,
cyborg_brain_type=:cyborg_brain_type,
body_type=:body_type
body_type=:body_type,
pda_ringtone=:pda_ringtone
WHERE ckey=:ckey
AND slot=:slot"}, list(
// OH GOD SO MANY PARAMETERS
@@ -262,6 +265,7 @@
"custom_emotes" = json_encode(custom_emotes),
"runechat_color" = runechat_color,
"cyborg_brain_type" = cyborg_brain_type,
"pda_ringtone" = pda_ringtone,
"ckey" = C.ckey,
"slot" = slot_number
))
@@ -302,7 +306,7 @@
player_alt_titles,
disabilities, organ_data, rlimb_data, nanotrasen_relation, physique, height, speciesprefs,
socks, body_accessory, gear, autohiss,
hair_gradient, hair_gradient_offset, hair_gradient_colour, hair_gradient_alpha, custom_emotes, runechat_color, cyborg_brain_type, body_type)
hair_gradient, hair_gradient_offset, hair_gradient_colour, hair_gradient_alpha, custom_emotes, runechat_color, cyborg_brain_type, body_type, pda_ringtone)
VALUES
(:ckey, :slot, :metadata, :name, :be_random_name, :gender,
:age, :species, :language,
@@ -329,7 +333,7 @@
:playertitlelist,
:disabilities, :organ_list, :rlimb_list, :nanotrasen_relation, :physique, :height, :speciesprefs,
:socks, :body_accessory, :gearlist, :autohiss_mode,
:h_grad_style, :h_grad_offset, :h_grad_colour, :h_grad_alpha, :custom_emotes, :runechat_color, :cyborg_brain_type, :body_type)
:h_grad_style, :h_grad_offset, :h_grad_colour, :h_grad_alpha, :custom_emotes, :runechat_color, :cyborg_brain_type, :body_type, :pda_ringtone)
"}, list(
// This has too many params for anyone to look at this without going insae
"ckey" = C.ckey,
@@ -392,7 +396,8 @@
"h_grad_alpha" = h_grad_alpha,
"custom_emotes" = json_encode(custom_emotes),
"runechat_color" = runechat_color,
"cyborg_brain_type" = cyborg_brain_type
"cyborg_brain_type" = cyborg_brain_type,
"pda_ringtone" = pda_ringtone
))
if(!query.warn_execute())
@@ -487,6 +492,7 @@
height = query.item[58]
cyborg_brain_type = query.item[59]
body_type = query.item[60]
pda_ringtone = query.item[61]
//Sanitize
var/datum/species/SP = GLOB.all_species[species]
@@ -574,6 +580,7 @@
custom_emotes = init_custom_emotes(custom_emotes_tmp)
runechat_color = sanitize_hexcolor(runechat_color)
cyborg_brain_type = sanitize_inlist(cyborg_brain_type, GLOB.borg_brain_choices, initial(cyborg_brain_type))
pda_ringtone = sanitize_inlist(pda_ringtone, GLOB.pda_ringtone_choices, initial(pda_ringtone))
if(!player_alt_titles)
player_alt_titles = new()
if(!organ_data)
@@ -853,6 +853,13 @@
if(!(brain_type in GLOB.borg_brain_choices))
return
active_character.cyborg_brain_type = brain_type
if("pda_ringtone")
var/ringtone = tgui_input_list(user, "What type of ringtone would you like to have on your PDA?", "PDA Ringtones", list("Reset Default Ringtone") + GLOB.pda_ringtone_choices, active_character.pda_ringtone)
if(!(ringtone in GLOB.pda_ringtone_choices))
if(ringtone == "Reset Default Ringtone")
active_character.pda_ringtone = null
return
active_character.pda_ringtone = ringtone
if("clientfps")
var/version_message
if(user.client && user.client.byond_version < 511)
@@ -238,6 +238,7 @@ GLOBAL_LIST_INIT(special_role_times, list(
dat += "<b>Physique:</b> <a href='byond://?_src_=prefs;preference=physique;task=input'>[active_character.physique]</a><br>"
dat += "<b>Height:</b> <a href='byond://?_src_=prefs;preference=height;task=input'>[active_character.height]</a><br>"
dat += "<b>Cyborg Brain Type:</b> <a href='byond://?_src_=prefs;preference=cyborg_brain_type;task=input'>[active_character.cyborg_brain_type]</a><br>"
dat += "<b>PDA Ringtone:</b> <a href='byond://?_src_=prefs;preference=pda_ringtone;task=input'>[active_character.pda_ringtone]</a><br>"
dat += "<a href='byond://?_src_=prefs;preference=flavor_text;task=input'>Set Flavor Text</a><br>"
if(length(active_character.flavor_text) <= 40)
if(!length(active_character.flavor_text))
+2 -22
View File
@@ -36,26 +36,6 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mimeamt = 0 //How many silence left when infected with mime.exe
var/detonate = TRUE // Can the PDA be blown up?
var/ttone = "beep" //The ringtone!
var/list/ttone_sound = list("beep" = 'sound/machines/twobeep.ogg',
"boop" = 'sound/machines/boop.ogg',
"electronic" = 'sound/machines/notif1.ogg',
"chime" = 'sound/machines/notif2.ogg',
"slip" = 'sound/misc/slip.ogg',
"honk" = 'sound/items/bikehorn.ogg',
"SKREE" = 'sound/voice/shriek1.ogg',
"holy" = 'sound/items/PDA/ambicha4-short.ogg',
"boom" = 'sound/effects/explosionfar.ogg',
"gavel" = 'sound/items/gavel.ogg',
"xeno" = 'sound/voice/hiss1.ogg',
"smoke" = 'sound/magic/smoke.ogg',
"shatter" = 'sound/effects/pylon_shatter.ogg',
"energy" = 'sound/weapons/egloves.ogg',
"flare" = 'sound/goonstation/misc/matchstick_light.ogg',
"interference" = 'sound/misc/interference.ogg',
"zap" = 'sound/effects/eleczap.ogg',
"disgusting" = 'sound/effects/blobattack.ogg',
"hungry" = 'sound/weapons/bite.ogg')
var/list/programs = list(
new/datum/data/pda/app/main_menu,
new/datum/data/pda/app/notekeeper,
@@ -377,8 +357,8 @@ GLOBAL_LIST_EMPTY(PDAs)
if(HAS_TRAIT(SSstation, STATION_TRAIT_PDA_GLITCHED))
playsound(src, pick('sound/machines/twobeep_voice1.ogg', 'sound/machines/twobeep_voice2.ogg'), 50, TRUE)
else
if(ttone in ttone_sound)
S = ttone_sound[ttone]
if(ttone in GLOB.pda_ringtone_choices)
S = GLOB.pda_ringtone_choices[ttone]
else
S = 'sound/machines/twobeep_high.ogg'
playsound(loc, S, 50, TRUE)
+1 -1
View File
@@ -59,7 +59,7 @@
data["charges"] = pda.cartridge.charges ? pda.cartridge.charges : 0
data["ringtone"] = pda.ttone
data["ringtone_list"] = pda.ttone_sound
data["ringtone_list"] = GLOB.pda_ringtone_choices
/datum/data/pda/app/messenger/ui_act(action, list/params)
if(..())