Adds a very basic soft restriction system. There's definite room for improvement, but this is good enough for now. Am too hongry for this.

This commit is contained in:
deathride58
2020-03-03 17:44:10 -05:00
parent 519de6a83d
commit 49ad376e5e
11 changed files with 86 additions and 22 deletions
+40 -1
View File
@@ -210,6 +210,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/icon/bgstate = "steel"
var/list/bgstate_options = list("000", "midgrey", "FFF", "white", "steel", "techmaint", "dark", "plating", "reinforced")
var/show_mismatched_markings = FALSE //determines whether or not the markings lists should show markings that don't match the currently selected species. Intentionally left unsaved.
/datum/preferences/New(client/C)
parent = C
@@ -411,6 +413,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
//Mutant stuff
var/mutant_category = 0
dat += APPEARANCE_CATEGORY_COLUMN
dat += "<h3>Show mismatched markings</h3>"
dat += "<a style='display:block;width:100px' href='?_src_=prefs;preference=mismatched_markings;task=input'>[show_mismatched_markings ? "Yes" : "No"]</a>"
mutant_category++
if(mutant_category >= MAX_MUTANT_ROWS) //just in case someone sets the max rows to 1 or something dumb like that
dat += "</td>"
mutant_category = 0
if("tail_lizard" in pref_species.default_features)
if(!mutant_category)
dat += APPEARANCE_CATEGORY_COLUMN
@@ -1618,6 +1628,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else
to_chat(user, "<span class='danger'>Invalid color. Your color is not bright enough.</span>")
if("mismatched_markings")
show_mismatched_markings = !show_mismatched_markings
if("ipc_screen")
var/new_ipc_screen
new_ipc_screen = input(user, "Choose your character's screen:", "Character Preference") as null|anything in GLOB.ipc_screens_list
@@ -1625,8 +1638,18 @@ GLOBAL_LIST_EMPTY(preferences_datums)
features["ipc_screen"] = new_ipc_screen
if("ipc_antenna")
var/list/snowflake_antenna_list = list()
//Potential todo: turn all of THIS into a define to reduce copypasta.
for(var/path in GLOB.ipc_antennas_list)
var/datum/sprite_accessory/antenna/instance = GLOB.ipc_antennas_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_antenna_list[S.name] = path
var/new_ipc_antenna
new_ipc_antenna = input(user, "Choose your character's antenna:", "Character Preference") as null|anything in GLOB.ipc_antennas_list
new_ipc_antenna = input(user, "Choose your character's antenna:", "Character Preference") as null|anything in snowflake_antenna_list
if(new_ipc_antenna)
features["ipc_antenna"] = new_ipc_antenna
@@ -1646,6 +1669,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/tails/human/instance = GLOB.tails_list_human[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_tails_list[S.name] = path
var/new_tail
@@ -1663,6 +1688,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/mam_tails/instance = GLOB.mam_tails_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_tails_list[S.name] = path
var/new_tail
@@ -1686,6 +1713,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/mam_snouts/instance = GLOB.snouts_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_snouts_list[S.name] = path
var/new_snout
@@ -1701,6 +1730,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/mam_snouts/instance = GLOB.mam_snouts_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_mam_snouts_list[S.name] = path
var/new_mam_snouts
@@ -1798,6 +1829,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/taur/instance = GLOB.taur_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_taur_list[S.name] = path
var/new_taur
@@ -1816,6 +1849,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/ears/instance = GLOB.ears_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_ears_list[S.name] = path
var/new_ears
@@ -1829,6 +1864,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/mam_ears/instance = GLOB.mam_ears_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_ears_list[S.name] = path
var/new_ears
@@ -1842,6 +1879,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/datum/sprite_accessory/mam_body_markings/instance = GLOB.mam_body_markings_list[path]
if(istype(instance, /datum/sprite_accessory))
var/datum/sprite_accessory/S = instance
if(!show_mismatched_markings && S.recommended_species && !S.recommended_species.Find(pref_species.id))
continue
if((!S.ckeys_allowed) || (S.ckeys_allowed.Find(user.client.ckey)))
snowflake_markings_list[S.name] = path
var/new_mam_body_markings