mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
This bounty was requested by @ArrisFairburne Cleans up the character customization; various customization features have been moved into three new tabs, "Character Basics" "OOC Preferences" and "Silicon Preferences". A ton of the character customization options (maybe 40%?) are stuff that almost nobody would use on a regular basis. Options like mushroom caps, frills, fluff, taur bodies, xenodorsal heads, etc. could be ignored by a most players because they're irrelevant to their characters. Ideally the most necessary stuff (basic furry parts, our required FTs, and soundbytes for speaking) are the stuff the players see first, with more stuff continuing to be available upon checking different tabs. Silicon prefs are moved into their own tab because most characters are carbons so they just won't ever need to bother with them. <details> <summary>Screenshots/Videos</summary> <img width="1100" height="790" alt="basics" src="https://github.com/user-attachments/assets/f84ce557-09fd-414d-a076-58569392a84b" /> <img width="1100" height="790" alt="visuals" src="https://github.com/user-attachments/assets/0e184209-f6d0-43f7-8452-0ec409f13dba" /> <img width="1100" height="790" alt="lore" src="https://github.com/user-attachments/assets/b0f8f74c-5b21-49f3-823a-8684015c7b61" /> <img width="1100" height="790" alt="lore2" src="https://github.com/user-attachments/assets/114088bc-6f3f-4a83-b528-d0d14055426e" /> <img width="1100" height="790" alt="ooc" src="https://github.com/user-attachments/assets/14333121-dc87-4396-a64d-fd2d07e86780" /> <img width="1100" height="790" alt="silicon" src="https://github.com/user-attachments/assets/5992d37e-17ca-4854-a88a-f6cc87f27128" /> </details> 🆑 ArrisFairburne qol: Cleaned up the character preference window. /🆑 ^ Conflicts: ^ tgui/packages/tgui/interfaces/PreferencesMenu/types.ts
52 lines
2.4 KiB
Plaintext
52 lines
2.4 KiB
Plaintext
// Hey listen! Imgur doesn't actually work, it's been tested.
|
|
|
|
/datum/preference/text/headshot
|
|
category = PREFERENCE_CATEGORY_CHARACTER_BASICS
|
|
savefile_identifier = PREFERENCE_CHARACTER
|
|
savefile_key = "headshot"
|
|
maximum_value_length = MAX_MESSAGE_LEN
|
|
/// Assoc list of ckeys and their link, used to cut down on chat spam
|
|
var/list/stored_link = list()
|
|
var/static/link_regex = regex(@"i\.gyazo.com|.\.l3n\.co|static\.f-list\.net/images/|images2\.imgbox\.com|thumbs2\.imgbox\.com|files\.catbox\.moe") // Catbox, Imgbox, Gyazo, Lensdump, or F-List
|
|
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"] = value
|
|
|
|
/datum/preference/text/headshot/is_valid(value)
|
|
if(!length(value)) // Just to get blank ones out of the way
|
|
return TRUE
|
|
|
|
var/find_index = findtext(value, "https://")
|
|
if(find_index != 1)
|
|
to_chat(usr, span_warning("Your link must be https!"))
|
|
return
|
|
|
|
if(!findtext(value, "."))
|
|
to_chat(usr, span_warning("Invalid link!"))
|
|
return
|
|
var/list/value_split = splittext(value, ".")
|
|
|
|
// extension will always be the last entry
|
|
var/extension = value_split[length(value_split)]
|
|
if(!(extension in valid_extensions))
|
|
to_chat(usr, span_warning("The image must be one of the following extensions: '[english_list(valid_extensions)]'"))
|
|
return
|
|
|
|
find_index = findtext(value, link_regex)
|
|
if(find_index != 9)
|
|
to_chat(usr, span_warning("The image must be hosted on one of the following sites: 'Catbox, Imgbox, Gyazo, Lensdump, F-List'"))
|
|
return
|
|
|
|
apply_headshot(value)
|
|
return TRUE
|
|
|
|
/datum/preference/text/headshot/proc/apply_headshot(value)
|
|
if(stored_link[usr.ckey] != value)
|
|
to_chat(usr, span_notice("Please use a relatively SFW image of the head and shoulder area to maintain immersion level. Think of it as a headshot for your ID. Lastly, [span_bold("do not use a real life photo or use any image that is less than serious.")]"))
|
|
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
|
|
return TRUE
|