From 88be652d08f582aac4c671bc53656b858162ea67 Mon Sep 17 00:00:00 2001 From: Superlagg Date: Sun, 11 Aug 2024 14:25:08 -0700 Subject: [PATCH] Refactor IS_IN_RECT to fuck your mom --- code/controllers/subsystem/chat.dm | 7 ++++++- code/modules/mob/say.dm | 4 ++++ tgui/packages/tgui/interfaces/HornyChat.js | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/code/controllers/subsystem/chat.dm b/code/controllers/subsystem/chat.dm index a088d8381e..5339e20f12 100644 --- a/code/controllers/subsystem/chat.dm +++ b/code/controllers/subsystem/chat.dm @@ -471,6 +471,8 @@ SUBSYSTEM_DEF(chat) var/vale = HP[mode][key] if(!vale || !(vale in borderstyles)) HP[mode][key] = GLOB.default_horny_settings[key] + if(mode == MODE_PROFILE_PIC) + HP[mode]["Suppress"] = TRUE P.mommychat_settings = HP P.save_character() @@ -537,6 +539,9 @@ SUBSYSTEM_DEF(chat) msg = "[msg][message_mode]" // to catch any custom modes var/datum/rental_mommy/chat/mommy = D.say(msg, direct_to_mob = target) + if(!mommy) + SSdummy.return_dummy(D) + CRASH("PreviewHornyFurryDatingSimMessage called, but Mommy was not created!") mommy.prefs_override = P mommy.dummy = TRUE var/mommess = BuildHornyFurryDatingSimMessage(mommy, TRUE) @@ -739,7 +744,7 @@ SUBSYSTEM_DEF(chat) // now the body - the BottomBox if(giv_body) cum += "
" - cum += "

[m_name] [m_verb]

" + cum += "

[m_name] [m_verb]

" if(!nomessage) cum += "

[m_message]

" cum += "
" diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index 4cdfd753d4..14f9d178c3 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -175,6 +175,10 @@ return LINGHIVE_NONE /mob/proc/get_message_mode(message) + //regex to catch something like :bungus: or :skub: , alphanumeric, no spaces, no punctuation + var/regex/emoji_regex = regex(@":[a-zA-Z0-9]+:", "i") + if(emoji_regex.Find(message)) + return // VisualChat (HornyChat, MommyChat, CoolChat, etc.) will handle the message mode var/key = message[1] if(key == "#") return MODE_WHISPER diff --git a/tgui/packages/tgui/interfaces/HornyChat.js b/tgui/packages/tgui/interfaces/HornyChat.js index cb2c3b2e1c..66503f751b 100644 --- a/tgui/packages/tgui/interfaces/HornyChat.js +++ b/tgui/packages/tgui/interfaces/HornyChat.js @@ -783,8 +783,6 @@ const HelpTab = (props, context) => { ); }; - - /* ANATOMY OF THE Clipboard: Clipboard is an object with a bunch of keys @@ -1199,10 +1197,11 @@ const MessageAppearanceTab = (props, context) => { setSettingsModeSelected, ] = useLocalState(context, 'SettingsModeSelected', "Profile Box"); - // extract a list of message modes from the UserImages - const PreMessageModes = UserImages.map(PFPentry => PFPentry.Mode); - // remove any entries where Suppress is true; - const MessageModes = PreMessageModes.filter(Mode => !Mode.Suppress); + // extract a list of message modes from the UserImages, but only the ones + // where Suppress is not true + const MessageModes = UserImages + .filter(Mode => !Mode.Suppress) + .map(Mode => Mode.Mode); // Objectify the settings as key => array of settings const ValidSettings = { @@ -1246,6 +1245,7 @@ const MessageAppearanceTab = (props, context) => { // and all will be yiff yiff const SettingsToUse = ValidSettings[SettingsModeSelected] // the reason we use [] instead of . is because we need to use a variable key .find(Setting => Setting.Mode === MsgModeTabSelected); + // filter out any Suppressed settings const LeftColumn = SettingsToUse .Settings // filter() returns an array, so we can chain map() to it .filter(Setting => Setting.Loc === "L");