diff --git a/SQL/paradise_schema.sql b/SQL/paradise_schema.sql index cba1286a306c3..e41d1abbf6378 100644 --- a/SQL/paradise_schema.sql +++ b/SQL/paradise_schema.sql @@ -82,6 +82,7 @@ CREATE TABLE `characters` ( `custom_emotes` LONGTEXT COLLATE 'utf8mb4_unicode_ci' DEFAULT NULL, `runechat_color` VARCHAR(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#FFFFFF', `cyborg_brain_type` ENUM('MMI', 'Robobrain', 'Positronic') NOT NULL DEFAULT 'MMI', + `pda_ringtone` VARCHAR(16) NULL DEFAULT NULL COLLATE 'utf8mb3_general_ci', PRIMARY KEY (`id`), KEY `ckey` (`ckey`) ) ENGINE=InnoDB AUTO_INCREMENT=125467 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; diff --git a/SQL/updates/62-63.sql b/SQL/updates/62-63.sql new file mode 100644 index 0000000000000..83bcf50f3f038 --- /dev/null +++ b/SQL/updates/62-63.sql @@ -0,0 +1,5 @@ +# Updates the DB from 62 to 63 +# Adds a PDA ringtone option to character setup + +ALTER TABLE `characters` + ADD COLUMN `pda_ringtone` VARCHAR(16) NULL DEFAULT NULL AFTER `cyborg_brain_type`; diff --git a/code/__DEFINES/misc_defines.dm b/code/__DEFINES/misc_defines.dm index 82768148560af..586eeabe3e9ad 100644 --- a/code/__DEFINES/misc_defines.dm +++ b/code/__DEFINES/misc_defines.dm @@ -424,7 +424,7 @@ #define INVESTIGATE_HOTMIC "hotmic" // The SQL version required by this version of the code -#define SQL_VERSION 62 +#define SQL_VERSION 63 // Vending machine stuff #define CAT_NORMAL (1<<0) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 5d588c4793bdb..71b013826a794 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -68,3 +68,25 @@ GLOBAL_LIST_INIT(backbaglist, list(DBACKPACK, DSATCHEL, DDUFFLEBAG, GBACKPACK, G #define POSITRONIC_BORG "Positronic" GLOBAL_LIST_INIT(borg_brain_choices, list(MMI_BORG, ROBOBRAIN_BORG, POSITRONIC_BORG)) GLOBAL_PROTECT(borg_brain_choices) + +//Chooseable ringtones +//Due to database reasons, the name should be 16 characters long maximum +GLOBAL_LIST_INIT(pda_ringtone_choices, 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')) diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 85defcc14f326..4b4708b1a97e8 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -281,6 +281,8 @@ PDA.ownjob = C.assignment PDA.ownrank = C.rank PDA.name = "PDA-[H.real_name] ([PDA.ownjob])" + if(H.client?.prefs.active_character.pda_ringtone) + PDA.ttone = H.client.prefs.active_character.pda_ringtone /datum/outfit/job/on_mind_initialize(mob/living/carbon/human/H) . = ..() diff --git a/code/modules/client/login_processing/20-load_characters.dm b/code/modules/client/login_processing/20-load_characters.dm index 7467e76f8e059..641f4c6826077 100644 --- a/code/modules/client/login_processing/20-load_characters.dm +++ b/code/modules/client/login_processing/20-load_characters.dm @@ -63,7 +63,8 @@ physique, height, cyborg_brain_type, - body_type + body_type, + pda_ringtone FROM characters WHERE ckey=:ckey"}, list( "ckey" = C.ckey )) diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm index da5520d2f6f40..7ce7b4501e690 100644 --- a/code/modules/client/preference/character.dm +++ b/code/modules/client/preference/character.dm @@ -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) diff --git a/code/modules/client/preference/link_processing.dm b/code/modules/client/preference/link_processing.dm index 45f8843879356..a67e3da4baf64 100644 --- a/code/modules/client/preference/link_processing.dm +++ b/code/modules/client/preference/link_processing.dm @@ -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) diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm index 0ac3432dd24ed..e862a08a28119 100644 --- a/code/modules/client/preference/preferences.dm +++ b/code/modules/client/preference/preferences.dm @@ -238,6 +238,7 @@ GLOBAL_LIST_INIT(special_role_times, list( dat += "Physique: [active_character.physique]
" dat += "Height: [active_character.height]
" dat += "Cyborg Brain Type: [active_character.cyborg_brain_type]
" + dat += "PDA Ringtone: [active_character.pda_ringtone]
" dat += "Set Flavor Text
" if(length(active_character.flavor_text) <= 40) if(!length(active_character.flavor_text)) diff --git a/code/modules/pda/PDA.dm b/code/modules/pda/PDA.dm index feaeb7920377c..e3f2c06cb397f 100644 --- a/code/modules/pda/PDA.dm +++ b/code/modules/pda/PDA.dm @@ -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) diff --git a/code/modules/pda/messenger.dm b/code/modules/pda/messenger.dm index 5057c5ef83848..8f4ff21512033 100644 --- a/code/modules/pda/messenger.dm +++ b/code/modules/pda/messenger.dm @@ -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(..()) diff --git a/config/example/config.toml b/config/example/config.toml index 52c60b28f8cbe..8c92505508815 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -181,7 +181,7 @@ ipc_screens = [ # Enable/disable the database on a whole sql_enabled = false # SQL version. If this is a mismatch, round start will be delayed -sql_version = 62 +sql_version = 63 # SQL server address. Can be an IP or DNS name sql_address = "127.0.0.1" # SQL server port