From 3b3a4ae19fdb19f995cb0eae01466002ba865a1c Mon Sep 17 00:00:00 2001 From: Verkister Date: Sat, 7 Jul 2018 10:46:18 +0300 Subject: [PATCH] Adds an option to enable/disable markings on synth parts. -In char setup near the synth color option. -Tested working although the preview icon may misbehave with the icon cache. (Meaning the effect will require refreshing the cached icon with a visual change, such as color, markings, limb status change, etc. to show up, and may not show up at all if the appearance is identical to an earlier one already saved to cache and getting loaded from there instead of refreshing.) --- code/modules/client/preference_setup/general/03_body.dm | 8 ++++++++ code/modules/client/preferences.dm | 1 + code/modules/mob/living/carbon/human/human_defines.dm | 1 + code/modules/organs/organ_icon.dm | 8 ++++++++ 4 files changed, 18 insertions(+) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 1fc3b1d8ba..c3d607d490 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -36,6 +36,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["synth_red"] >> pref.r_synth S["synth_green"] >> pref.g_synth S["synth_blue"] >> pref.b_synth + S["synth_markings"] >> pref.synth_markings pref.preview_icon = null S["bgstate"] >> pref.bgstate @@ -65,6 +66,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O S["synth_red"] << pref.r_synth S["synth_green"] << pref.g_synth S["synth_blue"] << pref.b_synth + S["synth_markings"] << pref.synth_markings S["bgstate"] << pref.bgstate /datum/category_item/player_setup_item/general/body/sanitize_character(var/savefile/S) @@ -120,6 +122,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O character.r_synth = pref.r_synth character.g_synth = pref.g_synth character.b_synth = pref.b_synth + character.synth_markings = pref.synth_markings // Destroy/cyborgize organs and limbs. for(var/name in list(BP_HEAD, BP_L_HAND, BP_R_HAND, BP_L_ARM, BP_R_ARM, BP_L_FOOT, BP_R_FOOT, BP_L_LEG, BP_R_LEG, BP_GROIN, BP_TORSO)) @@ -305,6 +308,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O . += "
" . += "
" + . += "Allow Synth markings: [pref.synth_markings ? "Yes" : "No"]
" . += "Allow Synth color: [pref.synth_color ? "Yes" : "No"]
" if(pref.synth_color) . += "Change Color
__
" @@ -702,6 +706,10 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O pref.b_synth = hex2num(copytext(new_color, 6, 8)) return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["synth_markings"]) + pref.synth_markings = !pref.synth_markings + return TOPIC_REFRESH_UPDATE_PREVIEW + else if(href_list["cycle_bg"]) pref.bgstate = next_in_list(pref.bgstate, pref.bgstate_options) return TOPIC_REFRESH_UPDATE_PREVIEW diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c45567e5a9..dee21ddd5b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -60,6 +60,7 @@ datum/preferences var/r_synth //Used with synth_color to color synth parts that normaly can't be colored. var/g_synth //Same as above var/b_synth //Same as above + var/synth_markings = 0 //Enable/disable markings on synth parts. //Some faction information. var/home_system = "Unset" //System of birth. diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 244c22e80b..2cbd93260c 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -30,6 +30,7 @@ var/r_synth //Used with synth_color to color synth parts that normaly can't be colored. var/g_synth //Same as above var/b_synth //Same as above + var/synth_markings = 0 //Enables/disables markings on synth parts. var/damage_multiplier = 1 //multiplies melee combat damage var/icon_update = 1 //whether icon updating shall take place diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 1f5f583324..91b96fea31 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -179,6 +179,14 @@ var/global/list/limb_icon_cache = list() if(model) icon_cache_key += "_model_[model]" apply_colouration(mob_icon) + if(owner && owner.synth_markings) + for(var/M in markings) + var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"] + var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]") + mark_s.Blend(markings[M]["color"], ICON_ADD) + add_overlay(mark_s) //So when it's not on your body, it has icons + mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons + icon_cache_key += "[M][markings[M]["color"]]" dir = EAST icon = mob_icon