This commit is contained in:
Timothy Teakettle
2021-05-02 22:19:41 +01:00
parent 2daed9250f
commit d32770a0fa
4 changed files with 38 additions and 18 deletions
+1 -1
View File
@@ -2471,7 +2471,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(index && marking_type && features[marking_type])
// work out the input options to show the user
var/list/options = list("Primary")
var/number_colors = href_list["number_colors"]
var/number_colors = text2num(href_list["number_colors"])
var/color_number = 1 // 1-3 which color are we editing
if(number_colors >= 2)
options += "Secondary"
+25 -5
View File
@@ -5,7 +5,7 @@
// You do not need to raise this if you are adding new values that have sane defaults.
// Only raise this value when changing the meaning/format/name/layout of an existing value
// where you would want the updater procs below to run
#define SAVEFILE_VERSION_MAX 50
#define SAVEFILE_VERSION_MAX 51
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -295,6 +295,27 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
L -= ROLE_SYNDICATE
S["be_special"] << L
if(current_version < 51) // rp markings means markings are now stored as a list
var/marking_type
var/species_id = S["species"]
var/datum/species/actual_species = GLOB.species_datums[species_id]
if(actual_species.mutant_bodyparts["body_markings"] && S["feature_lizard_body_markings"]) marking_type = "feature_lizard_body_markings"
if(actual_species.mutant_bodyparts["mam_body_markings"] && S["feature_mam_body_markings"]) marking_type = "feature_mam_body_markings"
if(marking_type)
var/old_marking_value = S[marking_type]
var/list/color_list = list("#FFFFFF","#FFFFFF","#FFFFFF")
if(S["feature_mcolor"]) color_list[1] = S["feature_mcolor"]
if(S["feature_mcolor2"]) color_list[2] = S["feature_mcolor2"]
if(S["feature_mcolor3"]) color_list[3] = S["feature_mcolor3"]
var/marking_list = list()
for(var/part in list(ARM_LEFT, ARM_RIGHT, LEG_LEFT, LEG_RIGHT, CHEST, HEAD))
marking_list += list(list(part, old_marking_value, color_list.Copy()))
S[marking_type] = safe_json_encode(marking_list)
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
if(!ckey)
return
@@ -638,7 +659,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["feature_lizard_horns"] >> features["horns"]
S["feature_lizard_frills"] >> features["frills"]
S["feature_lizard_spines"] >> features["spines"]
S["feature_lizard_body_markings"] >> features["body_markings"]
features["body_markings"] = safe_json_decode(S["feature_lizard_body_markings"])
S["feature_lizard_legs"] >> features["legs"]
S["feature_human_tail"] >> features["tail_human"]
S["feature_human_ears"] >> features["ears"]
@@ -707,7 +728,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["feature_genitals_use_skintone"] >> features["genitals_use_skintone"]
S["feature_mcolor2"] >> features["mcolor2"]
S["feature_mcolor3"] >> features["mcolor3"]
S["feature_mam_body_markings"] >> features["mam_body_markings"]
features["mam_body_markings"] = safe_json_decode(S["feature_mam_body_markings"])
S["feature_mam_tail"] >> features["mam_tail"]
S["feature_mam_ears"] >> features["mam_ears"]
S["feature_mam_tail_animated"] >> features["mam_tail_animated"]
@@ -837,7 +858,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
features["ears"] = sanitize_inlist(features["ears"], GLOB.ears_list)
features["frills"] = sanitize_inlist(features["frills"], GLOB.frills_list)
features["spines"] = sanitize_inlist(features["spines"], GLOB.spines_list)
features["body_markings"] = sanitize_inlist(features["body_markings"], GLOB.body_markings_list)
features["legs"] = sanitize_inlist(features["legs"], GLOB.legs_list, "Plantigrade")
features["deco_wings"] = sanitize_inlist(features["deco_wings"], GLOB.deco_wings_list, "None")
features["insect_fluff"] = sanitize_inlist(features["insect_fluff"], GLOB.insect_fluffs_list)
@@ -1006,7 +1026,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["feature_human_ears"] , features["ears"])
WRITE_FILE(S["feature_lizard_frills"] , features["frills"])
WRITE_FILE(S["feature_lizard_spines"] , features["spines"])
WRITE_FILE(S["feature_lizard_body_markings"] , features["body_markings"])
WRITE_FILE(S["feature_lizard_body_markings"] , safe_json_encode(features["body_markings"]))
WRITE_FILE(S["feature_lizard_legs"] , features["legs"])
WRITE_FILE(S["feature_deco_wings"] , features["deco_wings"])
WRITE_FILE(S["feature_horns_color"] , features["horns_color"])
+11 -11
View File
@@ -761,7 +761,7 @@
var/image_dir = 0
var/icon_gender = (body_gender == FEMALE) ? "f" : "m" //gender of the icon, if applicable
/*
if(dropped)
image_dir = SOUTH
if(dmg_overlay_type)
@@ -771,14 +771,16 @@
. += image('icons/mob/dam_mob.dmi', "[dmg_overlay_type]_[body_zone]_0[burnstate]", -DAMAGE_LAYER, image_dir)
if(!isnull(body_markings) && is_organic_limb(FALSE))
if(!use_digitigrade)
if(body_zone == BODY_ZONE_CHEST)
. += image(body_markings_icon, "[body_markings]_[body_zone]_[icon_gender]", -MARKING_LAYER, image_dir)
for(var/list/marking_list in body_markings_list)
// marking stores icon and value for the specific bodypart
if(!use_digitigrade)
if(body_zone == BODY_ZONE_CHEST)
. += image(marking_list[1], "[marking_list[2]]_[body_zone]_[icon_gender]", -MARKING_LAYER, image_dir)
else
. += image(marking_list[1], "[marking_list[2]]_[body_zone]", -MARKING_LAYER, image_dir)
else
. += image(body_markings_icon, "[body_markings]_[body_zone]", -MARKING_LAYER, image_dir)
else
. += image(body_markings_icon, "[body_markings]_[digitigrade_type]_[use_digitigrade]_[body_zone]", -MARKING_LAYER, image_dir)
*/
. += image(marking_list[1], "[marking_list[2]]_[digitigrade_type]_[use_digitigrade]_[body_zone]", -MARKING_LAYER, image_dir)
var/image/limb = image(layer = -BODYPARTS_LAYER, dir = image_dir)
var/list/aux = list()
var/list/auxmarking = list()
@@ -825,13 +827,11 @@
if(!use_digitigrade)
if(body_zone == BODY_ZONE_CHEST)
markings_list.Add(image(marking_list[1], "[marking_list[2]]_[body_zone]_[icon_gender]", -MARKING_LAYER, image_dir))
message_admins("length is now [length(markings_list)]")
else
markings_list.Add(image(marking_list[1], "[marking_list[2]]_[body_zone]", -MARKING_LAYER, image_dir))
message_admins("length is now [length(markings_list)]")
else
markings_list.Add(image(marking_list[1], "[marking_list[2]]_[digitigrade_type]_[use_digitigrade]_[body_zone]", -MARKING_LAYER, image_dir))
message_admins("length is now [length(markings_list)]")
if(color_src && length(marking_list) == 3)
message_admins("trying to color list of length [length(marking_list)] and also trying to access index [length(markings_list)] on a list of the same length")
markings_list[length(markings_list)].color = marking_list[3]