Skip to content

Commit

Permalink
Refactor IS_IN_RECT to fuck your mom
Browse files Browse the repository at this point in the history
  • Loading branch information
Superlagg committed Aug 11, 2024
1 parent d0b9840 commit 88be652
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 6 additions & 1 deletion code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -739,7 +744,7 @@ SUBSYSTEM_DEF(chat)
// now the body - the BottomBox
if(giv_body)
cum += "<div style='width: 100%; background: linear-gradient([bbangle]deg, [bbc_1], [bbc_2]); border: [bbbs]px [bbbt] [bbbc]; padding: 2px; display: flex; flex-direction: column;'>"
cum += "<p style='font-weight: bold; margin: 0;'>[m_name] <span style='[nobold_verb? "font-weight: normal" : ""] font-style: italic; color: [dtc];'>[m_verb]</span></p>"
cum += "<p style='font-weight: bold; margin: 0;'>[m_name] <span style='[nobold_verb? "font-weight: normal;" : ""] font-style: italic; color: [dtc];'>[m_verb]</span></p>"
if(!nomessage)
cum += "<p style='margin: 0; color: [dtc]; id='Message'>[m_message]</p>"
cum += "</div>"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tgui/packages/tgui/interfaces/HornyChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,6 @@ const HelpTab = (props, context) => {
);
};



/*
ANATOMY OF THE Clipboard:
Clipboard is an object with a bunch of keys
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 88be652

Please sign in to comment.