From 4811dfbe6e7324285d8bc7b16e55067ff6cc312d Mon Sep 17 00:00:00 2001 From: VerySoft Date: Fri, 11 Aug 2023 05:04:33 -0400 Subject: [PATCH] Custom Link! Allows one to set a custom link to show up in their examine text! One thing people used the OOC notes for was to post image/flist links in the chat and get clickable links! Since the OOC panel is a thing now, I thought it would be good to enshrine that function into something that's specifically for it. This allows you to enter an extra 100 character string underneath your flavortext in your examine text, which can technically be anything, but it's intended to be space for links to show up and be clickable! --- .../preference_setup/general/06_flavor.dm | 13 ++++++++++++- code/modules/client/preferences.dm | 1 + code/modules/mob/living/carbon/human/examine.dm | 3 +++ code/modules/mob/living/living_defines_vr.dm | 1 + code/modules/mob/living/living_vr.dm | 17 +++++++++++++++++ code/modules/vore/eating/living_vr.dm | 3 +++ 6 files changed, 37 insertions(+), 1 deletion(-) diff --git a/code/modules/client/preference_setup/general/06_flavor.dm b/code/modules/client/preference_setup/general/06_flavor.dm index f95fb12abf..20ab615e78 100644 --- a/code/modules/client/preference_setup/general/06_flavor.dm +++ b/code/modules/client/preference_setup/general/06_flavor.dm @@ -12,7 +12,7 @@ S["flavor_texts_hands"] >> pref.flavor_texts["hands"] S["flavor_texts_legs"] >> pref.flavor_texts["legs"] S["flavor_texts_feet"] >> pref.flavor_texts["feet"] - + S["custom_link"] >> pref.custom_link //Flavour text for robots. S["flavour_texts_robot_Default"] >> pref.flavour_texts_robot["Default"] for(var/module in robot_module_types) @@ -28,6 +28,7 @@ S["flavor_texts_hands"] << pref.flavor_texts["hands"] S["flavor_texts_legs"] << pref.flavor_texts["legs"] S["flavor_texts_feet"] << pref.flavor_texts["feet"] + S["custom_link"] << pref.custom_link S["flavour_texts_robot_Default"] << pref.flavour_texts_robot["Default"] for(var/module in robot_module_types) @@ -50,11 +51,13 @@ character.ooc_notes = pref.metadata //VOREStation Add character.ooc_notes_likes = pref.metadata_likes character.ooc_notes_dislikes = pref.metadata_dislikes + character.custom_link = pref.custom_link /datum/category_item/player_setup_item/general/flavor/content(var/mob/user) . += "Flavor:
" . += "Set Flavor Text
" . += "Set Robot Flavor Text
" + . += "Set Custom Link
" /datum/category_item/player_setup_item/general/flavor/OnTopic(var/href,var/list/href_list, var/mob/user) if(href_list["flavor_text"]) @@ -84,6 +87,14 @@ pref.flavour_texts_robot[href_list["flavour_text_robot"]] = msg SetFlavourTextRobot(user) return TOPIC_HANDLED + else if(href_list["custom_link"]) + var/new_link = strip_html_simple(tgui_input_text(usr, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(pref.custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE)) + if(new_link && CanUseTopic(usr)) + if(length(new_link) > 100) + to_chat(usr, "Your entry is too long, it must be 100 characters or less.") + return + pref.custom_link = new_link + log_admin("[usr]/[usr.ckey] set their custom link to [pref.custom_link]") return ..() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4fc14f8ccd..64633791ff 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -130,6 +130,7 @@ var/list/preferences_datums = list() var/list/flavor_texts = list() var/list/flavour_texts_robot = list() + var/custom_link = null var/list/body_descriptors = list() diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 8d6de4cc0c..83cb6fae65 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -431,6 +431,9 @@ msg += "[flavor_text]" // VOREStation Start + if(custom_link) + msg += "Custom link: [custom_link]" + if(ooc_notes) msg += "OOC Notes: \[View\]" msg += "\[Mechanical Vore Preferences\]" diff --git a/code/modules/mob/living/living_defines_vr.dm b/code/modules/mob/living/living_defines_vr.dm index 91f0af6cde..520f094d66 100644 --- a/code/modules/mob/living/living_defines_vr.dm +++ b/code/modules/mob/living/living_defines_vr.dm @@ -7,6 +7,7 @@ var/ooc_notes = null var/ooc_notes_likes = null var/ooc_notes_dislikes = null + var/custom_link = null appearance_flags = TILE_BOUND|PIXEL_SCALE|KEEP_TOGETHER|LONG_GLIDE var/hunger_rate = DEFAULT_HUNGER_FACTOR //custom say verbs diff --git a/code/modules/mob/living/living_vr.dm b/code/modules/mob/living/living_vr.dm index a9ec8eef3a..beefd1f974 100644 --- a/code/modules/mob/living/living_vr.dm +++ b/code/modules/mob/living/living_vr.dm @@ -58,6 +58,7 @@ to_chat(usr, "OOC note dislikes have been updated. Don't forget to save!") log_admin("[key_name(usr)] updated their OOC note dislikes mid-round.") ooc_notes_window(usr) + /mob/living/proc/save_ooc_panel() if(usr != src) return @@ -67,6 +68,22 @@ if(client.prefs.save_character()) to_chat(usr, "Character preferences saved.") +/mob/living/verb/set_custom_link() + set name = "Set Custom Link" + set desc = "Set a custom link to show up with your examine text." + set category = "IC" + + if(usr != src) + return + var/new_link = strip_html_simple(tgui_input_text(usr, "Enter a link to add on to your examine text! This should be a related image link/gallery, or things like your F-list. This is not the place for memes.", "Custom Link" , html_decode(custom_link), max_length = 100, encode = TRUE, prevent_enter = TRUE)) + if(new_link && CanUseTopic(usr)) + if(length(new_link) > 100) + to_chat(usr, "Your entry is too long, it must be 100 characters or less.") + return + + custom_link = new_link + to_chat(usr, "Link set: [custom_link]") + log_admin("[usr]/[usr.ckey] set their custom link to [custom_link]") /mob/living/verb/set_voice_freq() set name = "Set Voice Frequency" diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 2fe45146a7..eeb016f4b9 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -1057,10 +1057,13 @@ /mob/living/examine(mob/user, infix, suffix) . = ..() + if(custom_link) + . += "Custom link: [custom_link]" if(ooc_notes) . += "OOC Notes: \[View\]" . += "\[Mechanical Vore Preferences\]" + /mob/living/Topic(href, href_list) //Can't find any instances of Topic() being overridden by /mob/living in polaris' base code, even though /mob/living/carbon/human's Topic() has a ..() call if(href_list["vore_prefs"]) display_voreprefs(usr)