Skip to content

Commit

Permalink
Adds more skintones and tweaks existing ones. (ParadiseSS13#22765)
Browse files Browse the repository at this point in the history
* skintones babey

* adds a note for anyone adding skintones

* shortens the skin menu

* conflict fix PLEASE. adjusted shading

* Update code/modules/client/preference/link_processing.dm

Co-authored-by: Luc <[email protected]>

* lewcc suggestion

* SQL update script

---------

Co-authored-by: Luc <[email protected]>
  • Loading branch information
SynthTwo and lewcc authored Nov 26, 2023
1 parent dcdd131 commit 8351e03
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 19 deletions.
9 changes: 1 addition & 8 deletions code/modules/client/preference/link_processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -667,14 +667,7 @@
active_character.s_tone = 35 - max(min(round(new_s_tone), 220), 1)
else if(S.bodyflags & HAS_ICON_SKIN_TONE)
var/const/MAX_LINE_ENTRIES = 4
var/prompt = "Choose your character's skin tone: 1-[S.icon_skin_tones.len]\n("
for(var/i = 1 to S.icon_skin_tones.len)
if(i > MAX_LINE_ENTRIES && !((i - 1) % MAX_LINE_ENTRIES))
prompt += "\n"
prompt += "[i] = [S.icon_skin_tones[i]]"
if(i != S.icon_skin_tones.len)
prompt += ", "
prompt += ")"
var/prompt = "Choose your character's skin tone: 1-[length(S.icon_skin_tones)]\n(Light to Dark)"
var/skin_c = input(user, prompt, "Character Preference") as num|null
if(isnum(skin_c))
active_character.s_tone = max(min(round(skin_c), S.icon_skin_tones.len), 1)
Expand Down
37 changes: 26 additions & 11 deletions code/modules/mob/living/carbon/human/species/human_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,20 @@
interests, rampant cyber and bio-augmentation and secretive factions make life on most human \
worlds tumultous at best."

icon_skin_tones = list(
icon_skin_tones = list( //Organized to be from Light to Dark.
1 = "Default White",
2 = "Chestnut",
3 = "Coffee",
2 = "Pale",
3 = "Classic",
4 = "Olive",
5 = "Pale",
5 = "Oliver",
6 = "Beige",
7 = "Classic",
8 = "Oliver"
7 = "Latte",
8 = "Sienna",
9 = "Almond",
10 = "Bronzed",
11 = "Caramel",
12 = "Coffee",
13 = "Chestnut"
)
reagent_tag = PROCESS_ORG

Expand All @@ -32,20 +37,30 @@
if(H.dna.species.bodyflags & HAS_ICON_SKIN_TONE)
var/new_icobase = 'icons/mob/human_races/r_human.dmi' //Default White, counts as 1.
switch(H.s_tone)
if(13)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_chestnut.dmi'
if(12)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_Coffee.dmi'
if(11)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_caramel.dmi'
if(10)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_bronzed.dmi'
if(9)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_almond.dmi'
if(8)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_Oliverandcompany.dmi'
new_icobase = 'icons/mob/human_races/human_skintones/r_human_sienna.dmi'
if(7)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_classic.dmi'
new_icobase = 'icons/mob/human_races/human_skintones/r_human_latte.dmi'
if(6)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_beige.dmi'
if(5)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_pale.dmi'
new_icobase = 'icons/mob/human_races/human_skintones/r_human_Oliverandcompany.dmi'
if(4)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_Olive.dmi'
if(3)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_Coffee.dmi'
new_icobase = 'icons/mob/human_races/human_skintones/r_human_classic.dmi'
if(2)
new_icobase = 'icons/mob/human_races/human_skintones/r_human_chestnut.dmi'
new_icobase = 'icons/mob/human_races/human_skintones/r_human_pale.dmi'

H.change_icobase(new_icobase, owner_sensitive) //Update the icobase of all our organs, but make sure we don't mess with frankenstein limbs in doing so.

Expand Down
Binary file modified icons/mob/human_races/human_skintones/r_human_Coffee.dmi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified icons/mob/human_races/human_skintones/r_human_pale.dmi
Binary file not shown.
Binary file not shown.
26 changes: 26 additions & 0 deletions tools/pr_sql/22765/convert.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
CREATE TEMPORARY TABLE characters_temp (
id INT,
new_skintone INT
) ENGINE=MEMORY;

INSERT INTO characters_temp (id, new_skintone)
SELECT
id,
CASE
WHEN skin_tone = 1 THEN 1
WHEN skin_tone = 2 THEN 13
WHEN skin_tone = 3 THEN 12
WHEN skin_tone = 4 THEN 4
WHEN skin_tone = 5 THEN 2
WHEN skin_tone = 6 THEN 6
WHEN skin_tone = 7 THEN 3
WHEN skin_tone = 8 THEN 5
ELSE 1
END AS st
FROM characters;

UPDATE characters, characters_temp
SET characters.skin_tone = characters_temp.new_skintone
WHERE characters.id = characters_temp.id;

DROP TABLE characters_temp;

0 comments on commit 8351e03

Please sign in to comment.