Revert "12/21 modernizations from TG live"
This commit is contained in:
@@ -1,21 +1,18 @@
|
||||
//This is the lowest supported version, anything below this is completely obsolete and the entire savefile will be wiped.
|
||||
#define SAVEFILE_VERSION_MIN 10
|
||||
//This is the lowest supported version, anything below this is completely obsolete and the entire savefile will be wiped.
|
||||
#define SAVEFILE_VERSION_MIN 8
|
||||
|
||||
//This is the current version, anything below this will attempt to update (if it's not obsolete)
|
||||
#define SAVEFILE_VERSION_MAX 17
|
||||
#define SAVEFILE_VERSION_MAX 15
|
||||
/*
|
||||
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
|
||||
This proc checks if the current directory of the savefile S needs updating
|
||||
It is to be used by the load_character and load_preferences procs.
|
||||
(S.cd=="/" is preferences, S.cd=="/character[integer]" is a character slot, etc)
|
||||
|
||||
if the current directory's version is below SAVEFILE_VERSION_MIN it will simply wipe everything in that directory
|
||||
(if we're at root "/" then it'll just wipe the entire savefile, for instance.)
|
||||
|
||||
if its version is below SAVEFILE_VERSION_MAX but above the minimum, it will load data but later call the
|
||||
respective update_preferences() or update_character() proc.
|
||||
Those procs allow coders to specify format changes so users do not lose their setups and have to redo them again.
|
||||
|
||||
Failing all that, the standard sanity checks are performed. They simply check the data is suitable, reverting to
|
||||
initial() values if necessary.
|
||||
*/
|
||||
@@ -31,7 +28,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
return -1
|
||||
|
||||
|
||||
/datum/preferences/proc/update_antagchoices(current_version, savefile/S)
|
||||
/datum/preferences/proc/update_antagchoices(current_version)
|
||||
if((!islist(be_special) || old_be_special ) && current_version < 12)
|
||||
//Archived values of when antag pref defines were a bitfield+fitflags
|
||||
var/B_traitor = 1
|
||||
@@ -87,7 +84,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
be_special += ROLE_ABDUCTOR
|
||||
|
||||
|
||||
/datum/preferences/proc/update_preferences(current_version, savefile/S)
|
||||
/datum/preferences/proc/update_preferences(current_version)
|
||||
if(current_version < 10)
|
||||
toggles |= MEMBER_PUBLIC
|
||||
if(current_version < 11)
|
||||
@@ -98,14 +95,71 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
if(current_version < 15)
|
||||
toggles |= SOUND_ANNOUNCEMENTS
|
||||
|
||||
|
||||
//should this proc get fairly long (say 3 versions long),
|
||||
//just increase SAVEFILE_VERSION_MIN so it's not as far behind
|
||||
//SAVEFILE_VERSION_MAX and then delete any obsolete if clauses
|
||||
//from this proc.
|
||||
//It's only really meant to avoid annoying frequent players
|
||||
//if your savefile is 3 months out of date, then 'tough shit'.
|
||||
/datum/preferences/proc/update_character(current_version, savefile/S)
|
||||
/datum/preferences/proc/update_character(current_version)
|
||||
if(current_version < 9) //an example, underwear were an index for a hardcoded list, converting to a string
|
||||
if(gender == MALE)
|
||||
switch(underwear)
|
||||
if(1)
|
||||
underwear = "Mens White"
|
||||
if(2)
|
||||
underwear = "Mens Grey"
|
||||
if(3)
|
||||
underwear = "Mens Green"
|
||||
if(4)
|
||||
underwear = "Mens Blue"
|
||||
if(5)
|
||||
underwear = "Mens Black"
|
||||
if(6)
|
||||
underwear = "Mankini"
|
||||
if(7)
|
||||
underwear = "Mens Hearts Boxer"
|
||||
if(8)
|
||||
underwear = "Mens Black Boxer"
|
||||
if(9)
|
||||
underwear = "Mens Grey Boxer"
|
||||
if(10)
|
||||
underwear = "Mens Striped Boxer"
|
||||
if(11)
|
||||
underwear = "Mens Kinky"
|
||||
if(12)
|
||||
underwear = "Mens Red"
|
||||
if(13)
|
||||
underwear = "Nude"
|
||||
else
|
||||
switch(underwear)
|
||||
if(1)
|
||||
underwear = "Ladies Red"
|
||||
if(2)
|
||||
underwear = "Ladies White"
|
||||
if(3)
|
||||
underwear = "Ladies Yellow"
|
||||
if(4)
|
||||
underwear = "Ladies Blue"
|
||||
if(5)
|
||||
underwear = "Ladies Black"
|
||||
if(6)
|
||||
underwear = "Ladies Thong"
|
||||
if(7)
|
||||
underwear = "Babydoll"
|
||||
if(8)
|
||||
underwear = "Ladies Baby-Blue"
|
||||
if(9)
|
||||
underwear = "Ladies Green"
|
||||
if(10)
|
||||
underwear = "Ladies Pink"
|
||||
if(11)
|
||||
underwear = "Ladies Kinky"
|
||||
if(12)
|
||||
underwear = "Tankini"
|
||||
if(13)
|
||||
underwear = "Nude"
|
||||
|
||||
if(pref_species && !(pref_species.id in roundstart_species))
|
||||
var/rando_race = pick(config.roundstart_races)
|
||||
pref_species = new rando_race()
|
||||
@@ -116,17 +170,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
backbag = DSATCHEL
|
||||
else
|
||||
backbag = DBACKPACK
|
||||
if(current_version < 16)
|
||||
var/berandom
|
||||
S["userandomjob"] >> berandom
|
||||
if (berandom)
|
||||
joblessrole = BERANDOMJOB
|
||||
else
|
||||
joblessrole = BEASSISTANT
|
||||
if(current_version < 17)
|
||||
features["legs"] = "Normal Legs"
|
||||
|
||||
|
||||
//
|
||||
// Save/Load Vore Preferences
|
||||
//
|
||||
/datum/preferences/proc/load_vore_preferences(slot)
|
||||
@@ -141,13 +187,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S.cd = "/character[slot]"
|
||||
|
||||
S["digestable"] >> digestable
|
||||
S["devourable"] >> devourable
|
||||
S["belly_prefs"] >> belly_prefs
|
||||
|
||||
if(isnull(digestable))
|
||||
digestable = 1
|
||||
if(isnull(devourable))
|
||||
devourable = 0
|
||||
if(isnull(belly_prefs))
|
||||
belly_prefs = list()
|
||||
|
||||
@@ -162,7 +205,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S.cd = "/character[default_slot]"
|
||||
|
||||
S["digestable"] << digestable
|
||||
S["devourable"] << devourable
|
||||
S["belly_prefs"] << belly_prefs
|
||||
|
||||
return 1
|
||||
@@ -195,6 +237,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["hotkeys"] >> hotkeys
|
||||
S["tgui_fancy"] >> tgui_fancy
|
||||
S["tgui_lock"] >> tgui_lock
|
||||
S["space_parallax"] >> space_parallax
|
||||
S["space_dust"] >> space_dust
|
||||
S["parallax_speed"] >> parallax_speed
|
||||
|
||||
if(islist(S["be_special"]))
|
||||
S["be_special"] >> be_special
|
||||
@@ -213,26 +258,24 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["ignoring"] >> ignoring
|
||||
S["ghost_hud"] >> ghost_hud
|
||||
S["inquisitive_ghost"] >> inquisitive_ghost
|
||||
S["uses_glasses_colour"]>> uses_glasses_colour
|
||||
S["clientfps"] >> clientfps
|
||||
S["parallax"] >> parallax
|
||||
|
||||
//try to fix any outdated data if necessary
|
||||
if(needs_update >= 0)
|
||||
update_preferences(needs_update, S) //needs_update = savefile_version if we need an update (positive integer)
|
||||
update_antagchoices(needs_update, S)
|
||||
update_preferences(needs_update) //needs_update = savefile_version if we need an update (positive integer)
|
||||
update_antagchoices(needs_update)
|
||||
|
||||
//Sanitize
|
||||
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
|
||||
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative", "Clockwork"), initial(UI_style))
|
||||
UI_style = sanitize_inlist(UI_style, list("Midnight", "Plasmafire", "Retro", "Slimecore", "Operative"), initial(UI_style))
|
||||
hotkeys = sanitize_integer(hotkeys, 0, 1, initial(hotkeys))
|
||||
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
|
||||
tgui_lock = sanitize_integer(tgui_lock, 0, 1, initial(tgui_lock))
|
||||
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
|
||||
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
|
||||
clientfps = sanitize_integer(clientfps, 0, 1000, 0)
|
||||
parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, PARALLAX_HIGH)
|
||||
space_parallax = sanitize_integer(space_parallax, 0, 1, initial(space_parallax))
|
||||
space_dust = sanitize_integer(space_dust, 0, 1, initial(space_dust))
|
||||
parallax_speed = sanitize_integer(parallax_speed, 0, 5, initial(parallax_speed))
|
||||
ghost_form = sanitize_inlist(ghost_form, ghost_forms, initial(ghost_form))
|
||||
ghost_orbit = sanitize_inlist(ghost_orbit, ghost_orbits, initial(ghost_orbit))
|
||||
ghost_accs = sanitize_inlist(ghost_accs, ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION)
|
||||
@@ -269,9 +312,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["ignoring"] << ignoring
|
||||
S["ghost_hud"] << ghost_hud
|
||||
S["inquisitive_ghost"] << inquisitive_ghost
|
||||
S["uses_glasses_colour"]<< uses_glasses_colour
|
||||
S["clientfps"] << clientfps
|
||||
S["parallax"] << parallax
|
||||
S["space_parallax"] << space_parallax
|
||||
S["space_dust"] << space_dust
|
||||
S["parallax_speed"] << parallax_speed
|
||||
|
||||
return 1
|
||||
|
||||
@@ -308,25 +351,28 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
if(!S["features["mcolor"]"] || S["features["mcolor"]"] == "#000")
|
||||
S["features["mcolor"]"] << "#FFF"
|
||||
if(!S["features["mcolor2"]"] || S["features["mcolor2"]"] == "#000")
|
||||
S["features["mcolor2"]"] << "#FFF"
|
||||
if(!S["features["mcolor3"]"] || S["features["mcolor3"]"] == "#000")
|
||||
S["features["mcolor3"]"] << "#FFF"
|
||||
|
||||
//Character
|
||||
S["OOC_Notes"] >> metadata
|
||||
S["flavor_text"] >> flavor_text
|
||||
S["real_name"] >> real_name
|
||||
S["name_is_always_random"] >> be_random_name
|
||||
S["body_is_always_random"] >> be_random_body
|
||||
S["gender"] >> gender
|
||||
S["age"] >> age
|
||||
S["hair_color"] >> hair_color
|
||||
S["facial_hair_color"] >> facial_hair_color
|
||||
S["eye_color"] >> eye_color
|
||||
S["skin_tone"] >> skin_tone
|
||||
S["hair_style_name"] >> hair_style
|
||||
S["facial_style_name"] >> facial_hair_style
|
||||
S["underwear"] >> underwear
|
||||
S["undershirt"] >> undershirt
|
||||
S["socks"] >> socks
|
||||
S["backbag"] >> backbag
|
||||
S["real_name"] >> real_name
|
||||
S["name_is_always_random"] >> be_random_name
|
||||
S["body_is_always_random"] >> be_random_body
|
||||
S["gender"] >> gender
|
||||
S["age"] >> age
|
||||
S["hair_color"] >> hair_color
|
||||
S["facial_hair_color"] >> facial_hair_color
|
||||
S["eye_color"] >> eye_color
|
||||
S["skin_tone"] >> skin_tone
|
||||
S["hair_style_name"] >> hair_style
|
||||
S["facial_style_name"] >> facial_hair_style
|
||||
S["underwear"] >> underwear
|
||||
S["undershirt"] >> undershirt
|
||||
S["socks"] >> socks
|
||||
S["backbag"] >> backbag
|
||||
S["flavor_text"] >> flavor_text
|
||||
S["feature_mcolor"] >> features["mcolor"]
|
||||
S["feature_mcolor2"] >> features["mcolor2"]
|
||||
S["feature_mcolor3"] >> features["mcolor3"]
|
||||
@@ -344,7 +390,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["feature_xeno_tail"] >> features["xenotail"]
|
||||
S["feature_xeno_dors"] >> features["xenodorsal"]
|
||||
S["feature_xeno_head"] >> features["xenohead"]
|
||||
S["feature_lizard_legs"] >> features["legs"]
|
||||
if(!config.mutant_humans)
|
||||
features["tail_human"] = "none"
|
||||
features["ears"] = "none"
|
||||
@@ -359,7 +404,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["deity_name"] >> custom_names["deity"]
|
||||
|
||||
//Jobs
|
||||
S["joblessrole"] >> joblessrole
|
||||
S["userandomjob"] >> userandomjob
|
||||
S["job_civilian_high"] >> job_civilian_high
|
||||
S["job_civilian_med"] >> job_civilian_med
|
||||
S["job_civilian_low"] >> job_civilian_low
|
||||
@@ -372,11 +417,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
|
||||
//try to fix any outdated data if necessary
|
||||
if(needs_update >= 0)
|
||||
update_character(needs_update, S) //needs_update == savefile_version if we need an update (positive integer)
|
||||
update_character(needs_update) //needs_update == savefile_version if we need an update (positive integer)
|
||||
|
||||
//Sanitize
|
||||
flavor_text = sanitize_text(flavor_text, initial(flavor_text))
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
if(!features["mcolor"] || features["mcolor"] == "#000")
|
||||
features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F")
|
||||
@@ -424,9 +468,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
features["xenotail"] = sanitize_inlist(features["xenotail"], xeno_tail_list)
|
||||
features["xenohead"] = sanitize_inlist(features["xenohead"], xeno_head_list)
|
||||
features["xenodorsal"] = sanitize_inlist(features["xenodorsal"], xeno_dorsal_list)
|
||||
features["feature_lizard_legs"] = sanitize_inlist(features["legs"], legs_list, "Normal Legs")
|
||||
|
||||
joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole))
|
||||
userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob))
|
||||
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
|
||||
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
|
||||
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
|
||||
@@ -450,24 +493,23 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["version"] << SAVEFILE_VERSION_MAX //load_character will sanitize any bad data, so assume up-to-date.
|
||||
|
||||
//Character
|
||||
S["OOC_Notes"] << metadata
|
||||
S["real_name"] << real_name
|
||||
S["name_is_always_random"] << be_random_name
|
||||
S["body_is_always_random"] << be_random_body
|
||||
S["gender"] << gender
|
||||
S["age"] << age
|
||||
S["hair_color"] << hair_color
|
||||
S["facial_hair_color"] << facial_hair_color
|
||||
S["eye_color"] << eye_color
|
||||
S["skin_tone"] << skin_tone
|
||||
S["hair_style_name"] << hair_style
|
||||
S["facial_style_name"] << facial_hair_style
|
||||
S["underwear"] << underwear
|
||||
S["undershirt"] << undershirt
|
||||
S["socks"] << socks
|
||||
S["backbag"] << backbag
|
||||
S["real_name"] << real_name
|
||||
S["name_is_always_random"] << be_random_name
|
||||
S["body_is_always_random"] << be_random_body
|
||||
S["gender"] << gender
|
||||
S["age"] << age
|
||||
S["hair_color"] << hair_color
|
||||
S["facial_hair_color"] << facial_hair_color
|
||||
S["eye_color"] << eye_color
|
||||
S["skin_tone"] << skin_tone
|
||||
S["hair_style_name"] << hair_style
|
||||
S["facial_style_name"] << facial_hair_style
|
||||
S["underwear"] << underwear
|
||||
S["undershirt"] << undershirt
|
||||
S["socks"] << socks
|
||||
S["backbag"] << backbag
|
||||
S["flavor_text"] << flavor_text
|
||||
S["species"] << pref_species.id
|
||||
S["species"] << pref_species.id
|
||||
S["feature_mcolor"] << features["mcolor"]
|
||||
S["feature_mcolor2"] << features["mcolor2"]
|
||||
S["feature_mcolor3"] << features["mcolor3"]
|
||||
@@ -487,7 +529,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["feature_xeno_tail"] << features["xenotail"]
|
||||
S["feature_xeno_dors"] << features["xenodorsal"]
|
||||
S["feature_xeno_head"] << features["xenohead"]
|
||||
S["feature_lizard_legs"] << features["legs"]
|
||||
|
||||
S["clown_name"] << custom_names["clown"]
|
||||
S["mime_name"] << custom_names["mime"]
|
||||
S["ai_name"] << custom_names["ai"]
|
||||
@@ -496,7 +538,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["deity_name"] << custom_names["deity"]
|
||||
|
||||
//Jobs
|
||||
S["joblessrole"] << joblessrole
|
||||
S["userandomjob"] << userandomjob
|
||||
S["job_civilian_high"] << job_civilian_high
|
||||
S["job_civilian_med"] << job_civilian_med
|
||||
S["job_civilian_low"] << job_civilian_low
|
||||
|
||||
Reference in New Issue
Block a user