mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Minor pref changes before I go utterly insane doing something else (#2447)
## About The Pull Request Makes some pref code correctly use apply_to_human and dna. This means that if you switch mind around the prefs stay the same... I wonder why I'm adding that Removes deprecated headshot var from preferences. This used to be the universal one on skyrat but since we have one for humans one for silicons it was never really used in any place that couldn't be replaced by dna on here. ## Why It's Good For The Game Makes the code more consistent. And more ready for certain *fun* activities ## Proof Of Testing <details> <summary>Screenshots/Videos</summary>  </details> ## Changelog 🆑 code: Makes headshot and nsfw preference code handling more consistent with the rest. Savefiles are untouched by this /🆑
This commit is contained in:
@@ -48,9 +48,6 @@
|
||||
// Determines if the player has undergone TGUI preferences migration, if so, this will prevent constant loading.
|
||||
var/tgui_prefs_migration = TRUE
|
||||
|
||||
/// A photo of the character, visible on close examine
|
||||
var/headshot = ""
|
||||
|
||||
/// An assoc list of food types to liked or dislike values. If null or empty, default species tastes are used instead on application.
|
||||
/// If a food doesn't exist in this list, it uses the default value.
|
||||
var/list/food_preferences = list()
|
||||
|
||||
@@ -11,11 +11,10 @@
|
||||
var/static/list/valid_extensions = list("jpg", "png", "jpeg") // Regex works fine, if you know how it works
|
||||
|
||||
/datum/preference/text/headshot/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
target?.dna.features["headshot"] = preferences?.headshot
|
||||
target.dna.features["headshot"] = value
|
||||
|
||||
/datum/preference/text/headshot/is_valid(value)
|
||||
if(!length(value)) // Just to get blank ones out of the way
|
||||
usr?.client?.prefs?.headshot = null
|
||||
return TRUE
|
||||
|
||||
var/find_index = findtext(value, "https://")
|
||||
@@ -48,6 +47,5 @@
|
||||
to_chat(usr, span_notice("If the photo doesn't show up properly in-game, ensure that it's a direct image link that opens properly in a browser."))
|
||||
to_chat(usr, span_notice("Keep in mind that the photo will be downsized to 250x250 pixels, so the more square the photo, the better it will look."))
|
||||
log_game("[usr] has set their Headshot image to '[value]'.")
|
||||
stored_link[usr?.ckey] = value
|
||||
usr?.client?.prefs.headshot = value
|
||||
stored_link[usr.ckey] = value
|
||||
return TRUE
|
||||
|
||||
@@ -86,8 +86,6 @@
|
||||
migrate_skyrat(save_data)
|
||||
addtimer(CALLBACK(src, PROC_REF(check_migration)), 10 SECONDS)
|
||||
|
||||
headshot = save_data["headshot"]
|
||||
|
||||
food_preferences = SANITIZE_LIST(save_data["food_preferences"])
|
||||
var/skyrat_update = savefile_needs_update_skyrat(save_data)
|
||||
if(skyrat_update >= 0)
|
||||
@@ -278,7 +276,6 @@
|
||||
save_data["allow_advanced_colors"] = allow_advanced_colors
|
||||
save_data["alt_job_titles"] = alt_job_titles
|
||||
save_data["languages"] = languages
|
||||
save_data["headshot"] = headshot
|
||||
save_data["food_preferences"] = food_preferences
|
||||
if(updated)
|
||||
save_data["modular_version"] = MODULAR_SAVEFILE_VERSION_MAX
|
||||
|
||||
@@ -59,39 +59,36 @@
|
||||
var/headshot = ""
|
||||
|
||||
// Handle OOC notes first
|
||||
if(preferences && preferences.read_preference(/datum/preference/toggle/master_erp_preferences))
|
||||
var/e_prefs = preferences.read_preference(/datum/preference/choiced/erp_status)
|
||||
var/e_prefs_hypno = preferences.read_preference(/datum/preference/choiced/erp_status_hypno)
|
||||
var/e_prefs_v = preferences.read_preference(/datum/preference/choiced/erp_status_v)
|
||||
var/e_prefs_nc = preferences.read_preference(/datum/preference/choiced/erp_status_nc)
|
||||
var/e_prefs_mechanical = preferences.read_preference(/datum/preference/choiced/erp_status_mechanics)
|
||||
ooc_notes += "ERP: [e_prefs]\n"
|
||||
ooc_notes += "Hypnosis: [e_prefs_hypno]\n"
|
||||
ooc_notes += "Vore: [e_prefs_v]\n"
|
||||
ooc_notes += "Non-Con: [e_prefs_nc]\n"
|
||||
ooc_notes += "ERP Mechanics: [e_prefs_mechanical]\n"
|
||||
ooc_notes += "\n"
|
||||
if(preferences)
|
||||
if(preferences.read_preference(/datum/preference/toggle/master_erp_preferences))
|
||||
var/e_prefs = preferences.read_preference(/datum/preference/choiced/erp_status)
|
||||
var/e_prefs_hypno = preferences.read_preference(/datum/preference/choiced/erp_status_hypno)
|
||||
var/e_prefs_v = preferences.read_preference(/datum/preference/choiced/erp_status_v)
|
||||
var/e_prefs_nc = preferences.read_preference(/datum/preference/choiced/erp_status_nc)
|
||||
var/e_prefs_mechanical = preferences.read_preference(/datum/preference/choiced/erp_status_mechanics)
|
||||
ooc_notes += "ERP: [e_prefs]\n"
|
||||
ooc_notes += "Hypnosis: [e_prefs_hypno]\n"
|
||||
ooc_notes += "Vore: [e_prefs_v]\n"
|
||||
ooc_notes += "Non-Con: [e_prefs_nc]\n"
|
||||
ooc_notes += "ERP Mechanics: [e_prefs_mechanical]\n"
|
||||
ooc_notes += "\n"
|
||||
|
||||
// Now we handle silicon and/or human, order doesn't really matter
|
||||
// If other variants of mob/living need to be handled at some point, put them here
|
||||
if(preferences && issilicon(holder))
|
||||
flavor_text = preferences?.read_preference(/datum/preference/text/silicon_flavor_text)
|
||||
// Silicon prefs and headshot
|
||||
custom_species = preferences?.read_preference(/datum/preference/text/custom_species/silicon)
|
||||
custom_species_lore = preferences?.read_preference(/datum/preference/text/custom_species_lore/silicon)
|
||||
ooc_notes += preferences?.read_preference(/datum/preference/text/ooc_notes/silicon)
|
||||
headshot += preferences?.read_preference(/datum/preference/text/headshot/silicon)
|
||||
name = holder.name
|
||||
// Now we handle silicon and/or human, order doesn't really matter
|
||||
// If other variants of mob/living need to be handled at some point, put them here
|
||||
if(issilicon(holder))
|
||||
flavor_text = preferences.read_preference(/datum/preference/text/silicon_flavor_text)
|
||||
// Silicon prefs and headshot
|
||||
custom_species = preferences.read_preference(/datum/preference/text/custom_species/silicon)
|
||||
custom_species_lore = preferences.read_preference(/datum/preference/text/custom_species_lore/silicon)
|
||||
ooc_notes += preferences.read_preference(/datum/preference/text/ooc_notes/silicon)
|
||||
headshot += preferences.read_preference(/datum/preference/text/headshot/silicon)
|
||||
name = holder.name
|
||||
|
||||
if(ishuman(holder))
|
||||
var/mob/living/carbon/human/holder_human = holder
|
||||
obscured = ( \
|
||||
holder_human.wear_mask && \
|
||||
(holder_human.wear_mask.flags_inv & HIDEFACE)) && \
|
||||
obscured = (holder_human.wear_mask && (holder_human.wear_mask.flags_inv & HIDEFACE)) && \
|
||||
obscurity_examine_pref || \
|
||||
(holder_human.head && (holder_human.head.flags_inv & HIDEFACE) && \
|
||||
obscurity_examine_pref \
|
||||
)
|
||||
(holder_human.head && (holder_human.head.flags_inv & HIDEFACE) && obscurity_examine_pref)
|
||||
|
||||
//Check if the mob is obscured, then continue to headshot and species lore
|
||||
ooc_notes += holder_human.dna?.features["ooc_notes"]
|
||||
@@ -101,7 +98,7 @@
|
||||
flavor_text = "Obscured"
|
||||
name = "Unknown"
|
||||
else
|
||||
headshot += preferences?.read_preference(/datum/preference/text/headshot)
|
||||
headshot = holder_human.dna.features["headshot"]
|
||||
flavor_text = holder_human.dna.features["flavor_text"]
|
||||
name = holder.name
|
||||
//Custom species handling. Reports the normal custom species if there is not one set.
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
/datum/examine_panel/ui_data(mob/user)
|
||||
var/list/data = ..()
|
||||
var/datum/preferences/preferences = holder.client?.prefs
|
||||
if(isnull(preferences))
|
||||
return ..()
|
||||
var/flavor_text_nsfw = ""
|
||||
var/headshot_nsfw = ""
|
||||
var/character_ad = ""
|
||||
var/emote_length = preferences?.read_preference(/datum/preference/choiced/emote_length)
|
||||
var/approach = preferences?.read_preference(/datum/preference/choiced/approach_pref)
|
||||
var/furries = preferences?.read_preference(/datum/preference/choiced/directory_character_prefs/furry_pref)
|
||||
var/scalies = preferences?.read_preference(/datum/preference/choiced/directory_character_prefs/scalie_pref)
|
||||
var/others = preferences?.read_preference(/datum/preference/choiced/directory_character_prefs/other_pref)
|
||||
var/demihumans = preferences?.read_preference(/datum/preference/choiced/directory_character_prefs/demihuman_pref)
|
||||
var/humans = preferences?.read_preference(/datum/preference/choiced/directory_character_prefs/human_pref)
|
||||
var/show_nsfw_flavor_text = preferences?.read_preference(/datum/preference/choiced/show_nsfw_flavor_text)
|
||||
var/emote_length = preferences.read_preference(/datum/preference/choiced/emote_length)
|
||||
var/approach = preferences.read_preference(/datum/preference/choiced/approach_pref)
|
||||
var/furries = preferences.read_preference(/datum/preference/choiced/directory_character_prefs/furry_pref)
|
||||
var/scalies = preferences.read_preference(/datum/preference/choiced/directory_character_prefs/scalie_pref)
|
||||
var/others = preferences.read_preference(/datum/preference/choiced/directory_character_prefs/other_pref)
|
||||
var/demihumans = preferences.read_preference(/datum/preference/choiced/directory_character_prefs/demihuman_pref)
|
||||
var/humans = preferences.read_preference(/datum/preference/choiced/directory_character_prefs/human_pref)
|
||||
var/show_nsfw_flavor_text = preferences.read_preference(/datum/preference/choiced/show_nsfw_flavor_text)
|
||||
if(issilicon(holder) && !(show_nsfw_flavor_text == "Never"))
|
||||
flavor_text_nsfw = preferences?.read_preference(/datum/preference/text/flavor_text_nsfw/silicon)
|
||||
headshot_nsfw += preferences?.read_preference(/datum/preference/text/headshot/silicon/nsfw)
|
||||
if(ishuman(holder))
|
||||
flavor_text_nsfw = preferences.read_preference(/datum/preference/text/flavor_text_nsfw/silicon)
|
||||
headshot_nsfw = preferences.read_preference(/datum/preference/text/headshot/silicon/nsfw)
|
||||
else if(ishuman(holder))
|
||||
var/mob/living/carbon/human/holder_human = holder
|
||||
if((show_nsfw_flavor_text == "Always On") || (show_nsfw_flavor_text == "Nude Only" && !(holder_human.w_uniform)))
|
||||
flavor_text_nsfw = preferences?.read_preference(/datum/preference/text/flavor_text_nsfw)
|
||||
headshot_nsfw += preferences?.read_preference(/datum/preference/text/headshot/nsfw)
|
||||
flavor_text_nsfw = holder_human.dna.features["flavor_text_nsfw"]
|
||||
headshot_nsfw = holder_human.dna.features["headshot_nsfw"]
|
||||
character_ad += "Preferred Emote Length: [emote_length]\n"
|
||||
character_ad += "How to Approach: [approach]\n"
|
||||
character_ad += "Furries: [furries] | Scalies: [scalies] | Other: [others]\n"
|
||||
character_ad += "Demis: [demihumans] | Humans: [humans]\n"
|
||||
character_ad += "\n"
|
||||
character_ad += preferences?.read_preference(/datum/preference/text/character_ad)
|
||||
character_ad += preferences.read_preference(/datum/preference/text/character_ad)
|
||||
|
||||
data["character_ad"] = character_ad
|
||||
data["flavor_text_nsfw"] = flavor_text_nsfw
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
return ""
|
||||
|
||||
/datum/preference/text/flavor_text_nsfw/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
target.dna.features["flavor_text_nsfw"] = value
|
||||
|
||||
//This is just a silicon variant of the NSFW flavor text.
|
||||
/datum/preference/text/flavor_text_nsfw/silicon
|
||||
savefile_key = "silicon_flavor_text_nsfw"
|
||||
|
||||
/datum/preference/text/flavor_text_nsfw/silicon/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
|
||||
//Lets the client choose when their NSFW flavor text is visible on a per-character basis.
|
||||
/datum/preference/choiced/show_nsfw_flavor_text
|
||||
category = PREFERENCE_CATEGORY_NON_CONTEXTUAL
|
||||
@@ -50,7 +53,7 @@
|
||||
savefile_key = "headshot_nsfw"
|
||||
|
||||
/datum/preference/text/headshot/nsfw/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
|
||||
return FALSE
|
||||
target.dna.features["headshot_nsfw"] = value
|
||||
|
||||
/datum/preference/text/headshot/nsfw/apply_headshot(value)
|
||||
if(stored_link[usr.ckey] != value)
|
||||
|
||||
Reference in New Issue
Block a user