From 4306e952fc11a8ee7eee1dc7a2935076ef22b2ea Mon Sep 17 00:00:00 2001 From: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com> Date: Wed, 19 Mar 2025 23:45:55 -0400 Subject: [PATCH] You can now put a full size reference picture on the examine panel (#3339) ## About The Pull Request I also centered the tab titles so it looks a little straighter ![o4s526oYFJ](https://github.com/user-attachments/assets/a8cbb5ce-c3c8-4155-bb3a-45d273b93e11) ![image](https://github.com/user-attachments/assets/65995b71-b3af-4644-b2ca-7a27973e25f5) ## Why It's Good For The Game Cause I want to throw art on the examine panel. It'll be a little slow switching back due to ByondUI. Sadly ## Proof Of Testing See above ## Changelog :cl: qol: Adds the ability to put a reference picture on the examine panel. /:cl: --- .../code/modules/mob/living/examine_tgui.dm | 6 +- .../modules/client/flavor_text/flavor_text.dm | 25 ++ .../packages/tgui/interfaces/ExaminePanel.jsx | 397 +++++++++++------- .../bubber/species_features.tsx | 17 + 4 files changed, 293 insertions(+), 152 deletions(-) diff --git a/modular_skyrat/master_files/code/modules/mob/living/examine_tgui.dm b/modular_skyrat/master_files/code/modules/mob/living/examine_tgui.dm index ec0dd5b9b4e..861c0178831 100644 --- a/modular_skyrat/master_files/code/modules/mob/living/examine_tgui.dm +++ b/modular_skyrat/master_files/code/modules/mob/living/examine_tgui.dm @@ -57,7 +57,8 @@ var/obscurity_examine_pref = preferences?.read_preference(/datum/preference/toggle/obscurity_examine) var/ooc_notes = "" var/headshot = "" - + var/art_ref = "" + var/art_ref_nsfw = preferences?.read_preference(/datum/preference/toggle/art_ref_nsfw) // Handle OOC notes first if(preferences) if(preferences.read_preference(/datum/preference/toggle/master_erp_preferences)) @@ -100,6 +101,7 @@ else headshot = holder_human.dna.features["headshot"] flavor_text = holder_human.dna.features["flavor_text"] + art_ref = holder_human.dna.features["art_ref"] name = holder.name //Custom species handling. Reports the normal custom species if there is not one set. if(holder_human.dna.species.lore_protected || holder_human.dna.features["custom_species"] == "") @@ -124,4 +126,6 @@ data["custom_species"] = custom_species data["custom_species_lore"] = custom_species_lore data["headshot"] = headshot + data["art_ref"] = art_ref + data["art_ref_nsfw"] = art_ref_nsfw return data diff --git a/modular_zubbers/code/modules/client/flavor_text/flavor_text.dm b/modular_zubbers/code/modules/client/flavor_text/flavor_text.dm index f53deb57077..a7dc7a4b3c1 100644 --- a/modular_zubbers/code/modules/client/flavor_text/flavor_text.dm +++ b/modular_zubbers/code/modules/client/flavor_text/flavor_text.dm @@ -9,6 +9,7 @@ var/headshot_nsfw = "" var/headshot_silicon = "" var/headshot_silicon_nsfw = "" + var/art_ref = "" /datum/preference/text/flavor_text_nsfw category = PREFERENCE_CATEGORY_NON_CONTEXTUAL @@ -88,6 +89,30 @@ stored_link[usr?.ckey] = value usr?.client?.prefs.headshot_silicon_nsfw = value +/datum/preference/text/headshot/art_ref + savefile_key = "art_ref" + +/datum/preference/text/headshot/art_ref + +/datum/preference/text/headshot/art_ref/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + target.dna.features["art_ref"] = value + +/datum/preference/text/headshot/art_ref/apply_headshot(value) + if(stored_link[usr.ckey] != value) + log_game("[usr] has set their art reference image to '[value]'.") + stored_link[usr?.ckey] = value + usr?.client?.prefs.art_ref = value + +/datum/preference/toggle/art_ref_nsfw + category = PREFERENCE_CATEGORY_NON_CONTEXTUAL + savefile_identifier = PREFERENCE_CHARACTER + savefile_key = "art_ref_nsfw" + default_value = FALSE + + +/datum/preference/toggle/art_ref_nsfw/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences) + return FALSE + //OOC notes for Silicons. Overwrites regular OOC notes when you are playing a Silicon character. //TODO: Make this your regular OOC notes if you don't have Silicon ones. Every time I've tried, for some reason regular OOC notes haven't shown. /datum/preference/text/ooc_notes/silicon diff --git a/tgui/packages/tgui/interfaces/ExaminePanel.jsx b/tgui/packages/tgui/interfaces/ExaminePanel.jsx index bc8959210ce..fdd94ff05cf 100644 --- a/tgui/packages/tgui/interfaces/ExaminePanel.jsx +++ b/tgui/packages/tgui/interfaces/ExaminePanel.jsx @@ -1,6 +1,13 @@ // THIS IS A SKYRAT UI FILE import { useState } from 'react'; -import { ByondUi, Section, Stack, Tabs } from 'tgui-core/components'; +import { + Box, + Button, + ByondUi, + Section, + Stack, + Tabs, +} from 'tgui-core/components'; import { resolveAsset } from '../assets'; import { useBackend } from '../backend'; @@ -34,9 +41,10 @@ const formatURLs = (text) => { return
{parts}
; }; -export const ExaminePanel = (props) => { +export const ExaminePanel = () => { const [tabIndex, setTabIndex] = useState(1); const [lowerTabIndex, setLowerTabIndex] = useState(1); + const [page, setPage] = useState('main'); const { act, data } = useBackend(); const { character_name, @@ -50,7 +58,14 @@ export const ExaminePanel = (props) => { character_ad, headshot, headshot_nsfw, + art_ref, + art_ref_nsfw, } = data; + + const handlePageChange = (page, newPage) => { + setPage(newPage); + }; + return ( { height={670} > - - - {!headshot ? ( -
- + {art_ref && ( + + )} + + + {!headshot ? ( +
+ +
+ ) : ( + <> +
+ +
+ +
+ +
+ + )} +
+ + + + setTabIndex(1)} + > +
+ + setTabIndex(2)} + > +
+ + setTabIndex(3)} + > +
+ + + {tabIndex === 1 && ( +
+ {formatURLs(flavor_text)} +
+ )} + {tabIndex === 2 && ( +
+ {formatURLs(flavor_text_nsfw)} +
+ )} + {tabIndex === 3 && ( +
+ {custom_species + ? formatURLs(custom_species_lore) + : 'Just a normal space dweller.'} +
+ )} + + setLowerTabIndex(1)} + > +
+ + setLowerTabIndex(2)} + > +
+ + + {lowerTabIndex === 1 && ( +
+ {formatURLs(ooc_notes)} +
+ )} + {lowerTabIndex === 2 && ( +
+ {formatURLs(character_ad)} +
+ )} + + + + + ) : ( +
+
+ )} ); diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/bubber/species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/bubber/species_features.tsx index 26ca458e55e..4a7e689c1d5 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/bubber/species_features.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/character_preferences/bubber/species_features.tsx @@ -1,8 +1,10 @@ import { + CheckboxInput, Feature, FeatureChoiced, FeatureShortTextInput, FeatureTextInput, + FeatureToggle, } from '../../base'; import { FeatureDropdownInput } from '../../dropdowns'; @@ -151,3 +153,18 @@ export const custom_species_lore_silicon: Feature = { 'Lore for your silicon, typically its company, make, model, and details regarding its creation.', component: FeatureTextInput, }; + +export const art_ref: Feature = { + name: 'Art Reference', + description: + 'Art Reference that others can see for your character \ + Requires a link ending with .png, .jpeg, or .jpg, starting with \ + https://, and hosted on Catbox, Imgbox, Gyazo, Lensdump, or F-List.', + component: FeatureShortTextInput, +}; + +export const art_ref_nsfw: FeatureToggle = { + name: 'Art Reference NSFW', + description: 'Is your reference picture NSFW?', + component: CheckboxInput, +};