[TWEAK] Runechat Color Preference and Species Dependent Organ (runechat) Removal (#26018)

* Reopens runechat color tweak.

Fully changes how the runechat color works with human mobs.

- Ties Runechat color to DNA (unchangable via scramblers, or other methods like DNA modifying)
- Runechat color is now a preference based thing and can be changed at mirrors.

* Linter mint

* Comment for comment's sake + Rerun cerestation CI/UNIT test because mouse ate a cable.

* augh

* reverts toml

* Fixes a SQL query, good for final review.

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Spaghetti-bit
2024-08-06 13:15:47 +00:00
committed by GitHub
co-authored by Burzah
parent aa0f2268a5
commit 52327cea40
21 changed files with 86 additions and 71 deletions
+17 -6
View File
@@ -106,6 +106,8 @@
var/h_grad_alpha = 255
/// Custom emote text ("name" = "emote text")
var/list/custom_emotes = list()
/// Runechat color
var/runechat_color = "#FFFFFF"
// Fuckery to prevent null characters
/datum/character_save/New()
@@ -195,6 +197,7 @@
hair_gradient_colour=:h_grad_colour,
hair_gradient_alpha=:h_grad_alpha,
custom_emotes=:custom_emotes,
runechat_color=:runechat_color,
cyborg_brain_type=:cyborg_brain_type,
body_type=:body_type
WHERE ckey=:ckey
@@ -257,6 +260,7 @@
"h_grad_colour" = h_grad_colour,
"h_grad_alpha" = h_grad_alpha,
"custom_emotes" = json_encode(custom_emotes),
"runechat_color" = runechat_color,
"cyborg_brain_type" = cyborg_brain_type,
"ckey" = C.ckey,
"slot" = slot_number
@@ -298,7 +302,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, 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)
VALUES
(:ckey, :slot, :metadata, :name, :be_random_name, :gender,
:age, :species, :language,
@@ -325,7 +329,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, :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)
"}, list(
// This has too many params for anyone to look at this without going insae
"ckey" = C.ckey,
@@ -387,6 +391,7 @@
"h_grad_colour" = h_grad_colour,
"h_grad_alpha" = h_grad_alpha,
"custom_emotes" = json_encode(custom_emotes),
"runechat_color" = runechat_color,
"cyborg_brain_type" = cyborg_brain_type
))
@@ -477,10 +482,11 @@
h_grad_colour = query.item[53]
h_grad_alpha = query.item[54]
var/custom_emotes_tmp = query.item[55]
physique = query.item[56]
height = query.item[57]
cyborg_brain_type = query.item[58]
body_type = query.item[59]
runechat_color = query.item[56]
physique = query.item[57]
height = query.item[58]
cyborg_brain_type = query.item[59]
body_type = query.item[60]
//Sanitize
var/datum/species/SP = GLOB.all_species[species]
@@ -566,6 +572,7 @@
loadout_gear = sanitize_json(loadout_gear)
custom_emotes_tmp = sanitize_json(custom_emotes_tmp)
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))
if(!player_alt_titles)
player_alt_titles = new()
@@ -1911,6 +1918,10 @@
character.original_eye_color = e_colour
character.dna.flavor_text = flavor_text
// Runechat Color
character.dna.chat_color = runechat_color
character.change_runechat_color(runechat_color)
if(disabilities & DISABILITY_FLAG_FAT)
character.dna.SetSEState(GLOB.fatblock, TRUE, TRUE)
character.overeatduration = 600
@@ -397,6 +397,11 @@
return
active_character.h_grad_alpha = clamp(result, 0, 255)
if("runechat_color")
var/result = input(user, "Choose your character's runechat color:", "Character Preference", active_character.runechat_color) as color|null
if(result)
active_character.runechat_color = result
if("headaccessory")
if(S.bodyflags & HAS_HEAD_ACCESSORY) //Species with head accessories.
var/input = "Choose the colour of your your character's head accessory:"
@@ -206,6 +206,8 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
dat += "<b>Gender:</b> <a href='byond://?_src_=prefs;preference=gender'>[active_character.gender == MALE ? "Male" : (active_character.gender == FEMALE ? "Female" : "Genderless")]</a><br>"
dat += "<b>Body Type:</b> <a href='byond://?_src_=prefs;preference=body_type'>[active_character.body_type == MALE ? "Masculine" : "Feminine"]</a>"
dat += "<br>"
dat += "<b>Runechat Color:</b> "
dat += "<a href='byond://?_src_=prefs;preference=runechat_color;task=input'>Color</a> [color_square(active_character.runechat_color)]<br>"
if(active_character.species == "Vox") // Purge these bastards
dat += "<b>N2 Tank:</b> <a href='byond://?_src_=prefs;preference=speciesprefs;task=input'>[active_character.speciesprefs ? "Large N2 Tank" : "Specialized N2 Tank"]</a><br>"
if(active_character.species == "Plasmaman")
@@ -334,15 +334,15 @@
disable_message = "You will no longer get reverb on some in game sounds."
blackbox_message = "Toggle reverb"
/datum/preference_toggle/toggle_white_runechat
name = "Toggle Runechat Colour Forcing"
description = "Forces your runechat color to white"
preftoggle_bitflag = PREFTOGGLE_2_FORCE_WHITE_RUNECHAT
preftoggle_toggle = PREFTOGGLE_TOGGLE2
preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
enable_message = "Your runechat messages are forced to be white."
disable_message = "Your runechat messages are no longer forced to be white."
blackbox_message = "Toggle runechat color"
// /datum/preference_toggle/toggle_white_runechat
// name = "Toggle Runechat Colour Forcing"
// description = "Forces your runechat color to white"
// preftoggle_bitflag = PREFTOGGLE_2_FORCE_WHITE_RUNECHAT
// preftoggle_toggle = PREFTOGGLE_TOGGLE2
// preftoggle_category = PREFTOGGLE_CATEGORY_GENERAL
// enable_message = "Your runechat messages are forced to be white."
// disable_message = "Your runechat messages are no longer forced to be white."
// blackbox_message = "Toggle runechat color"
/datum/preference_toggle/toggle_simple_stat_panel
name = "Toggle item outlines"