From faf52ecce2ca090cc83ff8bbefe7a8660cd89c11 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Tue, 27 May 2025 19:45:30 +0200 Subject: [PATCH] vorepanel reloaded (#17723) * vorepanel rework part 1 * finish first tab * those should be fine * . * floating for the addons * . * tooltip prep and style * while on it * prep data compile for tab 2 rework * message tab * undef * . * some more components * unify the mesage procs * option tab preps * tooltip prep * small fixes * sorting * some more preps * . * move that * move that * finish options tab * sound preps * sound preps * finish sound tab * visual tab prep * . * visual tab prep2 * visual * move that * interaction tab prep * interactions * interaction tab * more basic contents only for now * defaulted * . * . * clean up * liquid tab * wordng * make it the same * soulcatcher tab * prefs * crash save * typing * docs * . * sanitize corrupted save data * use the right type --- code/__defines/belly_messages.dm | 38 +- code/__defines/vore.dm | 23 +- code/modules/vore/eating/belly_import.dm | 236 +- code/modules/vore/eating/belly_messages.dm | 36 +- code/modules/vore/eating/belly_obj_liquids.dm | 59 - code/modules/vore/eating/digest_act_vr.dm | 2 +- code/modules/vore/eating/mob_vr.dm | 1 - .../panel_databackend/vorepanel_pref_data.dm | 111 + .../vorepanel_set_attribute.dm | 1031 ++++++++ .../vorepanel_set_liqattribute.dm | 215 ++ .../vorepanel_soulcatcher_data.dm | 99 + .../panel_databackend/vorepanel_vore_data.dm | 328 +++ .../vorepanel_vore_subdata.dm | 759 ++++++ code/modules/vore/eating/soulcatcher.dm | 19 +- code/modules/vore/eating/vorepanel_vr.dm | 2205 ++--------------- code/modules/vore/mob_tf.dm | 1 - tgui/packages/tgui-bench/package.json | 2 +- tgui/packages/tgui-panel/package.json | 2 +- tgui/packages/tgui-say/package.json | 2 +- tgui/packages/tgui/interfaces/AlertModal.tsx | 2 +- tgui/packages/tgui/interfaces/AlgaeFarm.tsx | 2 +- .../packages/tgui/interfaces/BotanyEditor.tsx | 4 +- .../tgui/interfaces/BotanyIsolator.tsx | 16 +- tgui/packages/tgui/interfaces/LateChoices.tsx | 2 +- .../ModifyRobot/ModifyRobotNoModule.tsx | 2 +- .../interfaces/ModifyRobot/components.tsx | 2 +- .../tgui/interfaces/PathogenicIsolator.tsx | 2 +- .../WikiPages/WIkiDonationbanner.tsx | 2 +- .../interfaces/PublicLibraryWiki/index.tsx | 2 +- .../tgui/interfaces/TelecommsLogBrowser.tsx | 2 +- .../interfaces/TelecommsMachineBrowser.tsx | 2 +- .../VorePanel/FeatureColorInput.tsx | 40 - .../interfaces/VorePanel/LiquidColorInput.tsx | 37 - .../interfaces/VorePanel/VoreAbilities.tsx | 57 - .../VorePanel/VoreContentsPanel.tsx | 101 - .../VorePanelCommonElements.tsx | 49 + .../VorePanelEditCheckboxes.tsx | 86 + .../VorePanelElements/VorePanelEditColor.tsx | 83 + .../VorePanelEditDropdown.tsx | 72 + .../VorePanelElements/VorePanelEditNumber.tsx | 91 + .../VorePanelElements/VorePanelEditSwitch.tsx | 68 + .../VorePanelElements/VorePanelEditText.tsx | 72 + .../VorePanelElements/VorePanelTextArea.tsx | 247 ++ .../VorePaneldEditTextTabs.tsx | 125 + .../VoreUserPreferenceItem.tsx | 2 +- .../VorePanelMainTabs/VoreAbilities.tsx | 66 + .../VoreBellySelectionAndCustomization.tsx | 73 +- .../VoreInsidePanel.tsx | 21 +- .../VorePanelMainTabs/VoreSelectedBelly.tsx | 135 + .../VorePanelMainTabs/VoreSoulcatcher.tsx | 209 ++ .../VorePanelMainTabs/VoreUserGeneral.tsx | 56 + .../VoreUserPreferences.tsx | 72 +- .../VorePanel/VoreSelectedBelly.tsx | 88 - ...VoreSelectedBellyDescriptionsBellymode.tsx | 83 - .../VoreSelectedBellyDescriptionsEscape.tsx | 203 -- .../VoreSelectedBellyDescriptionsIdle.tsx | 170 -- ...ctedBellyDescriptionsInteractionChance.tsx | 77 - .../VoreSelectedBellyDescriptionsStruggle.tsx | 49 - .../VoreSelectedBellyDescriptionsTransfer.tsx | 134 - .../VoreSelectedBellyDescriptionMatrix.tsx | 205 ++ .../InteractionTab/AutoTransferOptions.tsx | 151 ++ .../LiquidTab/LiquidOptionsLeft.tsx | 220 ++ .../LiquidTab/LiquidOptionsRight.tsx | 129 + .../OptionTab/BellyOptionsLeft.tsx | 195 ++ .../OptionTab/BellyOptionsRight.tsx | 236 ++ .../VisualTab/BellyFullscreenSelection.tsx | 78 + .../VisualTab/VoreSelecetedWhitelist.tsx | 74 + .../VoreSelectedMobTypeBellyButtons.tsx | 35 +- .../VisualTab/VoreSpriteAffect.tsx | 247 ++ .../VoreContentsPanel.tsx | 158 ++ .../VoreSelectedBellyControls.tsx | 170 +- .../VoreSelectedBellyDescriptions.tsx | 348 +-- .../VoreSelectedBellyInteractions.tsx | 636 ++--- .../VoreSelectedBellyLiquidMessages.tsx | 181 -- .../VoreSelectedBellyLiquidOptions.tsx | 374 +-- .../VoreSelectedBellyOptions.tsx | 370 +-- .../VoreSelectedBellySounds.tsx | 208 +- .../VoreSelectedBellyVisuals.tsx | 501 ++-- .../interfaces/VorePanel/VoreSoulcatcher.tsx | 198 -- .../VoreSoulcatcherSettings/CatchSettings.tsx | 7 +- .../GlobalSettings.tsx | 8 + .../VoreSoulcatcherSettings/SoulOptions.tsx | 4 +- .../VoreUserPreferencesAesthetic.tsx | 204 +- .../VoreUserPreferencesDevouring.tsx | 2 +- .../VoreUserPreferencesMechanical.tsx | 2 +- .../VoreUserPreferencesSoulcatcher.tsx | 2 +- .../VoreUserPreferencesSpawn.tsx | 2 +- .../VoreUserPreferencesSpontaneous.tsx | 2 +- .../tgui/interfaces/VorePanel/constants.ts | 89 + .../tgui/interfaces/VorePanel/functions.ts | 67 + .../tgui/interfaces/VorePanel/index.tsx | 59 +- .../tgui/interfaces/VorePanel/types.ts | 324 ++- .../tgui/interfaces/VorePanelExport/index.tsx | 6 - tgui/packages/tgui/package.json | 2 +- .../tgui/styles/interfaces/VorePanel.scss | 41 + tgui/packages/tgui/styles/main.scss | 1 + tgui/yarn.lock | 16 +- vorestation.dme | 6 + 98 files changed, 7624 insertions(+), 5709 deletions(-) create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_pref_data.dm create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_set_attribute.dm create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_set_liqattribute.dm create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_soulcatcher_data.dm create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_vore_data.dm create mode 100644 code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/FeatureColorInput.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/LiquidColorInput.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreAbilities.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreContentsPanel.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelCommonElements.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditCheckboxes.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditColor.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditDropdown.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditNumber.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditSwitch.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditText.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelTextArea.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePaneldEditTextTabs.tsx rename tgui/packages/tgui/interfaces/VorePanel/{ => VorePanelElements}/VoreUserPreferenceItem.tsx (94%) create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreAbilities.tsx rename tgui/packages/tgui/interfaces/VorePanel/{ => VorePanelMainTabs}/VoreBellySelectionAndCustomization.tsx (57%) rename tgui/packages/tgui/interfaces/VorePanel/{ => VorePanelMainTabs}/VoreInsidePanel.tsx (80%) create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreSelectedBelly.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreSoulcatcher.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreUserGeneral.tsx rename tgui/packages/tgui/interfaces/VorePanel/{ => VorePanelMainTabs}/VoreUserPreferences.tsx (90%) delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBelly.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsBellymode.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsEscape.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsIdle.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsInteractionChance.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsStruggle.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyDescriptionTexts/VoreSelectedBellyDescriptionsTransfer.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/DescriptionTab/VoreSelectedBellyDescriptionMatrix.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/InteractionTab/AutoTransferOptions.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/LiquidTab/LiquidOptionsLeft.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/LiquidTab/LiquidOptionsRight.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/OptionTab/BellyOptionsLeft.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/OptionTab/BellyOptionsRight.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VisualTab/BellyFullscreenSelection.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VisualTab/VoreSelecetedWhitelist.tsx rename tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/{ => VisualTab}/VoreSelectedMobTypeBellyButtons.tsx (57%) create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VisualTab/VoreSpriteAffect.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreContentsPanel.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreSelectedBellyLiquidMessages.tsx delete mode 100644 tgui/packages/tgui/interfaces/VorePanel/VoreSoulcatcher.tsx create mode 100644 tgui/packages/tgui/interfaces/VorePanel/functions.ts create mode 100644 tgui/packages/tgui/styles/interfaces/VorePanel.scss diff --git a/code/__defines/belly_messages.dm b/code/__defines/belly_messages.dm index 030665e286..05cbc7d547 100644 --- a/code/__defines/belly_messages.dm +++ b/code/__defines/belly_messages.dm @@ -1,5 +1,8 @@ -// Vore belly options +// Descriptions +#define BELLY_DESCRIPTION_MESSAGE "b_desc" +#define BELLY_DESCRIPTION_MESSAGE_ABSROED "b_absorbed_desc" +// Vore belly options #define STRUGGLE_OUTSIDE "smo" #define STRUGGLE_INSIDE "smi" @@ -27,8 +30,8 @@ #define ABSORBED_ESCAPE_PREY "aescp" #define ABSORBED_ESCAPE_OUTSIDE "aescout" -#define FULL_ABSORBED_ESCAPE_OWNER "aescfo" -#define FULL_ABSORBED_ESCAPE_PREY "aescfp" +#define ABSORBED_ESCAPE_FAIL_OWNER "aescfo" +#define ABSORBED_ESCAPE_FAIL_PREY "aescfp" #define PRIMARY_TRANSFER_OWNER "trnspo" #define PRIMARY_TRANSFER_PREY "trnspp" @@ -75,12 +78,37 @@ #define BELLY_TRASH_EATER_IN "te_in" #define BELLY_TRASH_EATER_OUT "te_out" +#define BELLY_LIQUID_MESSAGE1 "full1" +#define BELLY_LIQUID_MESSAGE2 "full2" +#define BELLY_LIQUID_MESSAGE3 "full3" +#define BELLY_LIQUID_MESSAGE4 "full4" +#define BELLY_LIQUID_MESSAGE5 "full5" + #define VB_MESSAGE_SANITY(type) ASSERT(type == STRUGGLE_OUTSIDE || type == STRUGGLE_INSIDE || type == ABSORBED_STRUGGLE_OUSIDE || type == ABSORBED_STRUGGLE_INSIDE || type == ESCAPE_ATTEMPT_OWNER || type == ESCAPE_ATTEMPT_PREY ||\ type == ESCAPE_PREY || type == ESCAPE_OWNER || type == ESCAPE_OUTSIDE || type == ESCAPE_ITEM_PREY || type == ESCAPE_ITEM_OWNER || type == ESCAPE_ITEM_OUTSIDE || type == ESCAPE_FAIL_PREY ||\ type == ESCAPE_FAIL_OWNER || type == ABSORBED_ESCAPE_ATTEMPT_OWNER || type == ABSORBED_ESCAPE_ATTEMPT_PREY || type == ABSORBED_ESCAPE_PREY || type == ABSORBED_ESCAPE_OWNER ||\ - type == ABSORBED_ESCAPE_OUTSIDE || type == FULL_ABSORBED_ESCAPE_PREY || type == FULL_ABSORBED_ESCAPE_OWNER || type == PRIMARY_TRANSFER_PREY || type == PRIMARY_TRANSFER_OWNER ||\ + type == ABSORBED_ESCAPE_OUTSIDE || type == ABSORBED_ESCAPE_FAIL_PREY || type == ABSORBED_ESCAPE_FAIL_OWNER || type == PRIMARY_TRANSFER_PREY || type == PRIMARY_TRANSFER_OWNER ||\ type == SECONDARY_TRANSFER_PREY || type == SECONDARY_TRANSFER_OWNER || type == PRIMARY_AUTO_TRANSFER_PREY || type == PRIMARY_AUTO_TRANSFER_OWNER || type == SECONDARY_AUTO_TRANSFER_PREY ||\ type == SECONDARY_AUTO_TRANSFER_OWNER || type == DIGEST_CHANCE_PREY || type == DIGEST_CHANCE_OWNER || type == ABSORB_CHANCE_PREY || type == ABSORB_CHANCE_OWNER || type == DIGEST_OWNER ||\ type == DIGEST_PREY || type == ABSORB_OWNER || type == ABSORB_PREY || type == UNABSORBS_OWNER || type == UNABSORBS_PREY || type == EXAMINES || type == EXAMINES_ABSORBED ||\ type == BELLY_MODE_DIGEST || type == BELLY_MODE_HOLD || type == BELLY_MODE_HOLD_ABSORB || type == BELLY_MODE_ABSORB || type == BELLY_MODE_HEAL || type == BELLY_MODE_DRAIN ||\ - type == BELLY_MODE_STEAL || type == BELLY_MODE_EGG || type == BELLY_MODE_SHRINK || type == BELLY_MODE_GROW || type == BELLY_MODE_UNABSORB || type == BELLY_TRASH_EATER_IN || type==BELLY_TRASH_EATER_OUT) + type == BELLY_MODE_STEAL || type == BELLY_MODE_EGG || type == BELLY_MODE_SHRINK || type == BELLY_MODE_GROW || type == BELLY_MODE_UNABSORB || type == BELLY_TRASH_EATER_IN || type==BELLY_TRASH_EATER_OUT ||\ + type == BELLY_LIQUID_MESSAGE1 || type == BELLY_LIQUID_MESSAGE2 || type == BELLY_LIQUID_MESSAGE3 || type == BELLY_LIQUID_MESSAGE4 || type == BELLY_LIQUID_MESSAGE5) + +// Soulcatcher Message Options +#define SC_INTERIOR_MESSAGE "sc_int" +#define SC_CAPTURE_MEESAGE "sc_cap" +#define SC_TRANSIT_MESSAGE "sc_transit" +#define SC_RELEASE_MESSAGE "sc_rel" +#define SC_TRANSFERE_MESSAGE "sc_transfer" +#define SC_DELETE_MESSAGE "sc_del" + +// General Message Options +#define TASTE_FLAVOR "setflavor" +#define SMELL_FLAVOR "setsmell" + +// General Examine Messages +#define GENERAL_EXAMINE_NUTRI "en" +#define GENERAL_EXAMINE_WEIGHT "ew" + +#define VPPREF_MESSAGE_SANITY(type) ASSERT(type == GENERAL_EXAMINE_NUTRI || type == GENERAL_EXAMINE_WEIGHT) diff --git a/code/__defines/vore.dm b/code/__defines/vore.dm index 63859a80e4..c4e5349ff7 100644 --- a/code/__defines/vore.dm +++ b/code/__defines/vore.dm @@ -9,7 +9,28 @@ #define BELLIES_MAX 40 #define BELLIES_NAME_MIN 2 #define BELLIES_NAME_MAX 40 -#define BELLIES_DESC_MAX 4096 +#define BELLIES_DESC_MAX 8192 +#define BELLIES_EXAMINE_MAX 2048 +#define BELLIES_IDLE_MAX 2048 +#define BELLIES_MESSAGE_MAX 1024 +#define BELLIES_MESSAGE_COMBINED 1024 * 10 + 18 #define FLAVOR_MAX 400 +#define VORE_SC_MAX 2048 +#define VORE_SC_DESC_MAX 8192 + #define VORE_VERSION 2 //This is a Define so you don't have to worry about magic numbers. + +#define VPANEL_DESCRIPTION_TAB 0 +#define VPANEL_EXAMINE_TAB 1 +#define VPANEL_TRASH_EATER_TAB 2 +#define VPANEL_STRUGGLE_TAB 3 +#define VPANEL_ESCAPE_TAB 4 +#define VPANEL_ESCAPE_ABSORBED_TAB 5 +#define VPANEL_TRANSFER_TAB 6 +#define VPANEL_INTERACTION_TAB 7 +#define VPANEL_BELLYMODE_TAB 8 +#define VPANEL_IDLE_TAB 9 +#define VPANEL_LIQUIDS_TAB 10 + +#define VORE_RESIZE_COST 125 diff --git a/code/modules/vore/eating/belly_import.dm b/code/modules/vore/eating/belly_import.dm index 4952d78a29..d7d1b874fa 100644 --- a/code/modules/vore/eating/belly_import.dm +++ b/code/modules/vore/eating/belly_import.dm @@ -156,274 +156,274 @@ new_belly.release_verb = new_release_verb if(islist(belly_data["digest_messages_prey"])) - var/new_digest_messages_prey = sanitize(jointext(belly_data["digest_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_digest_messages_prey = sanitize(jointext(belly_data["digest_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_digest_messages_prey) - new_belly.set_messages(new_digest_messages_prey,DIGEST_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_digest_messages_prey,DIGEST_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["digest_messages_owner"])) - var/new_digest_messages_owner = sanitize(jointext(belly_data["digest_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_digest_messages_owner = sanitize(jointext(belly_data["digest_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_digest_messages_owner) - new_belly.set_messages(new_digest_messages_owner,DIGEST_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_digest_messages_owner,DIGEST_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorb_messages_prey"])) - var/new_absorb_messages_prey = sanitize(jointext(belly_data["absorb_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorb_messages_prey = sanitize(jointext(belly_data["absorb_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorb_messages_prey) - new_belly.set_messages(new_absorb_messages_prey,ABSORB_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorb_messages_prey,ABSORB_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorb_messages_owner"])) - var/new_absorb_messages_owner = sanitize(jointext(belly_data["absorb_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorb_messages_owner = sanitize(jointext(belly_data["absorb_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorb_messages_owner) - new_belly.set_messages(new_absorb_messages_owner,ABSORB_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorb_messages_owner,ABSORB_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["unabsorb_messages_prey"])) - var/new_unabsorb_messages_prey = sanitize(jointext(belly_data["unabsorb_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_unabsorb_messages_prey = sanitize(jointext(belly_data["unabsorb_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_unabsorb_messages_prey) - new_belly.set_messages(new_unabsorb_messages_prey,UNABSORBS_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_unabsorb_messages_prey,UNABSORBS_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["unabsorb_messages_owner"])) - var/new_unabsorb_messages_owner = sanitize(jointext(belly_data["unabsorb_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_unabsorb_messages_owner = sanitize(jointext(belly_data["unabsorb_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_unabsorb_messages_owner) - new_belly.set_messages(new_unabsorb_messages_owner,UNABSORBS_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_unabsorb_messages_owner,UNABSORBS_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["struggle_messages_outside"])) - var/new_struggle_messages_outside = sanitize(jointext(belly_data["struggle_messages_outside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_struggle_messages_outside = sanitize(jointext(belly_data["struggle_messages_outside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_struggle_messages_outside) - new_belly.set_messages(new_struggle_messages_outside,STRUGGLE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_struggle_messages_outside,STRUGGLE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["struggle_messages_inside"])) - var/new_struggle_messages_inside = sanitize(jointext(belly_data["struggle_messages_inside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_struggle_messages_inside = sanitize(jointext(belly_data["struggle_messages_inside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_struggle_messages_inside) - new_belly.set_messages(new_struggle_messages_inside,STRUGGLE_INSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_struggle_messages_inside,STRUGGLE_INSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorbed_struggle_messages_outside"])) - var/new_absorbed_struggle_messages_outside = sanitize(jointext(belly_data["absorbed_struggle_messages_outside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorbed_struggle_messages_outside = sanitize(jointext(belly_data["absorbed_struggle_messages_outside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorbed_struggle_messages_outside) - new_belly.set_messages(new_absorbed_struggle_messages_outside,ABSORBED_STRUGGLE_OUSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorbed_struggle_messages_outside,ABSORBED_STRUGGLE_OUSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorbed_struggle_messages_inside"])) - var/new_absorbed_struggle_messages_inside = sanitize(jointext(belly_data["absorbed_struggle_messages_inside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorbed_struggle_messages_inside = sanitize(jointext(belly_data["absorbed_struggle_messages_inside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorbed_struggle_messages_inside) - new_belly.set_messages(new_absorbed_struggle_messages_inside,ABSORBED_STRUGGLE_INSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorbed_struggle_messages_inside,ABSORBED_STRUGGLE_INSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_attempt_messages_prey"])) - var/new_escape_attempt_messages_prey = sanitize(jointext(belly_data["escape_attempt_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_attempt_messages_prey = sanitize(jointext(belly_data["escape_attempt_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_attempt_messages_prey) - new_belly.set_messages(new_escape_attempt_messages_prey,ESCAPE_ATTEMPT_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_attempt_messages_prey,ESCAPE_ATTEMPT_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_attempt_messages_owner"])) - var/new_escape_attempt_messages_owner = sanitize(jointext(belly_data["escape_attempt_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_attempt_messages_owner = sanitize(jointext(belly_data["escape_attempt_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_attempt_messages_owner) - new_belly.set_messages(new_escape_attempt_messages_owner,ESCAPE_ATTEMPT_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_attempt_messages_owner,ESCAPE_ATTEMPT_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_messages_prey"])) - var/new_escape_messages_prey = sanitize(jointext(belly_data["escape_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_messages_prey = sanitize(jointext(belly_data["escape_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_messages_prey) - new_belly.set_messages(new_escape_messages_prey,ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_messages_prey,ESCAPE_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_messages_owner"])) - var/new_escape_messages_owner = sanitize(jointext(belly_data["escape_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_messages_owner = sanitize(jointext(belly_data["escape_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_messages_owner) - new_belly.set_messages(new_escape_messages_owner,ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_messages_owner,ESCAPE_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_messages_outside"])) - var/new_escape_messages_outside = sanitize(jointext(belly_data["escape_messages_outside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_messages_outside = sanitize(jointext(belly_data["escape_messages_outside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_messages_outside) - new_belly.set_messages(new_escape_messages_outside,ESCAPE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_messages_outside,ESCAPE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_item_messages_prey"])) - var/new_escape_item_messages_prey = sanitize(jointext(belly_data["escape_item_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_item_messages_prey = sanitize(jointext(belly_data["escape_item_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_item_messages_prey) - new_belly.set_messages(new_escape_item_messages_prey,ESCAPE_ITEM_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_item_messages_prey,ESCAPE_ITEM_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_item_messages_owner"])) - var/new_escape_item_messages_owner = sanitize(jointext(belly_data["escape_item_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_item_messages_owner = sanitize(jointext(belly_data["escape_item_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_item_messages_owner) - new_belly.set_messages(new_escape_item_messages_owner,ESCAPE_ITEM_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_item_messages_owner,ESCAPE_ITEM_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_item_messages_outside"])) - var/new_escape_item_messages_outside = sanitize(jointext(belly_data["escape_item_messages_outside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_item_messages_outside = sanitize(jointext(belly_data["escape_item_messages_outside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_item_messages_outside) - new_belly.set_messages(new_escape_item_messages_outside,ESCAPE_ITEM_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_item_messages_outside,ESCAPE_ITEM_OUTSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_fail_messages_prey"])) - var/new_escape_fail_messages_prey = sanitize(jointext(belly_data["escape_fail_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_fail_messages_prey = sanitize(jointext(belly_data["escape_fail_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_fail_messages_prey) - new_belly.set_messages(new_escape_fail_messages_prey,ESCAPE_FAIL_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_fail_messages_prey,ESCAPE_FAIL_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_fail_messages_owner"])) - var/new_escape_fail_messages_owner = sanitize(jointext(belly_data["escape_fail_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_fail_messages_owner = sanitize(jointext(belly_data["escape_fail_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_fail_messages_owner) - new_belly.set_messages(new_escape_fail_messages_owner,ESCAPE_FAIL_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_fail_messages_owner,ESCAPE_FAIL_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_attempt_absorbed_messages_prey"])) - var/new_escape_attempt_absorbed_messages_prey = sanitize(jointext(belly_data["escape_attempt_absorbed_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_attempt_absorbed_messages_prey = sanitize(jointext(belly_data["escape_attempt_absorbed_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_attempt_absorbed_messages_prey) - new_belly.set_messages(new_escape_attempt_absorbed_messages_prey,ABSORBED_ESCAPE_ATTEMPT_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_attempt_absorbed_messages_prey,ABSORBED_ESCAPE_ATTEMPT_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_attempt_absorbed_messages_owner"])) - var/new_escape_attempt_absorbed_messages_owner = sanitize(jointext(belly_data["escape_attempt_absorbed_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_attempt_absorbed_messages_owner = sanitize(jointext(belly_data["escape_attempt_absorbed_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_attempt_absorbed_messages_owner) - new_belly.set_messages(new_escape_attempt_absorbed_messages_owner,ABSORBED_ESCAPE_ATTEMPT_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_attempt_absorbed_messages_owner,ABSORBED_ESCAPE_ATTEMPT_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_absorbed_messages_prey"])) - var/new_escape_absorbed_messages_prey = sanitize(jointext(belly_data["escape_absorbed_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_absorbed_messages_prey = sanitize(jointext(belly_data["escape_absorbed_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_absorbed_messages_prey) - new_belly.set_messages(new_escape_absorbed_messages_prey,ABSORBED_ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_absorbed_messages_prey,ABSORBED_ESCAPE_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_absorbed_messages_owner"])) - var/new_escape_absorbed_messages_owner = sanitize(jointext(belly_data["escape_absorbed_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_absorbed_messages_owner = sanitize(jointext(belly_data["escape_absorbed_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_absorbed_messages_owner) - new_belly.set_messages(new_escape_absorbed_messages_owner,ABSORBED_ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_absorbed_messages_owner,ABSORBED_ESCAPE_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_absorbed_messages_outside"])) - var/new_escape_absorbed_messages_outside = sanitize(jointext(belly_data["escape_absorbed_messages_outside"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_absorbed_messages_outside = sanitize(jointext(belly_data["escape_absorbed_messages_outside"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_absorbed_messages_outside) - new_belly.set_messages(new_escape_absorbed_messages_outside,ABSORBED_ESCAPE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_absorbed_messages_outside,ABSORBED_ESCAPE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_fail_absorbed_messages_prey"])) - var/new_escape_fail_absorbed_messages_prey = sanitize(jointext(belly_data["escape_fail_absorbed_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_fail_absorbed_messages_prey = sanitize(jointext(belly_data["escape_fail_absorbed_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_fail_absorbed_messages_prey) - new_belly.set_messages(new_escape_fail_absorbed_messages_prey,FULL_ABSORBED_ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_fail_absorbed_messages_prey,ABSORBED_ESCAPE_FAIL_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["escape_fail_absorbed_messages_owner"])) - var/new_escape_fail_absorbed_messages_owner = sanitize(jointext(belly_data["escape_fail_absorbed_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_escape_fail_absorbed_messages_owner = sanitize(jointext(belly_data["escape_fail_absorbed_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_escape_fail_absorbed_messages_owner) - new_belly.set_messages(new_escape_fail_absorbed_messages_owner,FULL_ABSORBED_ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_escape_fail_absorbed_messages_owner,ABSORBED_ESCAPE_FAIL_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["primary_transfer_messages_prey"])) - var/new_primary_transfer_messages_prey = sanitize(jointext(belly_data["primary_transfer_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_primary_transfer_messages_prey = sanitize(jointext(belly_data["primary_transfer_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_primary_transfer_messages_prey) - new_belly.set_messages(new_primary_transfer_messages_prey,PRIMARY_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_primary_transfer_messages_prey,PRIMARY_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["primary_transfer_messages_owner"])) - var/new_primary_transfer_messages_owner = sanitize(jointext(belly_data["primary_transfer_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_primary_transfer_messages_owner = sanitize(jointext(belly_data["primary_transfer_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_primary_transfer_messages_owner) - new_belly.set_messages(new_primary_transfer_messages_owner,PRIMARY_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_primary_transfer_messages_owner,PRIMARY_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["secondary_transfer_messages_prey"])) - var/new_secondary_transfer_messages_prey = sanitize(jointext(belly_data["secondary_transfer_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_secondary_transfer_messages_prey = sanitize(jointext(belly_data["secondary_transfer_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_secondary_transfer_messages_prey) - new_belly.set_messages(new_secondary_transfer_messages_prey,SECONDARY_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_secondary_transfer_messages_prey,SECONDARY_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["secondary_transfer_messages_owner"])) - var/new_secondary_transfer_messages_owner = sanitize(jointext(belly_data["secondary_transfer_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_secondary_transfer_messages_owner = sanitize(jointext(belly_data["secondary_transfer_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_secondary_transfer_messages_owner) - new_belly.set_messages(new_secondary_transfer_messages_owner,SECONDARY_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_secondary_transfer_messages_owner,SECONDARY_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["primary_autotransfer_messages_prey"])) - var/new_primary_autotransfer_messages_prey = sanitize(jointext(belly_data["primary_autotransfer_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_primary_autotransfer_messages_prey = sanitize(jointext(belly_data["primary_autotransfer_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_primary_autotransfer_messages_prey) - new_belly.set_messages(new_primary_autotransfer_messages_prey,PRIMARY_AUTO_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_primary_autotransfer_messages_prey,PRIMARY_AUTO_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["primary_autotransfer_messages_owner"])) - var/new_primary_autotransfer_messages_owner = sanitize(jointext(belly_data["primary_autotransfer_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_primary_autotransfer_messages_owner = sanitize(jointext(belly_data["primary_autotransfer_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_primary_autotransfer_messages_owner) - new_belly.set_messages(new_primary_autotransfer_messages_owner,PRIMARY_AUTO_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_primary_autotransfer_messages_owner,PRIMARY_AUTO_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["secondary_autotransfer_messages_prey"])) - var/new_secondary_autotransfer_messages_prey = sanitize(jointext(belly_data["secondary_autotransfer_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_secondary_autotransfer_messages_prey = sanitize(jointext(belly_data["secondary_autotransfer_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_secondary_autotransfer_messages_prey) - new_belly.set_messages(new_secondary_autotransfer_messages_prey,SECONDARY_AUTO_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_secondary_autotransfer_messages_prey,SECONDARY_AUTO_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["secondary_autotransfer_messages_owner"])) - var/new_secondary_autotransfer_messages_owner = sanitize(jointext(belly_data["secondary_autotransfer_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_secondary_autotransfer_messages_owner = sanitize(jointext(belly_data["secondary_autotransfer_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_secondary_autotransfer_messages_owner) - new_belly.set_messages(new_secondary_autotransfer_messages_owner,SECONDARY_AUTO_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_secondary_autotransfer_messages_owner,SECONDARY_AUTO_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["digest_chance_messages_prey"])) - var/new_digest_chance_messages_prey = sanitize(jointext(belly_data["digest_chance_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_digest_chance_messages_prey = sanitize(jointext(belly_data["digest_chance_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_digest_chance_messages_prey) - new_belly.set_messages(new_digest_chance_messages_prey,DIGEST_CHANCE_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_digest_chance_messages_prey,DIGEST_CHANCE_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["digest_chance_messages_owner"])) - var/new_digest_chance_messages_owner = sanitize(jointext(belly_data["digest_chance_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_digest_chance_messages_owner = sanitize(jointext(belly_data["digest_chance_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_digest_chance_messages_owner) - new_belly.set_messages(new_digest_chance_messages_owner,DIGEST_CHANCE_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_digest_chance_messages_owner,DIGEST_CHANCE_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorb_chance_messages_prey"])) - var/new_absorb_chance_messages_prey = sanitize(jointext(belly_data["absorb_chance_messages_prey"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorb_chance_messages_prey = sanitize(jointext(belly_data["absorb_chance_messages_prey"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorb_chance_messages_prey) - new_belly.set_messages(new_absorb_chance_messages_prey,ABSORB_CHANCE_PREY, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorb_chance_messages_prey,ABSORB_CHANCE_PREY, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["absorb_chance_messages_owner"])) - var/new_absorb_chance_messages_owner = sanitize(jointext(belly_data["absorb_chance_messages_owner"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_absorb_chance_messages_owner = sanitize(jointext(belly_data["absorb_chance_messages_owner"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_absorb_chance_messages_owner) - new_belly.set_messages(new_absorb_chance_messages_owner,ABSORB_CHANCE_OWNER, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_absorb_chance_messages_owner,ABSORB_CHANCE_OWNER, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["examine_messages"])) - var/new_examine_messages = sanitize(jointext(belly_data["examine_messages"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_examine_messages = sanitize(jointext(belly_data["examine_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_examine_messages) - new_belly.set_messages(new_examine_messages,EXAMINES, limit = MAX_MESSAGE_LEN / 2) + new_belly.set_messages(new_examine_messages,EXAMINES, limit = BELLIES_EXAMINE_MAX) if(islist(belly_data["examine_messages_absorbed"])) - var/new_examine_messages_absorbed = sanitize(jointext(belly_data["examine_messages_absorbed"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_examine_messages_absorbed = sanitize(jointext(belly_data["examine_messages_absorbed"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_examine_messages_absorbed) - new_belly.set_messages(new_examine_messages_absorbed,EXAMINES_ABSORBED, limit = MAX_MESSAGE_LEN / 2) + new_belly.set_messages(new_examine_messages_absorbed,EXAMINES_ABSORBED, limit = BELLIES_EXAMINE_MAX) if(islist(belly_data["emotes_digest"])) - var/new_emotes_digest = sanitize(jointext(belly_data["emotes_digest"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_digest = sanitize(jointext(belly_data["emotes_digest"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_digest) - new_belly.set_messages(new_emotes_digest,BELLY_MODE_DIGEST, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_digest,BELLY_MODE_DIGEST, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["trash_eater_in"])) - var/new_trash_eater_in = sanitize(jointext(belly_data["trash_eater_in"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_trash_eater_in = sanitize(jointext(belly_data["trash_eater_in"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_trash_eater_in) - new_belly.set_messages(new_trash_eater_in ,BELLY_TRASH_EATER_IN, limit = MAX_MESSAGE_LEN / 2) + new_belly.set_messages(new_trash_eater_in ,BELLY_TRASH_EATER_IN, limit = BELLIES_EXAMINE_MAX) if(islist(belly_data["trash_eater_out"])) - var/new_trash_eater_out = sanitize(jointext(belly_data["trash_eater_out"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_trash_eater_out = sanitize(jointext(belly_data["trash_eater_out"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_trash_eater_out) - new_belly.set_messages(new_trash_eater_out,BELLY_TRASH_EATER_OUT, limit = MAX_MESSAGE_LEN / 2) + new_belly.set_messages(new_trash_eater_out,BELLY_TRASH_EATER_OUT, limit = BELLIES_EXAMINE_MAX) if(islist(belly_data["emotes_hold"])) - var/new_emotes_hold = sanitize(jointext(belly_data["emotes_hold"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_hold = sanitize(jointext(belly_data["emotes_hold"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_hold) - new_belly.set_messages(new_emotes_hold,BELLY_MODE_HOLD, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_hold,BELLY_MODE_HOLD, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_holdabsorbed"])) - var/new_emotes_holdabsorbed = sanitize(jointext(belly_data["emotes_holdabsorbed"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_holdabsorbed = sanitize(jointext(belly_data["emotes_holdabsorbed"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_holdabsorbed) - new_belly.set_messages(new_emotes_holdabsorbed,BELLY_MODE_HOLD_ABSORB, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_holdabsorbed,BELLY_MODE_HOLD_ABSORB, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_absorb"])) - var/new_emotes_absorb = sanitize(jointext(belly_data["emotes_absorb"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_absorb = sanitize(jointext(belly_data["emotes_absorb"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_absorb) - new_belly.set_messages(new_emotes_absorb,BELLY_MODE_ABSORB, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_absorb,BELLY_MODE_ABSORB, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_heal"])) - var/new_emotes_heal = sanitize(jointext(belly_data["emotes_heal"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_heal = sanitize(jointext(belly_data["emotes_heal"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_heal) - new_belly.set_messages(new_emotes_heal,BELLY_MODE_HEAL, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_heal,BELLY_MODE_HEAL, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_drain"])) - var/new_emotes_drain = sanitize(jointext(belly_data["emotes_drain"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_drain = sanitize(jointext(belly_data["emotes_drain"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_drain) - new_belly.set_messages(new_emotes_drain,BELLY_MODE_DRAIN, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_drain,BELLY_MODE_DRAIN, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_steal"])) - var/new_emotes_steal = sanitize(jointext(belly_data["emotes_steal"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_steal = sanitize(jointext(belly_data["emotes_steal"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_steal) - new_belly.set_messages(new_emotes_steal,BELLY_MODE_STEAL, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_steal,BELLY_MODE_STEAL, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_egg"])) - var/new_emotes_egg = sanitize(jointext(belly_data["emotes_egg"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_egg = sanitize(jointext(belly_data["emotes_egg"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_egg) - new_belly.set_messages(new_emotes_egg,BELLY_MODE_EGG, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_egg,BELLY_MODE_EGG, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_shrink"])) - var/new_emotes_shrink = sanitize(jointext(belly_data["emotes_shrink"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_shrink = sanitize(jointext(belly_data["emotes_shrink"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_shrink) - new_belly.set_messages(new_emotes_shrink,BELLY_MODE_SHRINK, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_shrink,BELLY_MODE_SHRINK, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_grow"])) - var/new_emotes_grow = sanitize(jointext(belly_data["emotes_grow"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_grow = sanitize(jointext(belly_data["emotes_grow"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_grow) - new_belly.set_messages(new_emotes_grow,BELLY_MODE_GROW, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_grow,BELLY_MODE_GROW, limit = BELLIES_IDLE_MAX) if(islist(belly_data["emotes_unabsorb"])) - var/new_emotes_unabsorb = sanitize(jointext(belly_data["emotes_unabsorb"],"\n\n"),MAX_MESSAGE_LEN * 1.5,0,0,0) + var/new_emotes_unabsorb = sanitize(jointext(belly_data["emotes_unabsorb"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_emotes_unabsorb) - new_belly.set_messages(new_emotes_unabsorb,BELLY_MODE_UNABSORB, limit = MAX_MESSAGE_LEN / 4) + new_belly.set_messages(new_emotes_unabsorb,BELLY_MODE_UNABSORB, limit = BELLIES_IDLE_MAX) // Options if(isnum(belly_data["can_taste"])) @@ -1154,29 +1154,29 @@ new_belly.liquid_fullness5_messages = TRUE if(islist(belly_data["fullness1_messages"])) - var/new_fullness1_messages = sanitize(jointext(belly_data["fullness1_messages"],"\n\n"),MAX_MESSAGE_LEN,0,0,0) + var/new_fullness1_messages = sanitize(jointext(belly_data["fullness1_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_fullness1_messages) - new_belly.set_reagent_messages(new_fullness1_messages,"full1") + new_belly.set_messages(new_fullness1_messages,BELLY_LIQUID_MESSAGE1, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["fullness2_messages"])) - var/new_fullness2_messages = sanitize(jointext(belly_data["fullness2_messages"],"\n\n"),MAX_MESSAGE_LEN,0,0,0) + var/new_fullness2_messages = sanitize(jointext(belly_data["fullness2_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_fullness2_messages) - new_belly.set_reagent_messages(new_fullness2_messages,"full2") + new_belly.set_messages(new_fullness2_messages,BELLY_LIQUID_MESSAGE2, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["fullness3_messages"])) - var/new_fullness3_messages = sanitize(jointext(belly_data["fullness3_messages"],"\n\n"),MAX_MESSAGE_LEN,0,0,0) + var/new_fullness3_messages = sanitize(jointext(belly_data["fullness3_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_fullness3_messages) - new_belly.set_reagent_messages(new_fullness3_messages,"full3") + new_belly.set_messages(new_fullness3_messages,BELLY_LIQUID_MESSAGE3, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["fullness4_messages"])) - var/new_fullness4_messages = sanitize(jointext(belly_data["fullness4_messages"],"\n\n"),MAX_MESSAGE_LEN,0,0,0) + var/new_fullness4_messages = sanitize(jointext(belly_data["fullness4_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_fullness4_messages) - new_belly.set_reagent_messages(new_fullness4_messages,"full4") + new_belly.set_messages(new_fullness4_messages,BELLY_LIQUID_MESSAGE4, limit = BELLIES_MESSAGE_MAX) if(islist(belly_data["fullness5_messages"])) - var/new_fullness5_messages = sanitize(jointext(belly_data["fullness5_messages"],"\n\n"),MAX_MESSAGE_LEN,0,0,0) + var/new_fullness5_messages = sanitize(jointext(belly_data["fullness5_messages"],"\n\n"),BELLIES_MESSAGE_COMBINED,0,0,0) if(new_fullness5_messages) - new_belly.set_reagent_messages(new_fullness5_messages,"full5") + new_belly.set_messages(new_fullness5_messages,BELLY_LIQUID_MESSAGE5, limit = BELLIES_MESSAGE_MAX) // After import updates new_belly.items_preserved.Cut() diff --git a/code/modules/vore/eating/belly_messages.dm b/code/modules/vore/eating/belly_messages.dm index 82ddedadf1..7250115cc2 100644 --- a/code/modules/vore/eating/belly_messages.dm +++ b/code/modules/vore/eating/belly_messages.dm @@ -326,9 +326,9 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," raw_messages = escape_absorbed_messages_prey if(ABSORBED_ESCAPE_OUTSIDE) raw_messages = escape_absorbed_messages_outside - if(FULL_ABSORBED_ESCAPE_OWNER) + if(ABSORBED_ESCAPE_FAIL_OWNER) raw_messages = escape_fail_absorbed_messages_owner - if(FULL_ABSORBED_ESCAPE_PREY) + if(ABSORBED_ESCAPE_FAIL_PREY) raw_messages = escape_fail_absorbed_messages_prey if(PRIMARY_TRANSFER_OWNER) raw_messages = primary_transfer_messages_owner @@ -396,6 +396,16 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," raw_messages = trash_eater_in if(BELLY_TRASH_EATER_OUT) raw_messages = trash_eater_out + if(BELLY_LIQUID_MESSAGE1) + raw_messages = fullness1_messages + if(BELLY_LIQUID_MESSAGE2) + raw_messages = fullness2_messages + if(BELLY_LIQUID_MESSAGE3) + raw_messages = fullness3_messages + if(BELLY_LIQUID_MESSAGE4) + raw_messages = fullness4_messages + if(BELLY_LIQUID_MESSAGE5) + raw_messages = fullness5_messages var/messages = null if(raw_messages) @@ -413,11 +423,15 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," var/list/raw_list - if(findtext(raw_text, delim)) - raw_list = splittext(html_encode(raw_text), delim) + if(islist(raw_text)) + raw_list = raw_text + else if(findtext(raw_text, delim)) + raw_list = splittext(raw_text, delim) else raw_list = list(raw_text) + for(var/i = 1, i <= raw_list.len, i++) + raw_list[i] = html_encode(raw_list[i]) if(!length(raw_list[i])) raw_list.Cut(i, i + 1) i-- @@ -480,9 +494,9 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," escape_absorbed_messages_prey = raw_list if(ABSORBED_ESCAPE_OUTSIDE) escape_absorbed_messages_outside = raw_list - if(FULL_ABSORBED_ESCAPE_OWNER) + if(ABSORBED_ESCAPE_FAIL_OWNER) escape_fail_absorbed_messages_owner = raw_list - if(FULL_ABSORBED_ESCAPE_PREY) + if(ABSORBED_ESCAPE_FAIL_PREY) escape_fail_absorbed_messages_prey = raw_list if(PRIMARY_TRANSFER_OWNER) primary_transfer_messages_owner = raw_list @@ -550,3 +564,13 @@ GLOBAL_LIST_INIT(vore_words_snake, list("snake","serpent","reptilian","noodle"," trash_eater_in = raw_list if(BELLY_TRASH_EATER_OUT) trash_eater_out = raw_list + if(BELLY_LIQUID_MESSAGE1) + fullness1_messages = raw_list + if(BELLY_LIQUID_MESSAGE2) + fullness2_messages = raw_list + if(BELLY_LIQUID_MESSAGE3) + fullness3_messages = raw_list + if(BELLY_LIQUID_MESSAGE4) + fullness4_messages = raw_list + if(BELLY_LIQUID_MESSAGE5) + fullness5_messages = raw_list diff --git a/code/modules/vore/eating/belly_obj_liquids.dm b/code/modules/vore/eating/belly_obj_liquids.dm index 87c5fab30b..c630288370 100644 --- a/code/modules/vore/eating/belly_obj_liquids.dm +++ b/code/modules/vore/eating/belly_obj_liquids.dm @@ -263,65 +263,6 @@ return(span_red("[formatted_message]
")) - -// The next function gets the messages set on the belly, in human-readable format. -// This is useful in customization boxes and such. The delimiter right now is \n\n so -// in message boxes, this looks nice and is easily delimited. -/obj/belly/proc/get_reagent_messages(var/type, var/delim = "\n\n") - ASSERT(type == "full1" || type == "full2" || type == "full3" || type == "full4" || type == "full5") - var/list/raw_messages - - switch(type) - if("full1") - raw_messages = fullness1_messages - if("full2") - raw_messages = fullness2_messages - if("full3") - raw_messages = fullness3_messages - if("full4") - raw_messages = fullness4_messages - if("full5") - raw_messages = fullness5_messages - - var/messages = raw_messages.Join(delim) - return messages - -// The next function sets the messages on the belly, from human-readable var -// replacement strings and linebreaks as delimiters (two \n\n by default). -// They also sanitize the messages. -/obj/belly/proc/set_reagent_messages(var/raw_text, var/type, var/delim = "\n\n") - ASSERT(type == "full1" || type == "full2" || type == "full3" || type == "full4" || type == "full5") - - var/list/raw_list = splittext(html_encode(raw_text),delim) - if(raw_list.len > 10) - raw_list.Cut(11) - log_debug("[owner] tried to set [lowertext(name)] with 11+ messages") - - for(var/i = 1, i <= raw_list.len, i++) - if(length(raw_list[i]) > 160 || length(raw_list[i]) < 10) //160 is fudged value due to htmlencoding increasing the size - raw_list.Cut(i,i) - log_debug("[owner] tried to set [lowertext(name)] with >121 or <10 char message") - else - raw_list[i] = readd_quotes(raw_list[i]) - //Also fix % sign for var replacement - raw_list[i] = replacetext(raw_list[i],"%","%") - - ASSERT(raw_list.len <= 10) //Sanity - - switch(type) - if("full1") - fullness1_messages = raw_list - if("full2") - fullness2_messages = raw_list - if("full3") - fullness3_messages = raw_list - if("full4") - fullness4_messages = raw_list - if("full5") - fullness5_messages = raw_list - - return - /////////////////////////// Process Cycle Lite /////////////////////////// CHOMP PCL /obj/belly/proc/quick_cycle() //For manual belly cycling without straining the bellies subsystem. HandleBellyReagents() //reagent belly stuff. diff --git a/code/modules/vore/eating/digest_act_vr.dm b/code/modules/vore/eating/digest_act_vr.dm index e708569c91..c6e22a3a66 100644 --- a/code/modules/vore/eating/digest_act_vr.dm +++ b/code/modules/vore/eating/digest_act_vr.dm @@ -129,7 +129,7 @@ S.use(1) digest_stage = w_class else - if(istype(src, /obj/item/reagent_containers/food)) + if(istype(B) && istype(src, /obj/item/reagent_containers/food)) if(ishuman(B.owner) && reagents) var/mob/living/carbon/human/H = B.owner reagents.trans_to_holder(H.ingested, (reagents.total_volume), B.nutrition_percent / 100, 0) diff --git a/code/modules/vore/eating/mob_vr.dm b/code/modules/vore/eating/mob_vr.dm index 4172b1e3d2..0835950b8c 100644 --- a/code/modules/vore/eating/mob_vr.dm +++ b/code/modules/vore/eating/mob_vr.dm @@ -25,7 +25,6 @@ var/allow_spontaneous_tf = FALSE // Obviously. var/show_vore_fx = TRUE // Show belly fullscreens var/selective_preference = DM_DEFAULT // Preference for selective bellymode - var/text_warnings = TRUE // Allows us to dismiss the text limit warning messages after viewing it once per round var/eating_privacy_global = FALSE // Makes eating attempt/success messages only reach for subtle range if true, overwritten by belly-specific var var/allow_mimicry = TRUE // Allows mimicking their character var/allow_mind_transfer = FALSE //Allows ones mind to be taken over or swapped diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_pref_data.dm b/code/modules/vore/eating/panel_databackend/vorepanel_pref_data.dm new file mode 100644 index 0000000000..56c48d35f6 --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_pref_data.dm @@ -0,0 +1,111 @@ +/datum/vore_look/proc/get_preference_data(mob/owner) + return list( + "digestable" = owner.digestable, + "devourable" = owner.devourable, + "resizable" = owner.resizable, + "feeding" = owner.feeding, + "absorbable" = owner.absorbable, + "digest_leave_remains" = owner.digest_leave_remains, + "allowmobvore" = owner.allowmobvore, + "permit_healbelly" = owner.permit_healbelly, + "show_vore_fx" = owner.show_vore_fx, + "can_be_drop_prey" = owner.can_be_drop_prey, + "can_be_drop_pred" = owner.can_be_drop_pred, + "latejoin_vore" = owner.latejoin_vore, + "latejoin_prey" = owner.latejoin_prey, + "no_spawnpred_warning" = owner.no_latejoin_vore_warning, + "no_spawnprey_warning" = owner.no_latejoin_prey_warning, + "no_spawnpred_warning_time" = owner.no_latejoin_vore_warning_time, + "no_spawnprey_warning_time" = owner.no_latejoin_prey_warning_time, + "no_spawnpred_warning_save" = owner.no_latejoin_vore_warning_persists, + "no_spawnprey_warning_save" = owner.no_latejoin_prey_warning_persists, + "allow_spontaneous_tf" = owner.allow_spontaneous_tf, + "step_mechanics_active" = owner.step_mechanics_pref, + "pickup_mechanics_active" = owner.pickup_pref, + "strip_mechanics_active" = owner.strip_pref, + "noisy" = owner.noisy, + //liquid belly prefs + "liq_rec" = owner.receive_reagents, + "liq_giv" = owner.give_reagents, + "liq_apply" = owner.apply_reagents, + "autotransferable" = owner.autotransferable, + "noisy_full" = owner.noisy_full, //Belching while full + "selective_active" = owner.selective_preference, //Reveal active selective mode in prefs + + "allow_mind_transfer" = owner.allow_mind_transfer, + "drop_vore" = owner.drop_vore, + "slip_vore" = owner.slip_vore, + "stumble_vore" = owner.stumble_vore, + "throw_vore" = owner.throw_vore, + "phase_vore" = owner.phase_vore, + "food_vore" = owner.food_vore, + "consume_liquid_belly" = owner.consume_liquid_belly, + "digest_pain" = owner.digest_pain, + "eating_privacy_global" = owner.eating_privacy_global, + "allow_mimicry" = owner.allow_mimicry, + //Soulcatcher + "soulcatcher_allow_capture" = owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_CAPTURE, + "soulcatcher_allow_transfer" = owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER, + "soulcatcher_allow_takeover" = owner.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TAKEOVER, + "soulcatcher_allow_deletion" = (global_flag_check(owner.soulcatcher_pref_flags, SOULCATCHER_ALLOW_DELETION) + global_flag_check(owner.soulcatcher_pref_flags, SOULCATCHER_ALLOW_DELETION_INSTANT)) + ) + +#define SET_TASTE "Set Taste" +#define SET_SMELL "Set Smell" +#define SET_NUTRITION_EX "Set Nutrition Examine" +#define SET_WEIGHT_EX "Set Weight Examine" + +/datum/vore_look/proc/get_general_data(mob/owner) + return list( + "active_belly" = owner.vore_selected?.name, + "belly_rub_target" = owner.belly_rub_target, + // start, vore sprites + "aestethic_messages" = compile_aesthetic_messages(owner), + "vore_sprite_color" = owner.vore_sprite_color, + "vore_sprite_multiply" = owner.vore_sprite_multiply, + "vore_icon_options" = owner.vore_icon_bellies + ) + +/datum/vore_look/proc/compile_aesthetic_messages(mob/owner) + if(!aset_message_subtab) + aset_message_subtab = SET_TASTE + var/list/tab_data = list( + "possible_messages" = list(SET_TASTE, SET_SMELL, SET_NUTRITION_EX, SET_WEIGHT_EX), + "aest_subtab" = aset_message_subtab + ) + if(aset_message_subtab == SET_TASTE) + tab_data["max_length"] = FLAVOR_MAX + tab_data["active_message"] = owner.vore_taste + tab_data["set_action"] = TASTE_FLAVOR + tab_data["tooltip"] = "What your character tastes like. This text will be printed to the pred after 'X tastes of...' so just put something like 'strawberries and cream'" + if(aset_message_subtab == SET_SMELL) + tab_data["max_length"] = FLAVOR_MAX + tab_data["active_message"] = owner.vore_smell + tab_data["set_action"] = SMELL_FLAVOR + tab_data["tooltip"] = "What your character smells like. This text will be printed to the pred after 'X smells of...' so just put something like 'strawberries and cream'" + if(aset_message_subtab == SET_NUTRITION_EX) + tab_data["max_length"] = BELLIES_EXAMINE_MAX + tab_data["active_message"] = owner.nutrition_messages + tab_data["set_action"] = "set_attribute" + tab_data["sub_action"] = GENERAL_EXAMINE_NUTRI + tab_data["tooltip"] = "Change the nutrition display messages on examine." + tab_data["button_label"] = "Display Nutrition Examine" + tab_data["button_action"] = "toggle_nutrition_ex" + tab_data["button_data"] = owner.nutrition_message_visible + tab_data["button_tooltip"] = "the nutition messages on examine." // those will automatically be preceeded by Enables / Disables! + if(aset_message_subtab == SET_WEIGHT_EX) + tab_data["max_length"] = BELLIES_EXAMINE_MAX + tab_data["active_message"] = owner.weight_messages + tab_data["set_action"] = "set_attribute" + tab_data["sub_action"] = GENERAL_EXAMINE_WEIGHT + tab_data["tooltip"] = "Change the weight display messages on examine." + tab_data["button_label"] = "Display Weight Examine" + tab_data["button_action"] = "toggle_weight_ex" + tab_data["button_data"] = owner.weight_message_visible + tab_data["button_tooltip"] = "the weight messages on examine." // those will automatically be preceeded by Enables / Disables! + return tab_data + +#undef SET_TASTE +#undef SET_SMELL +#undef SET_NUTRITION_EX +#undef SET_WEIGHT_EX diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_set_attribute.dm b/code/modules/vore/eating/panel_databackend/vorepanel_set_attribute.dm new file mode 100644 index 0000000000..136daf3222 --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_set_attribute.dm @@ -0,0 +1,1031 @@ +/datum/vore_look/proc/set_attr(mob/user, params) + if(!host.vore_selected) + tgui_alert_async(user, "No belly selected to modify.") + return FALSE + var/attr = params["attribute"] + switch(attr) + if("b_name") + var/new_name = html_encode(params["val"]) + + var/failure_msg + if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) + failure_msg = "Entered belly name length invalid (must be longer than [BELLIES_NAME_MIN], no more than than [BELLIES_NAME_MAX])." + // else if(whatever) //Next test here. + else + for(var/obj/belly/B as anything in host.vore_organs) + if(lowertext(new_name) == lowertext(B.name)) + failure_msg = "No duplicate belly names, please." + break + + if(failure_msg) //Something went wrong. + tgui_alert_async(user,failure_msg,"Error!") + return FALSE + + host.vore_selected.name = new_name + . = TRUE + if("b_message_mode") + host.vore_selected.message_mode = !host.vore_selected.message_mode + . = TRUE + if("b_wetness") + host.vore_selected.is_wet = !host.vore_selected.is_wet + . = TRUE + if("b_wetloop") + host.vore_selected.wet_loop = !host.vore_selected.wet_loop + . = TRUE + if("b_mode") + var/new_mode = params["val"] + if(!(new_mode in host.vore_selected.digest_modes)) + return FALSE + + host.vore_selected.digest_mode = new_mode + host.vore_selected.updateVRPanels() + . = TRUE + if("b_addons") + var/toggle_addon = params["val"] + if(!(toggle_addon in host.vore_selected.mode_flag_list)) + return FALSE + host.vore_selected.mode_flags ^= host.vore_selected.mode_flag_list[toggle_addon] + host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on + host.vore_selected.slow_digestion = FALSE + if(host.vore_selected.mode_flags & DM_FLAG_SLOWBODY) + host.vore_selected.slow_digestion = TRUE + if(toggle_addon == "TURBO MODE") + STOP_PROCESSING(SSbellies, host.vore_selected) + STOP_PROCESSING(SSobj, host.vore_selected) + if(host.vore_selected.mode_flags & DM_FLAG_TURBOMODE) + host.vore_selected.speedy_mob_processing = TRUE + START_PROCESSING(SSobj, host.vore_selected) + to_chat(user, span_warning("TURBO MODE activated! Belly processing speed tripled! This also affects timed settings, such as autotransfer and liquid generation.")) + else + host.vore_selected.speedy_mob_processing = FALSE + START_PROCESSING(SSbellies, host.vore_selected) + to_chat(user, span_warning("TURBO MODE deactivated. Belly processing returned to normal speed.")) + . = TRUE + if("b_item_mode") + var/new_mode = params["val"] + if(!(new_mode in host.vore_selected.item_digest_modes)) + return FALSE + + host.vore_selected.item_digest_mode = new_mode + host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on belly-mode change + . = TRUE + if("b_contaminates") // Reverting upstream's change because why reset save files due to a different server's drama? + host.vore_selected.contaminates = !host.vore_selected.contaminates + . = TRUE + if("b_contamination_flavor") + var/new_flavor = params["val"] + if(!(new_flavor in GLOB.contamination_flavors)) + return FALSE + host.vore_selected.contamination_flavor = new_flavor + . = TRUE + if("b_contamination_color") + var/new_color = params["val"] + if(!(new_color in GLOB.contamination_colors)) + return FALSE + host.vore_selected.contamination_color = new_color + host.vore_selected.items_preserved.Cut() //To re-contaminate for new color + . = TRUE + if("b_egg_type") + var/new_egg_type = params["val"] + if(!(new_egg_type in GLOB.global_vore_egg_types)) + return FALSE + host.vore_selected.egg_type = new_egg_type + . = TRUE + if("b_egg_name") + var/new_egg_name = sanitize(params["val"], BELLIES_NAME_MAX, FALSE, TRUE, FALSE) + host.vore_selected.egg_name = new_egg_name + . = TRUE + if("b_egg_size") + var/new_egg_size = text2num(params["val"]) + if(isnum(new_egg_size)) + return FALSE + if(new_egg_size == 0) //Disable. + host.vore_selected.egg_size = 0 + to_chat(user,span_notice("Eggs will automatically calculate size depending on contents.")) + else + new_egg_size = CLAMP(new_egg_size, 25, 200) + host.vore_selected.egg_size = (new_egg_size/100) + . = TRUE + if("b_recycling") + host.vore_selected.recycling = !host.vore_selected.recycling + . = TRUE + if("b_storing_nutrition") + host.vore_selected.storing_nutrition = !host.vore_selected.storing_nutrition + . = TRUE + if(BELLY_DESCRIPTION_MESSAGE) + var/new_desc = html_encode(params["val"]) + + if(new_desc) + new_desc = readd_quotes(new_desc) + if(length(new_desc) > BELLIES_DESC_MAX) + tgui_alert_async(user, "Entered belly desc too long. [BELLIES_DESC_MAX] character limit.","Error") + return FALSE + host.vore_selected.desc = new_desc + . = TRUE + if(BELLY_DESCRIPTION_MESSAGE_ABSROED) + var/new_desc = html_encode(params["val"]) + + if(new_desc) + new_desc = readd_quotes(new_desc) + if(length(new_desc) > BELLIES_DESC_MAX) + tgui_alert_async(user, "Entered belly desc too long. [BELLIES_DESC_MAX] character limit.","Error") + return FALSE + host.vore_selected.absorbed_desc = new_desc + . = TRUE + if("b_msgs") + switch(params["msgtype"]) + if(DIGEST_PREY) + host.vore_selected.set_messages(params["val"], DIGEST_PREY, limit = BELLIES_MESSAGE_MAX) + + if(DIGEST_OWNER) + host.vore_selected.set_messages(params["val"], DIGEST_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ABSORB_PREY) + host.vore_selected.set_messages(params["val"], ABSORB_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ABSORB_OWNER) + host.vore_selected.set_messages(params["val"], ABSORB_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(UNABSORBS_PREY) + host.vore_selected.set_messages(params["val"], UNABSORBS_PREY, limit = BELLIES_MESSAGE_MAX) + + if(UNABSORBS_OWNER) + host.vore_selected.set_messages(params["val"], UNABSORBS_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(STRUGGLE_OUTSIDE) + host.vore_selected.set_messages(params["val"], STRUGGLE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) + + if(STRUGGLE_INSIDE) + host.vore_selected.set_messages(params["val"], STRUGGLE_INSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_STRUGGLE_OUSIDE) + host.vore_selected.set_messages(params["val"], ABSORBED_STRUGGLE_OUSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_STRUGGLE_INSIDE) + host.vore_selected.set_messages(params["val"], ABSORBED_STRUGGLE_INSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_ATTEMPT_PREY) + host.vore_selected.set_messages(params["val"], ESCAPE_ATTEMPT_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_ATTEMPT_OWNER) + host.vore_selected.set_messages(params["val"], ESCAPE_ATTEMPT_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_PREY) + host.vore_selected.set_messages(params["val"], ESCAPE_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_OWNER) + host.vore_selected.set_messages(params["val"], ESCAPE_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_OUTSIDE) + host.vore_selected.set_messages(params["val"], ESCAPE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_ITEM_PREY) + host.vore_selected.set_messages(params["val"], ESCAPE_ITEM_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_ITEM_OWNER) + host.vore_selected.set_messages(params["val"], ESCAPE_ITEM_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_ITEM_OUTSIDE) + host.vore_selected.set_messages(params["val"], ESCAPE_ITEM_OUTSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_FAIL_PREY) + host.vore_selected.set_messages(params["val"], ESCAPE_FAIL_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ESCAPE_FAIL_OWNER) + host.vore_selected.set_messages(params["val"], ESCAPE_FAIL_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_ATTEMPT_PREY) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_ATTEMPT_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_ATTEMPT_OWNER) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_ATTEMPT_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_PREY) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_OWNER) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_OUTSIDE) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_OUTSIDE, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_FAIL_PREY) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_FAIL_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ABSORBED_ESCAPE_FAIL_OWNER) + host.vore_selected.set_messages(params["val"], ABSORBED_ESCAPE_FAIL_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(PRIMARY_TRANSFER_PREY) + host.vore_selected.set_messages(params["val"], PRIMARY_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) + + if(PRIMARY_TRANSFER_OWNER) + host.vore_selected.set_messages(params["val"], PRIMARY_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(SECONDARY_TRANSFER_PREY) + host.vore_selected.set_messages(params["val"], SECONDARY_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) + + if(SECONDARY_TRANSFER_OWNER) + host.vore_selected.set_messages(params["val"], SECONDARY_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(PRIMARY_AUTO_TRANSFER_PREY) + host.vore_selected.set_messages(params["val"], PRIMARY_AUTO_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) + + if(PRIMARY_AUTO_TRANSFER_OWNER) + host.vore_selected.set_messages(params["val"], PRIMARY_AUTO_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(SECONDARY_AUTO_TRANSFER_PREY) + host.vore_selected.set_messages(params["val"], SECONDARY_AUTO_TRANSFER_PREY, limit = BELLIES_MESSAGE_MAX) + + if(SECONDARY_AUTO_TRANSFER_OWNER) + host.vore_selected.set_messages(params["val"], SECONDARY_AUTO_TRANSFER_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(DIGEST_CHANCE_PREY) + host.vore_selected.set_messages(params["val"], DIGEST_CHANCE_PREY, limit = BELLIES_MESSAGE_MAX) + + if(DIGEST_CHANCE_OWNER) + host.vore_selected.set_messages(params["val"], DIGEST_CHANCE_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(ABSORB_CHANCE_PREY) + host.vore_selected.set_messages(params["val"], ABSORB_CHANCE_PREY, limit = BELLIES_MESSAGE_MAX) + + if(ABSORB_CHANCE_OWNER) + host.vore_selected.set_messages(params["val"], ABSORB_CHANCE_OWNER, limit = BELLIES_MESSAGE_MAX) + + if(EXAMINES) + host.vore_selected.set_messages(params["val"], EXAMINES, limit = BELLIES_EXAMINE_MAX) + + if(EXAMINES_ABSORBED) + host.vore_selected.set_messages(params["val"], EXAMINES_ABSORBED, limit = BELLIES_EXAMINE_MAX) + + if(GENERAL_EXAMINE_NUTRI) + sanitize_fixed_list(params["val"], GENERAL_EXAMINE_NUTRI, limit = BELLIES_EXAMINE_MAX) + + if(GENERAL_EXAMINE_WEIGHT) + sanitize_fixed_list(params["val"], GENERAL_EXAMINE_WEIGHT, limit = BELLIES_EXAMINE_MAX) + + if(BELLY_TRASH_EATER_IN) + host.vore_selected.set_messages(params["val"], BELLY_TRASH_EATER_IN, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_TRASH_EATER_OUT) + host.vore_selected.set_messages(params["val"], BELLY_TRASH_EATER_OUT, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_MODE_DIGEST) + host.vore_selected.set_messages(params["val"], BELLY_MODE_DIGEST, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_HOLD) + host.vore_selected.set_messages(params["val"], BELLY_MODE_HOLD, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_HOLD_ABSORB) + host.vore_selected.set_messages(params["val"], BELLY_MODE_HOLD_ABSORB, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_ABSORB) + host.vore_selected.set_messages(params["val"], BELLY_MODE_ABSORB, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_HEAL) + host.vore_selected.set_messages(params["val"], BELLY_MODE_HEAL, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_DRAIN) + host.vore_selected.set_messages(params["val"], BELLY_MODE_DRAIN, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_STEAL) + host.vore_selected.set_messages(params["val"], BELLY_MODE_STEAL, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_EGG) + host.vore_selected.set_messages(params["val"], BELLY_MODE_EGG, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_SHRINK) + host.vore_selected.set_messages(params["val"], BELLY_MODE_SHRINK, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_GROW) + host.vore_selected.set_messages(params["val"], BELLY_MODE_GROW, limit = BELLIES_IDLE_MAX) + + if(BELLY_MODE_UNABSORB) + host.vore_selected.set_messages(params["val"], BELLY_MODE_UNABSORB, limit = BELLIES_IDLE_MAX) + + if(BELLY_LIQUID_MESSAGE1) + host.vore_selected.set_messages(params["val"], BELLY_LIQUID_MESSAGE1, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_LIQUID_MESSAGE2) + host.vore_selected.set_messages(params["val"], BELLY_LIQUID_MESSAGE2, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_LIQUID_MESSAGE3) + host.vore_selected.set_messages(params["val"], BELLY_LIQUID_MESSAGE3, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_LIQUID_MESSAGE4) + host.vore_selected.set_messages(params["val"], BELLY_LIQUID_MESSAGE4, limit = BELLIES_MESSAGE_MAX) + + if(BELLY_LIQUID_MESSAGE5) + host.vore_selected.set_messages(params["val"], BELLY_LIQUID_MESSAGE5, limit = BELLIES_MESSAGE_MAX) + + if("reset") + var/confirm = tgui_alert(user,"This will delete any custom messages. Are you sure?","Confirmation",list("Cancel","DELETE")) + if(!confirm == "DELETE") + return FALSE + var/obj/belly/default_belly = new /obj/belly(null) + host.vore_selected.digest_messages_prey = default_belly.digest_messages_prey.Copy() + host.vore_selected.digest_messages_owner = default_belly.digest_messages_owner.Copy() + host.vore_selected.absorb_messages_prey = default_belly.absorb_messages_prey.Copy() + host.vore_selected.absorb_messages_owner = default_belly.absorb_messages_owner.Copy() + host.vore_selected.unabsorb_messages_prey = default_belly.unabsorb_messages_prey.Copy() + host.vore_selected.unabsorb_messages_owner = default_belly.unabsorb_messages_owner.Copy() + host.vore_selected.struggle_messages_outside = default_belly.struggle_messages_outside.Copy() + host.vore_selected.struggle_messages_inside = default_belly.struggle_messages_inside.Copy() + host.vore_selected.absorbed_struggle_messages_outside = default_belly.absorbed_struggle_messages_outside.Copy() + host.vore_selected.absorbed_struggle_messages_inside = default_belly.absorbed_struggle_messages_inside.Copy() + host.vore_selected.escape_attempt_messages_owner = default_belly.escape_attempt_messages_owner.Copy() + host.vore_selected.escape_attempt_messages_prey = default_belly.escape_attempt_messages_prey.Copy() + host.vore_selected.escape_messages_owner = default_belly.escape_messages_owner.Copy() + host.vore_selected.escape_messages_prey = default_belly.escape_messages_prey.Copy() + host.vore_selected.escape_messages_outside = default_belly.escape_messages_outside.Copy() + host.vore_selected.escape_item_messages_owner = default_belly.escape_item_messages_owner.Copy() + host.vore_selected.escape_item_messages_prey = default_belly.escape_item_messages_prey.Copy() + host.vore_selected.escape_item_messages_outside = default_belly.escape_item_messages_outside.Copy() + host.vore_selected.escape_fail_messages_owner = default_belly.escape_fail_messages_owner.Copy() + host.vore_selected.escape_fail_messages_prey = default_belly.escape_fail_messages_prey.Copy() + host.vore_selected.escape_attempt_absorbed_messages_owner = default_belly.escape_attempt_absorbed_messages_owner.Copy() + host.vore_selected.escape_attempt_absorbed_messages_prey = default_belly.escape_attempt_absorbed_messages_prey.Copy() + host.vore_selected.escape_absorbed_messages_owner = default_belly.escape_absorbed_messages_owner.Copy() + host.vore_selected.escape_absorbed_messages_prey = default_belly.escape_absorbed_messages_prey.Copy() + host.vore_selected.escape_absorbed_messages_outside = default_belly.escape_absorbed_messages_outside.Copy() + host.vore_selected.escape_fail_absorbed_messages_owner = default_belly.escape_fail_absorbed_messages_owner.Copy() + host.vore_selected.escape_fail_absorbed_messages_prey = default_belly.escape_fail_absorbed_messages_prey.Copy() + host.vore_selected.primary_transfer_messages_owner = default_belly.primary_transfer_messages_owner.Copy() + host.vore_selected.primary_transfer_messages_prey = default_belly.primary_transfer_messages_prey.Copy() + host.vore_selected.secondary_transfer_messages_owner = default_belly.secondary_transfer_messages_owner.Copy() + host.vore_selected.secondary_transfer_messages_prey = default_belly.secondary_transfer_messages_prey.Copy() + host.vore_selected.primary_autotransfer_messages_owner = default_belly.primary_autotransfer_messages_owner.Copy() + host.vore_selected.primary_autotransfer_messages_prey = default_belly.primary_autotransfer_messages_prey.Copy() + host.vore_selected.secondary_autotransfer_messages_owner = default_belly.secondary_autotransfer_messages_owner.Copy() + host.vore_selected.secondary_autotransfer_messages_prey = default_belly.secondary_autotransfer_messages_prey.Copy() + host.vore_selected.digest_chance_messages_owner = default_belly.digest_chance_messages_owner.Copy() + host.vore_selected.digest_chance_messages_prey = default_belly.digest_chance_messages_prey.Copy() + host.vore_selected.absorb_chance_messages_owner = default_belly.absorb_chance_messages_owner.Copy() + host.vore_selected.absorb_chance_messages_prey = default_belly.absorb_chance_messages_prey.Copy() + host.vore_selected.examine_messages = default_belly.examine_messages.Copy() + host.vore_selected.examine_messages_absorbed = default_belly.examine_messages_absorbed.Copy() + host.vore_selected.emote_lists = default_belly.emote_lists.Copy() + host.vore_selected.trash_eater_in = default_belly.trash_eater_in.Copy() + host.vore_selected.trash_eater_out = default_belly.trash_eater_out.Copy() + host.vore_selected.liquid_fullness1_messages = default_belly.fullness1_messages.Copy() + host.vore_selected.liquid_fullness2_messages = default_belly.fullness2_messages.Copy() + host.vore_selected.liquid_fullness3_messages = default_belly.fullness3_messages.Copy() + host.vore_selected.liquid_fullness4_messages = default_belly.fullness4_messages.Copy() + host.vore_selected.liquid_fullness5_messages = default_belly.fullness5_messages.Copy() + qdel(default_belly) + . = TRUE + if("b_verb") + var/new_verb = html_encode(params["val"]) + + if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) + tgui_alert_async(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + return FALSE + + host.vore_selected.vore_verb = new_verb + . = TRUE + if("b_release_verb") + var/new_release_verb = html_encode(params["val"]) + + if(length(new_release_verb) > BELLIES_NAME_MAX || length(new_release_verb) < BELLIES_NAME_MIN) + tgui_alert_async(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + return FALSE + + host.vore_selected.release_verb = new_release_verb + . = TRUE + if("b_eating_privacy") + var/privacy_choice = params["val"] + if(!(privacy_choice in list("default", "subtle", "loud"))) + return FALSE + host.vore_selected.eating_privacy_local = privacy_choice + . = TRUE + if("b_silicon_belly") + var/belly_choice = params["Val"] + if(!(belly_choice in list("Sleeper", "Vorebelly", "Both"))) + return FALSE + for (var/belly in host.vore_organs) + var/obj/belly/B = belly + B.silicon_belly_overlay_preference = belly_choice + host.update_icon() + . = TRUE + if("b_belly_mob_mult") + var/new_prey_mult = tgui_input_number(user, "Choose the multiplier for mobs contributing to belly size, ranging from 0 to 5. Set to 0 to disable mobs contributing to belly size", + "Set Prey Multiplier", host.vore_selected.belly_mob_mult, max_value = 5, min_value = 0) + if(new_prey_mult == null) + return FALSE + host.vore_selected.belly_mob_mult = CLAMP(new_prey_mult, 0, 5) //Max at 5 because in no world will a borg have more than 5 bellies + host.update_icon() + . = TRUE + if("b_belly_item_mult") + var/new_item_mult = tgui_input_number(user, "Choose the multiplier for items contributing to belly size, \ + ranging from 0 to 10. (Item size affects how much they contribute as well) Set to 0 to disable size checks", "Set Item Multiplier", host.vore_selected.belly_item_mult, max_value = 10, min_value = 0) + if(new_item_mult == null) + return FALSE + else + host.vore_selected.belly_item_mult = CLAMP(new_item_mult, 0, 10) //Max at 10 because items contribute less than mobs, in general + host.update_icon() + . = TRUE + if("b_belly_overall_mult") + var/new_overall_mult = tgui_input_number(user, "Choose the overall multiplier to be applied to belly contents after specific multipliers, ranging from 0 to 5. Set to 0 to disable showing belly sprites at all.", + "Set minimum prey amount", host.vore_selected.belly_overall_mult, max_value = 5, min_value = 0) + if(new_overall_mult == null) + return FALSE + else + host.vore_selected.belly_overall_mult = CLAMP(new_overall_mult, 0, 5) // Max at 5 because... no reason to go higher at that point + host.update_icon() + . = TRUE + if("b_fancy_sound") + host.vore_selected.fancy_vore = !host.vore_selected.fancy_vore + host.vore_selected.vore_sound = "Gulp" + host.vore_selected.release_sound = "Splatter" + // defaults as to avoid potential bugs + . = TRUE + if("b_release") + var/choice = params["val"] + if(host.vore_selected.fancy_vore) + if(!(choice in GLOB.fancy_release_sounds)) + return FALSE + else if (!(choice in GLOB.classic_release_sounds)) + return FALSE + host.vore_selected.release_sound = choice + . = TRUE + if("b_releasesoundtest") + var/sound/releasetest + if(host.vore_selected.fancy_vore) + releasetest = GLOB.fancy_release_sounds[host.vore_selected.release_sound] + else + releasetest = GLOB.classic_release_sounds[host.vore_selected.release_sound] + + if(releasetest) + releasetest = sound(releasetest) + releasetest.volume = host.vore_selected.sound_volume + releasetest.frequency = host.vore_selected.noise_freq + SEND_SOUND(user, releasetest) + . = TRUE + if("b_sound") + var/choice = params["val"] + if(host.vore_selected.fancy_vore) + if(!(choice in GLOB.fancy_vore_sounds)) + return FALSE + else if (!(choice in GLOB.classic_vore_sounds)) + return FALSE + host.vore_selected.vore_sound = choice + . = TRUE + if("b_soundtest") + var/sound/voretest + if(host.vore_selected.fancy_vore) + voretest = GLOB.fancy_vore_sounds[host.vore_selected.vore_sound] + else + voretest = GLOB.classic_vore_sounds[host.vore_selected.vore_sound] + if(voretest) + voretest = sound(voretest) + voretest.volume = host.vore_selected.sound_volume + voretest.frequency = host.vore_selected.noise_freq + SEND_SOUND(user, voretest) + . = TRUE + if("b_sound_volume") + var/sound_volume_input = text2num(params["val"]) + if(!isnum(sound_volume_input)) + return FALSE + host.vore_selected.sound_volume = sanitize_integer(sound_volume_input, 0, 100, initial(host.vore_selected.sound_volume)) + . = TRUE + if("b_noise_freq") + var/choice = text2num(params["val"]) + if(!isnum(choice)) + return FALSE + if(choice == 0) + choice = rand(MIN_VOICE_FREQ, MAX_VOICE_FREQ) + choice = CLAMP(choice, MIN_VOICE_FREQ, MAX_VOICE_FREQ) + host.vore_selected.noise_freq = choice + . = TRUE + if("b_tastes") + host.vore_selected.can_taste = !host.vore_selected.can_taste + . = TRUE + if("b_feedable") + host.vore_selected.is_feedable = !host.vore_selected.is_feedable + . = TRUE + if("b_entrance_logs") + host.vore_selected.entrance_logs = !host.vore_selected.entrance_logs + . = TRUE + if("b_item_digest_logs") + host.vore_selected.item_digest_logs = !host.vore_selected.item_digest_logs + . = TRUE + if("b_bulge_size") + var/new_bulge = text2num(params["val"]) + if(!isnum(new_bulge)) + return FALSE + if(new_bulge == 0) //Disable. + host.vore_selected.bulge_size = 0 + to_chat(user,span_notice("Your stomach will not be seen on examine.")) + else if(new_bulge) + new_bulge = CLAMP(new_bulge, 25, 200) + host.vore_selected.bulge_size = (new_bulge/100) + . = TRUE + if("b_display_absorbed_examine") + host.vore_selected.display_absorbed_examine = !host.vore_selected.display_absorbed_examine + . = TRUE + if("b_grow_shrink") + var/new_grow = text2num(params["val"]) + if (!isnum(new_grow)) + return + host.vore_selected.shrink_grow_size = CLAMP(new_grow, 25, 200) * 0.01 + . = TRUE + if("b_nutritionpercent") + var/new_nutrition = text2num(params["val"]) + if(!isnum(new_nutrition)) + return FALSE + host.vore_selected.nutrition_percent = CLAMP(new_nutrition, 0.01, 100) + . = TRUE + // modified these to be flexible rather than maxing at 6/6/12/6/6 + if("b_burn_dmg") + var/new_damage = text2num(params["val"]) + if(!isnum(new_damage)) + return FALSE + new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn) // sanity check following tgui input + host.vore_selected.digest_burn = new_damage + host.vore_selected.items_preserved.Cut() + . = TRUE + if("b_brute_dmg") + var/new_damage = text2num(params["val"]) + if(!isnum(new_damage)) + return FALSE + new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute) + host.vore_selected.digest_brute = new_damage + host.vore_selected.items_preserved.Cut() + . = TRUE + if("b_oxy_dmg") + var/new_damage = text2num(params["val"]) + if(!isnum(new_damage)) + return FALSE + new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy) + host.vore_selected.digest_oxy = new_damage + . = TRUE + if("b_tox_dmg") + var/new_damage = text2num(params["val"]) + if(!isnum(new_damage)) + return FALSE + new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox) + host.vore_selected.digest_tox = new_damage + . = TRUE + if("b_clone_dmg") + var/new_damage = text2num(params["val"]) + if(!isnum(new_damage)) + return FALSE + new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone) + host.vore_selected.digest_clone = new_damage + . = TRUE + if("b_drainmode") + var/new_drainmode = params["val"] + if(!(new_drainmode in host.vore_selected.drainmodes)) + return FALSE + host.vore_selected.drainmode = new_drainmode + host.vore_selected.updateVRPanels() + if("b_emoteactive") + host.vore_selected.emote_active = !host.vore_selected.emote_active + . = TRUE + if("b_selective_mode_pref_toggle") + var/new_mode = params["val"] + switch(new_mode) + if(DM_DIGEST) + host.vore_selected.selective_preference = DM_DIGEST + if(DM_ABSORB) + host.vore_selected.selective_preference = DM_ABSORB + . = TRUE + if("b_emotetime") + var/new_time = text2num(params["val"]) + if(!isnum(new_time)) + return FALSE + host.vore_selected.emote_time = CLAMP(new_time, 60, 600) + . = TRUE + if("b_escapable") + if(host.vore_selected.escapable == 0) //Possibly escapable and special interactions. + host.vore_selected.escapable = 1 + to_chat(user,span_warning("Prey now have special interactions with your [lowertext(host.vore_selected.name)] depending on your settings.")) + else if(host.vore_selected.escapable == 1) //Never escapable. + host.vore_selected.escapable = 0 + to_chat(user,span_warning("Prey will not be able to have special interactions with your [lowertext(host.vore_selected.name)].")) + else + tgui_alert_async(user, "Something went wrong. Your stomach will now not have special interactions. Press the button enable them again and tell a dev.","Error") //If they somehow have a varable that's not 0 or 1 + host.vore_selected.escapable = 0 + . = TRUE + if("b_escapechance") + var/escape_chance_input = text2num(params["val"]) + if(!isnum(escape_chance_input)) + return FALSE + host.vore_selected.escapechance = sanitize_integer(escape_chance_input, 0, 100, initial(host.vore_selected.escapechance)) + . = TRUE + if("b_belchchance") + var/belch_chance_input = text2num(params["val"]) + if(!isnum(belch_chance_input)) + return FALSE + host.vore_selected.belchchance = sanitize_integer(belch_chance_input, 0, 100, initial(host.vore_selected.belchchance)) + . = TRUE + if("b_escapechance_absorbed") + var/escape_absorbed_chance_input = text2num(params["val"]) + if(!isnum(escape_absorbed_chance_input)) + return FALSE + host.vore_selected.escapechance_absorbed = sanitize_integer(escape_absorbed_chance_input, 0, 100, initial(host.vore_selected.escapechance_absorbed)) + . = TRUE + if("b_escapetime") + var/escape_time_input = text2num(params["val"]) + if(!isnum(escape_time_input)) + return FALSE + host.vore_selected.escapetime = sanitize_integer(escape_time_input*10, 10, 600, initial(host.vore_selected.escapetime)) + . = TRUE + if("b_transferchance") + var/transfer_chance_input = text2num(params["val"]) + if(!isnum(transfer_chance_input)) + return FALSE + host.vore_selected.transferchance = sanitize_integer(transfer_chance_input, 0, 100, initial(host.vore_selected.transferchance)) + . = TRUE + if("b_transferlocation") + var/obj/belly/choice = locate(params["val"]) + + if(!istype(choice)) + host.vore_selected.transferlocation = null + else + host.vore_selected.transferlocation = choice.name + . = TRUE + if("b_transferchance_secondary") + var/transfer_secondary_chance_input = text2num(params["val"]) + if(!isnum(transfer_secondary_chance_input)) + return FALSE + host.vore_selected.transferchance_secondary = sanitize_integer(transfer_secondary_chance_input, 0, 100, initial(host.vore_selected.transferchance_secondary)) + . = TRUE + if("b_transferlocation_secondary") + var/obj/belly/choice_secondary = locate(params["val"]) + + if(!istype(choice_secondary)) + host.vore_selected.transferlocation_secondary = null + else + host.vore_selected.transferlocation_secondary = choice_secondary.name + . = TRUE + if("b_absorbchance") + var/absorb_chance_input = text2num(params["val"]) + if(!isnum(absorb_chance_input)) + return FALSE + host.vore_selected.absorbchance = sanitize_integer(absorb_chance_input, 0, 100, initial(host.vore_selected.absorbchance)) + . = TRUE + if("b_digestchance") + var/digest_chance_input = text2num(params["val"]) + if(!isnum(digest_chance_input)) + return FALSE + host.vore_selected.digestchance = sanitize_integer(digest_chance_input, 0, 100, initial(host.vore_selected.digestchance)) + . = TRUE + if("b_autotransferchance_primary") + var/autotransferchance_input = params["val"] + if(!isnum(autotransferchance_input)) + return FALSE + host.vore_selected.autotransferchance = sanitize_integer(autotransferchance_input, 0, 100, initial(host.vore_selected.autotransferchance)) + . = TRUE + if("b_autotransferwait") + var/autotransferwait_input = params["val"] + if(!isnum(autotransferwait_input)) + return FALSE + host.vore_selected.autotransferwait = sanitize_integer(autotransferwait_input*10, 10, 18000, initial(host.vore_selected.autotransferwait)) + . = TRUE + if("b_autotransferlocation_primary") + var/obj/belly/choice = locate(params["val"]) + + if(!istype(choice)) + host.vore_selected.autotransferlocation = null + else + host.vore_selected.autotransferlocation = choice.name + . = TRUE + if("b_autotransferextralocation_primary") + var/obj/belly/choice = locate(params["val"]) + if(!istype(choice)) + return FALSE + else if(choice.name in host.vore_selected.autotransferextralocation) + host.vore_selected.autotransferextralocation -= choice.name + else + host.vore_selected.autotransferextralocation += choice.name + . = TRUE + if("b_autotransferchance_secondary") + var/autotransferchance_secondary_input = params["val"] + if(!isnum(autotransferchance_secondary_input)) + return FALSE + host.vore_selected.autotransferchance_secondary = sanitize_integer(autotransferchance_secondary_input, 0, 100, initial(host.vore_selected.autotransferchance_secondary)) + . = TRUE + if("b_autotransferlocation_secondary") + var/obj/belly/choice = locate(params["val"]) + + if(!choice) + host.vore_selected.autotransferlocation_secondary = null + else + host.vore_selected.autotransferlocation_secondary = choice.name + . = TRUE + if("b_autotransferextralocation_secondary") + var/obj/belly/choice = locate(params["val"]) + if(!istype(choice)) //They cancelled, no changes + return FALSE + else if(choice.name in host.vore_selected.autotransferextralocation_secondary) + host.vore_selected.autotransferextralocation_secondary -= choice.name + else + host.vore_selected.autotransferextralocation_secondary += choice.name + . = TRUE + if("b_autotransfer_whitelist_primary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_whitelist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] + . = TRUE + if("b_autotransfer_blacklist_primary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_blacklist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] + . = TRUE + if("b_autotransfer_whitelist_secondary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_secondary_whitelist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] + . = TRUE + if("b_autotransfer_blacklist_secondary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_secondary_blacklist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] + . = TRUE + . = TRUE + if("b_autotransfer_whitelist_items_primary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list_items[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] + . = TRUE + if("b_autotransfer_blacklist_items_primary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list_items[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] + . = TRUE + if("b_autotransfer_whitelist_items_secondary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list_items[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_secondary_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] + . = TRUE + if("b_autotransfer_blacklist_items_secondary") + var/toggle_addon = params["val"] + if(!(host.vore_selected.autotransfer_flags_list_items[toggle_addon])) + return FALSE + host.vore_selected.autotransfer_secondary_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] + . = TRUE + if("b_autotransfer_min_amount") + var/autotransfer_min_amount_input = params["val"] + if(!isnum(autotransfer_min_amount_input)) + return FALSE + host.vore_selected.autotransfer_min_amount = sanitize_integer(autotransfer_min_amount_input, 0, 100, initial(host.vore_selected.autotransfer_min_amount)) + . = TRUE + if("b_autotransfer_max_amount") + var/autotransfer_max_amount_input = params["val"] + if(!isnum(autotransfer_max_amount_input)) + return FALSE + host.vore_selected.autotransfer_max_amount = sanitize_integer(autotransfer_max_amount_input, 0, 100, initial(host.vore_selected.autotransfer_max_amount)) + . = TRUE + if("b_autotransfer_enabled") + host.vore_selected.autotransfer_enabled = !host.vore_selected.autotransfer_enabled + . = TRUE + if("b_fullscreen") + host.vore_selected.belly_fullscreen = params["val"] + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_disable_hud") + host.vore_selected.disable_hud = !host.vore_selected.disable_hud + . = TRUE + if("b_colorization_enabled") //ALLOWS COLORIZATION. + host.vore_selected.colorization_enabled = !host.vore_selected.colorization_enabled + host.vore_selected.belly_fullscreen = "dark" //This prevents you from selecting a belly that is not meant to be colored and then turning colorization on. + . = TRUE + if("b_preview_belly") + host.vore_selected.vore_preview(host) //Gives them the stomach overlay. It fades away after ~2 seconds as human/life.dm removes the overlay if not in a gut. + . = TRUE + if("b_clear_preview") + host.vore_selected.clear_preview(host) //Clears the stomach overlay. This is a failsafe but shouldn't occur. + . = TRUE + if("b_fullscreen_color") + var/newcolor = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color) + if(newcolor) + host.vore_selected.belly_fullscreen_color = newcolor + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_fullscreen_color2") + var/newcolor2 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color2) + if(newcolor2) + host.vore_selected.belly_fullscreen_color2 = newcolor2 + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_fullscreen_color3") + var/newcolor3 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color3) + if(newcolor3) + host.vore_selected.belly_fullscreen_color3 = newcolor3 + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_fullscreen_color4") + var/newcolor4 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color4) + if(newcolor4) + host.vore_selected.belly_fullscreen_color4 = newcolor4 + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_fullscreen_alpha") + var/newalpha = text2num(params["val"]) + if(!isnum(newalpha)) + return FALSE + host.vore_selected.belly_fullscreen_alpha = newalpha + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_save_digest_mode") + host.vore_selected.save_digest_mode = !host.vore_selected.save_digest_mode + . = TRUE + if("b_del") + var/alert = tgui_alert(user, "Are you sure you want to delete your [lowertext(host.vore_selected.name)]?","Confirmation",list("Cancel","Delete")) + if(alert != "Delete") + return FALSE + + var/failure_msg = "" + + var/dest_for //Check to see if it's the destination of another vore organ. + for(var/obj/belly/B as anything in host.vore_organs) + if(B.transferlocation == host.vore_selected) + dest_for = B.name + failure_msg += "This is the destiantion for at least '[dest_for]' belly transfers. Remove it as the destination from any bellies before deleting it. " + break + if(B.transferlocation_secondary == host.vore_selected) + dest_for = B.name + failure_msg += "This is the destiantion for at least '[dest_for]' secondary belly transfers. Remove it as the destination from any bellies before deleting it. " + break + + if(host.vore_selected.contents.len) + failure_msg += "You cannot delete bellies with contents! " //These end with spaces, to be nice looking. Make sure you do the same. + if(host.vore_selected.immutable) + failure_msg += "This belly is marked as undeletable. " + if(host.vore_organs.len == 1) + failure_msg += "You must have at least one belly. " + + if(failure_msg) + tgui_alert_async(user,failure_msg,"Error!") + return FALSE + + if(host.soulgem?.linked_belly == host.vore_selected) + host.soulgem.linked_belly = null + + qdel(host.vore_selected) + host.vore_selected = host.vore_organs[1] + . = TRUE + if("b_private_struggle") + host.vore_selected.private_struggle = !host.vore_selected.private_struggle + . = TRUE + if("b_vorespawn_blacklist") + host.vore_selected.vorespawn_blacklist = !host.vore_selected.vorespawn_blacklist + . = TRUE + if("b_vorespawn_whitelist") + var/new_vorespawn_whitelist = sanitize(params["val"], MAX_MESSAGE_LEN, FALSE, TRUE, FALSE) + if(new_vorespawn_whitelist) + host.vore_selected.vorespawn_whitelist = splittext(lowertext(new_vorespawn_whitelist),"\n") + else + host.vore_selected.vorespawn_whitelist = list() + . = TRUE + if("b_vorespawn_absorbed") + var/current_number = params["val"] + switch(current_number) + if("Yes") + host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_YES + if("Prey Choice") + host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_PREY + if("No") + host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_YES) + host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_PREY) + . = TRUE + if("b_belly_sprite_to_affect") + var/belly_choice = params["val"] + if(!(belly_choice in host.vore_icon_bellies)) + return FALSE + host.vore_selected.belly_sprite_to_affect = belly_choice + host.handle_belly_update() + . = TRUE + if("b_affects_vore_sprites") + host.vore_selected.affects_vore_sprites = !host.vore_selected.affects_vore_sprites + host.handle_belly_update() + . = TRUE + if("b_count_absorbed_prey_for_sprites") + host.vore_selected.count_absorbed_prey_for_sprite = !host.vore_selected.count_absorbed_prey_for_sprite + host.handle_belly_update() + . = TRUE + if("b_absorbed_multiplier") + var/absorbed_multiplier_input = text2num(params["val"]) + if(!isnum(absorbed_multiplier_input)) + return FALSE + host.vore_selected.absorbed_multiplier = CLAMP(absorbed_multiplier_input, 0.1, 3) + host.handle_belly_update() + . = TRUE + if("b_count_items_for_sprites") + host.vore_selected.count_items_for_sprite = !host.vore_selected.count_items_for_sprite + host.handle_belly_update() + . = TRUE + if("b_item_multiplier") + var/item_multiplier_input = text2num(params["val"]) + if(!isnum(item_multiplier_input)) + return FALSE + host.vore_selected.item_multiplier = CLAMP(item_multiplier_input, 0.1, 10) + host.handle_belly_update() + . = TRUE + if("b_health_impacts_size") + host.vore_selected.health_impacts_size = !host.vore_selected.health_impacts_size + host.handle_belly_update() + . = TRUE + if("b_resist_animation") + host.vore_selected.resist_triggers_animation = !host.vore_selected.resist_triggers_animation + . = TRUE + if("b_size_factor_sprites") + var/size_factor_input = text2num(params["val"]) + if(!isnum(size_factor_input)) + return FALSE + host.vore_selected.size_factor_for_sprite = CLAMP(size_factor_input, 0.1, 3) + host.handle_belly_update() + . = TRUE + if("b_vore_sprite_flags") + var/toggle_vs_flag = params["val"] + if(!(toggle_vs_flag in host.vore_selected.vore_sprite_flag_list)) + return FALSE + host.vore_selected.vore_sprite_flags ^= host.vore_selected.vore_sprite_flag_list[toggle_vs_flag] + . = TRUE + if("b_count_liquid_for_sprites") + host.vore_selected.count_liquid_for_sprite = !host.vore_selected.count_liquid_for_sprite + host.handle_belly_update() + . = TRUE + if("b_liquid_multiplier") + var/liquid_multiplier_input = text2num(params["val"]) + if(!isnum(liquid_multiplier_input)) + return FALSE + host.vore_selected.liquid_multiplier = CLAMP(liquid_multiplier_input, 0.1, 10) + host.handle_belly_update() + . = TRUE + if("b_undergarment_choice") + var/new_undergarment = params["val"] + if(!(global_underwear.categories_by_name[new_undergarment])) + return FALSE + host.vore_selected.undergarment_chosen = new_undergarment + host.handle_belly_update() + . = TRUE + if("b_undergarment_if_none") + var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[host.vore_selected.undergarment_chosen] + var/selected_underwear = UWC.items_by_name[params["val"]] + if(!selected_underwear) //They cancelled, no changes + return FALSE + + host.vore_selected.undergarment_if_none = selected_underwear + host.handle_belly_update() + host.updateVRPanel() + if("b_undergarment_color") + var/newcolor = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.undergarment_color) + if(newcolor) + host.vore_selected.undergarment_color = newcolor + host.handle_belly_update() + . = TRUE + if("b_tail_to_change_to") + var/tail_choice = params["val"] + if(!(tail_choice in global.tail_styles_list)) + return FALSE + host.vore_selected.tail_to_change_to = tail_choice + . = TRUE + if("b_tail_color") + var/newcolor = tgui_color_picker(user, "Choose tail color.", "", host.vore_selected.tail_colouration) + if(newcolor) + host.vore_selected.tail_colouration = newcolor + . = TRUE + if("b_tail_color2") + var/newcolor = tgui_color_picker(user, "Choose tail secondary color.", "", host.vore_selected.tail_extra_overlay) + if(newcolor) + host.vore_selected.tail_extra_overlay = newcolor + . = TRUE + if("b_tail_color3") + var/newcolor = tgui_color_picker(user, "Choose tail tertiary color.", "", host.vore_selected.tail_extra_overlay2) + if(newcolor) + host.vore_selected.tail_extra_overlay2 = newcolor + . = TRUE + if("b_show_liq_fullness") + if(!host.vore_selected.show_fullness_messages) + host.vore_selected.show_fullness_messages = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid examination options.")) + else + host.vore_selected.show_fullness_messages = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid examination options.")) + . = TRUE + if("b_liq_msg_toggle1") + host.vore_selected.liquid_fullness1_messages = !host.vore_selected.liquid_fullness1_messages + . = TRUE + if("b_liq_msg_toggle2") + host.vore_selected.liquid_fullness2_messages = !host.vore_selected.liquid_fullness2_messages + . = TRUE + if("b_liq_msg_toggle3") + host.vore_selected.liquid_fullness3_messages = !host.vore_selected.liquid_fullness3_messages + . = TRUE + if("b_liq_msg_toggle4") + host.vore_selected.liquid_fullness4_messages = !host.vore_selected.liquid_fullness4_messages + . = TRUE + if("b_liq_msg_toggle5") + host.vore_selected.liquid_fullness5_messages = !host.vore_selected.liquid_fullness5_messages + . = TRUE + + if(.) + unsaved_changes = TRUE diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_set_liqattribute.dm b/code/modules/vore/eating/panel_databackend/vorepanel_set_liqattribute.dm new file mode 100644 index 0000000000..e531a702c3 --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_set_liqattribute.dm @@ -0,0 +1,215 @@ +// liquid belly procs +/datum/vore_look/proc/liq_set_attr(mob/user, params) + if(!host.vore_selected) + tgui_alert(user, "No belly selected to modify.") + return FALSE + + var/attr = params["attribute"] + switch(attr) + if("b_show_liq") + if(!host.vore_selected.show_liquids) + host.vore_selected.show_liquids = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid options.")) + else + host.vore_selected.show_liquids = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid options.")) + . = TRUE + if("b_liq_reagent_gen") + if(!host.vore_selected.reagentbellymode) //liquid container adjustments and interactions. + host.vore_selected.reagentbellymode = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has interactions which can produce liquids.")) + else //Doesnt produce liquids + host.vore_selected.reagentbellymode = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] wont produce liquids, liquids already in your [lowertext(host.vore_selected.name)] must be emptied out or removed with purge.")) + . = TRUE + if("b_liq_reagent_type") + var/new_reagent = params["val"] + if(!(new_reagent in host.vore_selected.reagent_choices)) + return FALSE + + host.vore_selected.reagent_chosen = new_reagent + host.vore_selected.ReagentSwitch() // For changing variables when a new reagent is chosen + . = TRUE + if("b_liq_reagent_name") + var/new_name = params["val"] + + if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) + tgui_alert(user, "Entered name length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + return FALSE + + host.vore_selected.reagent_name = new_name + . = TRUE + if("b_liq_reagent_transfer_verb") + var/new_verb = params["val"] + + if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) + tgui_alert(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") + return FALSE + + host.vore_selected.reagent_transfer_verb = new_verb + . = TRUE + if("b_liq_reagent_nutri_rate") + host.vore_selected.gen_time_display = params["val"] + switch(host.vore_selected.gen_time_display) + if("10 minutes") + host.vore_selected.gen_time = 0 + if("30 minutes") + host.vore_selected.gen_time = 2 + if("1 hour") + host.vore_selected.gen_time = 5 + if("3 hours") + host.vore_selected.gen_time = 17 + if("6 hours") + host.vore_selected.gen_time = 35 + if("12 hours") + host.vore_selected.gen_time = 71 + if("24 hours") + host.vore_selected.gen_time = 143 + . = TRUE + if("b_liq_reagent_capacity") + var/new_custom_vol = text2num(params["val"]) + if(!isnum(new_custom_vol)) + return FALSE + host.vore_selected.custom_max_volume = CLAMP(new_custom_vol, 10, 300) + . = TRUE + if("b_liq_sloshing") + if(!host.vore_selected.vorefootsteps_sounds) + host.vore_selected.vorefootsteps_sounds = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] can now make sounds when you walk around depending on how full you are.")) + else + host.vore_selected.vorefootsteps_sounds = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] wont make any liquid sounds no matter how full it is.")) + . = TRUE + if("b_liq_reagent_addons") + var/reagent_toggle_addon = params["val"] + if(!reagent_toggle_addon) + return FALSE + host.vore_selected.reagent_mode_flags ^= host.vore_selected.reagent_mode_flag_list[reagent_toggle_addon] + . = TRUE + if("b_liquid_overlay") + if(!host.vore_selected.liquid_overlay) + host.vore_selected.liquid_overlay = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid overlay enabled.")) + else + host.vore_selected.liquid_overlay = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid overlay enabled.")) + . = TRUE + if("b_max_liquid_level") + var/new_max_liquid_level = params["val"] + if(!isnum(new_max_liquid_level)) + return FALSE + host.vore_selected.max_liquid_level = CLAMP(new_max_liquid_level, 0, 100) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_custom_reagentcolor") + var/newcolor = tgui_color_picker(user, "Choose custom color for liquid overlay. Cancel for normal reagent color.", "", host.vore_selected.custom_reagentcolor) + if(newcolor) + host.vore_selected.custom_reagentcolor = newcolor + else + host.vore_selected.custom_reagentcolor = null + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_custom_reagentalpha") + var/newalpha = text2num(params["val"]) + if(!isnum(newalpha)) + return FALSE + if(newalpha) + host.vore_selected.custom_reagentalpha = CLAMP(newalpha, 0, 255) + else + host.vore_selected.custom_reagentalpha = null + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_reagent_touches") + if(!host.vore_selected.reagent_touches) + host.vore_selected.reagent_touches = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] will now apply reagents to creatures when digesting.")) + else + host.vore_selected.reagent_touches = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] will no longer apply reagents to creatures when digesting.")) + . = TRUE + if("b_mush_overlay") + if(!host.vore_selected.mush_overlay) + host.vore_selected.mush_overlay = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has fullness overlay enabled.")) + else + host.vore_selected.mush_overlay = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has fullness overlay enabled.")) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_mush_color") + var/newcolor = tgui_color_picker(user, "Choose custom color for mush overlay.", "", host.vore_selected.mush_color) + if(newcolor) + host.vore_selected.mush_color = newcolor + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_mush_alpha") + var/newalpha = text2num(params["val"]) + if(!isnum(newalpha)) + return FALSE + host.vore_selected.mush_alpha = CLAMP(newalpha, 0, 255) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_max_mush") + var/new_max_mush = text2num(params["val"]) + if(!isnum(new_max_mush)) + return FALSE + host.vore_selected.max_mush = CLAMP(new_max_mush, 0, 6000) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_min_mush") + var/new_min_mush = text2num(params["val"]) + if(!isnum(new_min_mush)) + return FALSE + host.vore_selected.min_mush = CLAMP(new_min_mush, 0, 100) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_item_mush_val") + var/new_item_mush_val = text2num(params["val"]) + if(!isnum(new_item_mush_val)) + return FALSE + host.vore_selected.item_mush_val = CLAMP(new_item_mush_val, 0, 1000) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_metabolism_overlay") + if(!host.vore_selected.metabolism_overlay) + host.vore_selected.metabolism_overlay = 1 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has ingested metabolism overlay enabled.")) + else + host.vore_selected.metabolism_overlay = 0 + to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has ingested metabolism overlay enabled.")) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_metabolism_mush_ratio") + var/new_metabolism_mush_ratio = text2num(params["val"]) + if(!isnum(new_metabolism_mush_ratio)) + return FALSE + host.vore_selected.metabolism_mush_ratio = CLAMP(new_metabolism_mush_ratio, 0, 500) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_max_ingested") + var/new_max_ingested = text2num(params["val"]) + if(!isnum(new_max_ingested)) + return FALSE + host.vore_selected.max_ingested = CLAMP(new_max_ingested, 0, 6000) + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_custom_ingested_color") + var/newcolor = tgui_color_picker(user, "Choose custom color for ingested metabolism overlay. Cancel for reagent-based dynamic blend.", "", host.vore_selected.custom_ingested_color) + if(newcolor) + host.vore_selected.custom_ingested_color = newcolor + else + host.vore_selected.custom_ingested_color = null + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_custom_ingested_alpha") + var/newalpha = text2num(params["val"]) + if(!isnum(newalpha)) + return FALSE + host.vore_selected.custom_ingested_alpha = newalpha + host.vore_selected.update_internal_overlay() + . = TRUE + if("b_liq_purge") + host.vore_selected.reagents.clear_reagents() + . = TRUE + if(.) + unsaved_changes = TRUE diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_soulcatcher_data.dm b/code/modules/vore/eating/panel_databackend/vorepanel_soulcatcher_data.dm new file mode 100644 index 0000000000..ed8816eb37 --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_soulcatcher_data.dm @@ -0,0 +1,99 @@ +#define INTERIOR_DESIGN "Interior Design" +#define CAPTURE_MESSAGE "Capture Message" +#define TRANSIT_MESSAGE "Transit Message" +#define TRANSFER_MESSAGE "Transfer Message" +#define RELEASE_MESSAGE "Release Message" +#define DELETE_MESSAGE "Delete Message" + + +/datum/vore_look/proc/get_soulcatcher_data(mob/owner) + if(!owner.soulgem) + return null + + var/list/stored_souls = list() + for(var/soul in owner.soulgem.brainmobs) + var/list/info = list("displayText" = "[soul]", "value" = "\ref[soul]") + stored_souls.Add(list(info)) + var/list/soulcatcher_data = list( + "active" = owner.soulgem.flag_check(SOULGEM_ACTIVE), + "name" = owner.soulgem.name, + "caught_souls" = stored_souls, + "selected_soul" = owner.soulgem.selected_soul, + "selected_sfx" = owner.soulgem.linked_belly, + "sc_message_data" = compile_soulcatcher_message_data(owner.soulgem), + "taken_over" = owner.soulgem.is_taken_over(), + "catch_self" = owner.soulgem.flag_check(NIF_SC_CATCHING_ME), + "catch_prey" = owner.soulgem.flag_check(NIF_SC_CATCHING_OTHERS), + "catch_drain" = owner.soulgem.flag_check(SOULGEM_CATCHING_DRAIN), + "catch_ghost" = owner.soulgem.flag_check(SOULGEM_CATCHING_GHOSTS), + "ext_hearing" = owner.soulgem.flag_check(NIF_SC_ALLOW_EARS), + "ext_vision" = owner.soulgem.flag_check(NIF_SC_ALLOW_EYES), + "mind_backups" = owner.soulgem.flag_check(NIF_SC_BACKUPS), + "sr_projecting" = owner.soulgem.flag_check(NIF_SC_PROJECTING), + "show_vore_sfx" = owner.soulgem.flag_check(SOULGEM_SHOW_VORE_SFX), + "see_sr_projecting" = owner.soulgem.flag_check(SOULGEM_SEE_SR_SOULS), + ) + return soulcatcher_data + +/datum/vore_look/proc/compile_soulcatcher_message_data(obj/soulgem/gem) + if(!sc_message_subtab) + sc_message_subtab = INTERIOR_DESIGN + var/list/tab_data = list( + "possible_messages" = list(INTERIOR_DESIGN, CAPTURE_MESSAGE, TRANSIT_MESSAGE, TRANSFER_MESSAGE, RELEASE_MESSAGE, DELETE_MESSAGE), + "sc_subtab" = sc_message_subtab + ) + if(sc_message_subtab == INTERIOR_DESIGN) + tab_data["max_length"] = VORE_SC_DESC_MAX + tab_data["active_message"] = gem.inside_flavor + tab_data["set_action"] = SC_INTERIOR_MESSAGE + tab_data["tooltip"] = "Displayed to prey after being 'caught' by the soulcatcher. This will be displayed after an intro set in the capture message. If you already have prey and change the interior, this will be displayed after the transit message." + if(sc_message_subtab == CAPTURE_MESSAGE) + tab_data["max_length"] = VORE_SC_MAX + tab_data["active_message"] = gem.capture_message + tab_data["set_action"] = SC_CAPTURE_MEESAGE + tab_data["tooltip"] = "Change what the prey sees while being 'caught'. This will be printed before the iterior design to the prey." + if(sc_message_subtab == TRANSIT_MESSAGE) + tab_data["max_length"] = VORE_SC_MAX + tab_data["active_message"] = gem.transit_message + tab_data["set_action"] = SC_TRANSIT_MESSAGE + tab_data["tooltip"] = "Change what the prey sees when you change the interior with them already captured." + if(sc_message_subtab == TRANSFER_MESSAGE) + tab_data["max_length"] = VORE_SC_MAX + tab_data["active_message"] = gem.transfer_message + tab_data["set_action"] = SC_TRANSFERE_MESSAGE + tab_data["tooltip"] = "Change what the prey sees when they are transfered." + if(sc_message_subtab == RELEASE_MESSAGE) + tab_data["max_length"] = VORE_SC_MAX + tab_data["active_message"] = gem.release_message + tab_data["set_action"] = SC_RELEASE_MESSAGE + tab_data["tooltip"] = "Change what the prey sees when they are released." + if(sc_message_subtab == DELETE_MESSAGE) + tab_data["max_length"] = VORE_SC_MAX + tab_data["active_message"] = gem.delete_message + tab_data["set_action"] = SC_DELETE_MESSAGE + tab_data["tooltip"] = "Change what the prey sees when they are deleted." + return tab_data + +/datum/vore_look/proc/get_ability_data(mob/owner) + var/list/abilities = list() + + var/nutri_value = 0 + if(isliving(owner)) + var/mob/living/H = owner + nutri_value = H.nutrition + + abilities["nutrition"] = nutri_value + abilities["size_change"] = list ( + "current_size" = owner.size_multiplier, + "minimum_size" = owner.has_large_resize_bounds() ? RESIZE_MINIMUM_DORMS : RESIZE_MINIMUM, + "maximum_size" = owner.has_large_resize_bounds() ? RESIZE_MAXIMUM_DORMS : RESIZE_MAXIMUM, + "resize_cost" = VORE_RESIZE_COST + ) + return abilities + +#undef INTERIOR_DESIGN +#undef CAPTURE_MESSAGE +#undef TRANSIT_MESSAGE +#undef TRANSFER_MESSAGE +#undef RELEASE_MESSAGE +#undef DELETE_MESSAGE diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_vore_data.dm b/code/modules/vore/eating/panel_databackend/vorepanel_vore_data.dm new file mode 100644 index 0000000000..b45c1c344d --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_vore_data.dm @@ -0,0 +1,328 @@ +#define CONTROL_TAB 0 +#define DESCRIPTIONS_TAB 1 +#define OPTIONS_TAB 2 +#define SOUNDS_TAB 3 +#define VISUALS_TAB 4 +#define INTERACTIONS_TAB 5 +#define CONTENTS_TAB 6 +#define LIQUID_OPTIONS_TAB 7 + +/datum/vore_look/proc/get_vorebellies(mob/owner, full_data = TRUE) + var/list/our_bellies = list() + for(var/obj/belly/B as anything in owner.vore_organs) + var/list/belly_data = list() + belly_data += list( + "name" = B.name, + "ref" = "\ref[B]" + ) + if(full_data) + belly_data += list( + "selected" = (B == owner.vore_selected), + "digest_mode" = B.digest_mode, + "contents" = LAZYLEN(B.contents), + "prevent_saving" = B.prevent_saving + ) + UNTYPED_LIST_ADD(our_bellies, belly_data) + return our_bellies + +/datum/vore_look/proc/get_inside_data(mob/owner) + var/atom/hostloc = owner.loc + //Allow VorePanel to show pred belly details even while indirectly inside + if(isliving(owner)) + var/mob/living/H = owner + hostloc = H.surrounding_belly() + //End of indirect vorefx additions + var/list/inside = list() + if(isbelly(hostloc)) + var/obj/belly/inside_belly = hostloc + var/mob/living/pred = inside_belly.owner + + var/inside_desc = "No description." + if(owner.absorbed && inside_belly.absorbed_desc) + inside_desc = inside_belly.absorbed_desc + else if(inside_belly.desc) + inside_desc = inside_belly.desc + + if(inside_desc != "No description.") + inside_desc = inside_belly.belly_format_string(inside_desc, owner, use_first_only = TRUE) + + inside = list( + "absorbed" = owner.absorbed, + "belly_name" = inside_belly.name, + "belly_mode" = inside_belly.digest_mode, + "desc" = inside_desc, + "pred" = pred, + "ref" = "\ref[inside_belly]", + "liq_lvl" = inside_belly.reagents.total_volume, + "liq_reagent_type" = inside_belly.reagent_chosen, + "liuq_name" = inside_belly.reagent_name, + ) + + var/list/inside_contents = list() + for(var/atom/movable/O in inside_belly) + if(O == owner) + continue + + var/list/info = list( + "name" = "[O]", + "absorbed" = FALSE, + "stat" = 0, + "ref" = "\ref[O]", + "outside" = FALSE, + ) + if(show_pictures) //disables icon mode + if(inside_belly.contents.len <= max_icon_content) + icon_overflow = FALSE + info["icon"] = cached_nom_icon(O) + else + icon_overflow = TRUE + if(isliving(O)) + var/mob/living/M = O + info["stat"] = M.stat + if(M.absorbed) + info["absorbed"] = TRUE + UNTYPED_LIST_ADD(inside_contents, info) + inside["contents"] = inside_contents + return inside + +/datum/vore_look/proc/get_host_mobtype(mob/owner) + var/list/host_mobtype = list("is_cyborg" = FALSE, "is_vore_simple_mob" = FALSE) + if(isrobot(owner)) + host_mobtype["is_cyborg"] = TRUE + else if(istype(owner, /mob/living/simple_mob/vore)) //So far, this does nothing. But, creating this for future belly work + host_mobtype["is_vore_simple_mob"] = TRUE + return host_mobtype + +/datum/vore_look/proc/get_selected_data(mob/owner) + var/list/selected_list = null + if(owner.vore_selected) + var/obj/belly/selected = owner.vore_selected + selected_list = list("belly_name" = selected.name) + if(active_vore_tab == CONTROL_TAB) + var/list/addons = list() + for(var/flag_name in selected.mode_flag_list) + UNTYPED_LIST_ADD(addons, list("label" = flag_name, "selection" = selected.mode_flags & selected.mode_flag_list[flag_name])) + var/list/belly_mode_data = list( + "mode" = selected.digest_mode, + "item_mode" = selected.item_digest_mode, + "addons" = addons, + "name_length" = BELLIES_NAME_MAX, + "name_min" = BELLIES_NAME_MIN, + "mode_options" = host.vore_selected.digest_modes, + "item_mode_options" = host.vore_selected.item_digest_modes, + + ) + selected_list["belly_mode_data"] = belly_mode_data + + if(active_vore_tab == DESCRIPTIONS_TAB) + // Compile our displayed options + var/list/displayed_options = list( + VPANEL_DESCRIPTION_TAB, + VPANEL_EXAMINE_TAB, + VPANEL_TRASH_EATER_TAB + ) + if(selected.message_mode || selected.escapable) + displayed_options += VPANEL_STRUGGLE_TAB + displayed_options += VPANEL_ESCAPE_TAB + displayed_options += VPANEL_ESCAPE_ABSORBED_TAB + if(selected.message_mode || (selected.escapable && (selected.transferlocation || selected.transferlocation_secondary)) || selected.autotransfer_enabled && (selected.autotransferlocation || selected.autotransferlocation_secondary)) + displayed_options += VPANEL_TRANSFER_TAB + if(selected.message_mode || selected.escapable && (selected.digestchance || selected.absorbchance)) + displayed_options += VPANEL_INTERACTION_TAB + if(selected.message_mode || selected.digest_mode == DM_DIGEST || selected.digest_mode == DM_SELECT || selected.digest_mode == DM_ABSORB || selected.digest_mode == DM_UNABSORB) + displayed_options += VPANEL_BELLYMODE_TAB + if(selected.message_mode || selected.emote_active) + displayed_options += VPANEL_IDLE_TAB + if(selected.message_mode || selected.show_fullness_messages) + displayed_options += VPANEL_LIQUIDS_TAB + + var/list/belly_description_data = list( + "displayed_message_types" = compile_message_data(selected), + "verb" = selected.vore_verb, + "release_verb" = selected.release_verb, + "message_mode" = selected.message_mode, + "displayed_options" = displayed_options, + "message_option" = message_option, + "message_subtab" = message_subtab, + "selected_message" = selected_message, + "show_liq_fullness" = selected.show_fullness_messages, + "emote_time" = selected.emote_time, + "emote_active" = selected.emote_active, + "entrance_logs" = selected.entrance_logs, + "item_digest_logs" = selected.item_digest_logs, + "name_min" = BELLIES_NAME_MIN, + "name_length" = BELLIES_NAME_MAX, + ) + selected_list["belly_description_data"] = belly_description_data + + if(active_vore_tab == OPTIONS_TAB) + var/list/silicon_control = list( + "silicon_belly_overlay_preference" = selected.silicon_belly_overlay_preference, + "belly_sprite_option_shown" = LAZYLEN(owner.vore_icon_bellies) >= 1 ? TRUE : FALSE, + "belly_sprite_to_affect" = selected.belly_sprite_to_affect + ) + var/list/belly_option_data = list( + "can_taste" = selected.can_taste, + "is_feedable" = selected.is_feedable, + "nutrition_percent" = selected.nutrition_percent, + "digest_brute" = selected.digest_brute, + "digest_burn" = selected.digest_burn, + "digest_oxy" = selected.digest_oxy, + "digest_tox" = selected.digest_tox, + "digest_clone" = selected.digest_clone, + "digest_max" = selected.digest_max, + "digest_free" = selected.get_unused_digestion_damage(), + "bulge_size" = selected.bulge_size, + "shrink_grow_size" = selected.shrink_grow_size, + "contaminates" = selected.contaminates, + "egg_type" = selected.egg_type, + "egg_types" = GLOB.global_vore_egg_types, + "egg_name" = selected.egg_name, + "egg_size" = selected.egg_size, + "recycling" = selected.recycling, + "storing_nutrition" = selected.storing_nutrition, + "selective_preference" = selected.selective_preference, + "save_digest_mode" = selected.save_digest_mode, + "eating_privacy_local" = selected.eating_privacy_local, + "vorespawn_blacklist" = selected.vorespawn_blacklist, + "vorespawn_whitelist" = selected.vorespawn_whitelist, + "vorespawn_absorbed" = (global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_YES) + global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_PREY)), + "private_struggle" = selected.private_struggle, + "drainmode" = selected.drainmode, + "drainmode_options" = selected.drainmodes, + "mob_belly_controls" = silicon_control + ) + if(selected.contaminates) + belly_option_data += list( + "contaminate_flavor" = selected.contamination_flavor, + "contaminate_options" = GLOB.contamination_flavors, + "contaminate_color" = selected.contamination_color, + "contaminate_colors" = GLOB.contamination_colors + ) + + selected_list["belly_option_data"] = belly_option_data + + if(active_vore_tab == SOUNDS_TAB) + var/list/belly_sound_data = list( + "is_wet" = selected.is_wet, + "wet_loop" = selected.wet_loop, + "fancy" = selected.fancy_vore, + "sound" = selected.vore_sound, + "release_sound" = selected.release_sound, + "sound_volume" = selected.sound_volume, + "noise_freq" = selected.noise_freq, + "min_voice_freq" = MIN_VOICE_FREQ, + "max_voice_freq" = MAX_VOICE_FREQ, + "vore_sound_list" = (selected.fancy_vore ? GLOB.fancy_vore_sounds : GLOB.classic_vore_sounds), + "release_sound_list" = (selected.fancy_vore ? GLOB.fancy_release_sounds : GLOB.classic_release_sounds) + ) + selected_list["belly_sound_data"] = belly_sound_data + + if(active_vore_tab == VISUALS_TAB) + var/list/belly_fullscreens + if(selected.colorization_enabled) + belly_fullscreens = icon_states('icons/mob/screen_full_vore_list.dmi') //Makes any icons inside of here selectable. + else + belly_fullscreens = icon_states('icons/mob/screen_full_vore.dmi') //Non colorable + + var/list/vs_flags = list() + for(var/flag_name in selected.vore_sprite_flag_list) + UNTYPED_LIST_ADD(vs_flags, list("label" = flag_name, "selection" = selected.vore_sprite_flags & selected.vore_sprite_flag_list[flag_name])) + + var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[host.vore_selected.undergarment_chosen] + var/list/undergarments + if(UWC) + undergarments = UWC.items + + var/list/belly_visual_data = list( + "belly_fullscreen" = selected.belly_fullscreen, + "colorization_enabled" = selected.colorization_enabled, + "belly_fullscreen_color" = selected.belly_fullscreen_color, + "belly_fullscreen_color2" = selected.belly_fullscreen_color2, + "belly_fullscreen_color3" = selected.belly_fullscreen_color3, + "belly_fullscreen_color4" = selected.belly_fullscreen_color4, + "belly_fullscreen_alpha" = selected.belly_fullscreen_alpha, + "possible_fullscreens" = belly_fullscreens, + "disable_hud" = selected.disable_hud, + "vore_sprite_flags" = vs_flags, + "affects_voresprite" = selected.affects_vore_sprites, + "absorbed_voresprite" = selected.count_absorbed_prey_for_sprite, + "absorbed_multiplier" = selected.absorbed_multiplier, + "liquid_voresprite" = selected.count_liquid_for_sprite, + "liquid_multiplier" = selected.liquid_multiplier, + "item_voresprite" = selected.count_items_for_sprite, + "item_multiplier" = selected.item_multiplier, + "health_voresprite" = selected.health_impacts_size, + "resist_animation" = selected.resist_triggers_animation, + "voresprite_size_factor" = selected.size_factor_for_sprite, + "belly_sprite_to_affect" = selected.belly_sprite_to_affect, + "belly_sprite_options" = host.vore_icon_bellies, + "undergarment_chosen" = selected.undergarment_chosen, + "undergarment_if_none" = selected.undergarment_if_none || "None", + "undergarment_options" = global_underwear.categories, + "undergarment_options_if_none" = undergarments, + "undergarment_color" = selected.undergarment_color, + "tail_option_shown" = ishuman(owner), + "tail_to_change_to" = selected.tail_to_change_to, + "tail_sprite_options" = global.tail_styles_list + ) + selected_list["belly_visual_data"] = belly_visual_data + + if(active_vore_tab == INTERACTIONS_TAB) + var/list/belly_interaction_data = list( + "escapable" = selected.escapable, + "interacts" = compile_interact_data(selected), + "autotransfer_enabled" = selected.autotransfer_enabled, + "autotransfer" = compile_autotransfer_data(selected) + ) + selected_list["belly_interaction_data"] = belly_interaction_data + + + var/list/selected_contents + var/total_content_count = 0 + for(var/O in selected) + total_content_count++ + if(active_vore_tab == CONTENTS_TAB) + var/list/info = list( + "name" = "[O]", + "absorbed" = FALSE, + "stat" = 0, + "ref" = "\ref[O]", + "outside" = TRUE, + ) + if(show_pictures) //disables icon mode + if(selected.contents.len <= max_icon_content) + icon_overflow = FALSE + info["icon"] = cached_nom_icon(O) + else + icon_overflow = TRUE + + if(isliving(O)) + var/mob/living/M = O + info["stat"] = M.stat + if(M.absorbed) + info["absorbed"] = TRUE + LAZYADD(selected_contents, list(info)) + if(active_vore_tab == CONTENTS_TAB) + selected_list["contents"] = selected_contents + + selected_list["content_length"] = total_content_count + + if(active_vore_tab == LIQUID_OPTIONS_TAB) + // liquid belly options + var/list/belly_liquid_data = list( + "show_liq" = selected.show_liquids, + "liq_interacts" = compile_liquid_interact_data(selected) + ) + selected_list["belly_liquid_data"] = belly_liquid_data + + return selected_list + +#undef CONTROL_TAB +#undef DESCRIPTIONS_TAB +#undef OPTIONS_TAB +#undef SOUNDS_TAB +#undef VISUALS_TAB +#undef INTERACTIONS_TAB +#undef CONTENTS_TAB +#undef LIQUID_OPTIONS_TAB diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm new file mode 100644 index 0000000000..0408e115ab --- /dev/null +++ b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm @@ -0,0 +1,759 @@ +#define DEFAULT_MESSAGE "Default" +#define ABSORBED_MESSAGE "Absorbed" +#define WITH_PREY "With Prey" +#define WITH_ABSORBED_PREY "With Absorbed Prey" +#define TRASH_EAT "Eat" +#define TRASH_EXPEL "Expel" +#define OUTSIDE_MESSAGE "Outside" +#define INSIDE_MESSAGE "Inside" +#define TO_YOU "To You" +#define TO_PREY "To Prey" +#define ATTEMPT_MESSAGE "Attempt" +#define SUCCESS_MESSAGE "Success" +#define ITEM_MESSAGE "Item" +#define FAIL_MESSAGE "Fail" +#define PRIMARY_MESSAGE "Primary" +#define SECONARY_MESSAGE "Secondary" +#define PRIMARY_AUTO_MESSAGE "Primary (Auto)" +#define SECONARY_AUTO_MESSAGE "Secondary (Auto)" +#define DIGEST_MESSAGE "Digest" +#define HOLD_MESSAGE "Hold" +#define HOLDABSORBED_MESSAGE "Hold (Absorbed)" +#define ABSORB_MESSAGE "Absorb" +#define HEAL_MESSAGE "Heal" +#define DRAIN_MESSAGE "Drain" +#define STEAL_MESSAGE "Steal" +#define EGG_MESSAGE "Egg" +#define SHRINK_MESSAGE "Shrink" +#define GROW_MESSAGE "Grow" +#define UNABSORB_MESSAGE "Unabsorb" +#define LIQUID0 "Liquid 0-20%" +#define LIQUID20 "Liquid 20-40%" +#define LIQUID40 "Liquid 40-60%" +#define LIQUID60 "Liquid 60-80%" +#define LIQUID80 "Liquid 80-100%" + +/datum/vore_look/proc/compile_message_data(obj/belly/selected) + if(message_option == VPANEL_DESCRIPTION_TAB) + var/list/tab_data = list( + "possible_messages" = list(DEFAULT_MESSAGE, ABSORBED_MESSAGE) + ) + if(!selected_message) + selected_message = DEFAULT_MESSAGE + if(selected_message == DEFAULT_MESSAGE) + tab_data["max_length"] = BELLIES_DESC_MAX + tab_data["active_message"] = selected.desc + tab_data["set_action"] = BELLY_DESCRIPTION_MESSAGE + tab_data["tooltip"] = "Displayed to prey upon consumption." + return tab_data + if(selected_message == ABSORBED_MESSAGE) + tab_data["max_length"] = BELLIES_DESC_MAX + tab_data["active_message"] = selected.absorbed_desc + tab_data["set_action"] = BELLY_DESCRIPTION_MESSAGE_ABSROED + tab_data["tooltip"] = "Displayed to prey after absorption." + return tab_data + + if(message_option == VPANEL_EXAMINE_TAB) + var/list/tab_data = list( + "possible_messages" = list(WITH_PREY, WITH_ABSORBED_PREY) + ) + if(!selected_message) + selected_message = WITH_PREY + if(selected_message == WITH_PREY) + tab_data["max_length"] = BELLIES_EXAMINE_MAX + tab_data["active_message"] = selected.examine_messages + tab_data["set_action"] = EXAMINES + tab_data["tooltip"] = "Displayed to nearby players during examination when the vorgan is full." + return tab_data + if(selected_message == WITH_ABSORBED_PREY) + tab_data["max_length"] = BELLIES_EXAMINE_MAX + tab_data["active_message"] = selected.examine_messages_absorbed + tab_data["set_action"] = EXAMINES_ABSORBED + tab_data["tooltip"] = "Displayed to nearby players during examination when the vorgan contains absorbed prey." + tab_data["button_label"] = "Display Absorbed Examine" + tab_data["button_action"] = "b_display_absorbed_examine" + tab_data["button_data"] = selected.display_absorbed_examine + tab_data["button_tooltip"] = "the absorbed description on examine." // those will automatically be preceeded by Enables / Disables! + return tab_data + + if(message_option == VPANEL_TRASH_EATER_TAB) + var/list/tab_data = list( + "possible_messages" = list(TRASH_EAT, TRASH_EXPEL) + ) + if(!selected_message) + selected_message = TRASH_EAT + if(selected_message == TRASH_EAT) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.trash_eater_in + tab_data["set_action"] = BELLY_TRASH_EATER_IN + tab_data["tooltip"] = "Displayed to nearby players when you ingest trash items." + return tab_data + if(selected_message == TRASH_EXPEL) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.trash_eater_out + tab_data["set_action"] = BELLY_TRASH_EATER_OUT + tab_data["tooltip"] = "Displayed to nearby players when you expel trash items." + return tab_data + + if(message_option == VPANEL_STRUGGLE_TAB) + var/list/tab_data = list( + "subtypes" = list(DEFAULT_MESSAGE, ABSORBED_MESSAGE) + ) + if(!message_subtab) + message_subtab = DEFAULT_MESSAGE + if(message_subtab == DEFAULT_MESSAGE) + tab_data["possible_messages"] = list(OUTSIDE_MESSAGE, INSIDE_MESSAGE) + if(!selected_message) + selected_message = OUTSIDE_MESSAGE + if(selected_message == OUTSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.struggle_messages_outside + tab_data["set_action"] = STRUGGLE_OUTSIDE + tab_data["tooltip"] = "Displayed to nearby players when your prey resists." + return tab_data + if(selected_message == INSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.struggle_messages_inside + tab_data["set_action"] = STRUGGLE_INSIDE + tab_data["tooltip"] = "Displayed to your prey when they resists." + return tab_data + if(message_subtab == ABSORBED_MESSAGE) + tab_data["possible_messages"] = list(OUTSIDE_MESSAGE, INSIDE_MESSAGE) + if(!selected_message) + selected_message = OUTSIDE_MESSAGE + if(selected_message == OUTSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorbed_struggle_messages_outside + tab_data["set_action"] = ABSORBED_STRUGGLE_OUSIDE + tab_data["tooltip"] = "Displayed to nearby players when your absorb prey resists." + return tab_data + if(selected_message == INSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorbed_struggle_messages_inside + tab_data["set_action"] = ABSORBED_STRUGGLE_INSIDE + tab_data["tooltip"] = "Displayed to your prey when absorbed prey resists." + return tab_data + + if(message_option == VPANEL_ESCAPE_TAB) + var/list/tab_data = list( + "subtypes" = list(ITEM_MESSAGE, ATTEMPT_MESSAGE, FAIL_MESSAGE) + ) + if(selected.message_mode || selected.escapechance) + tab_data["subtypes"] += SUCCESS_MESSAGE + if(!message_subtab) + message_subtab = ATTEMPT_MESSAGE + if(message_subtab == ATTEMPT_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_attempt_messages_prey + tab_data["set_action"] = ESCAPE_ATTEMPT_PREY + tab_data["tooltip"] = "Displayed to your prey when they trigger an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_attempt_messages_owner + tab_data["set_action"] = ESCAPE_ATTEMPT_OWNER + tab_data["tooltip"] = "Displayed to you when your prey triggers an escape attempt." + return tab_data + if(message_subtab == SUCCESS_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU, OUTSIDE_MESSAGE) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_messages_prey + tab_data["set_action"] = ESCAPE_PREY + tab_data["tooltip"] = "Displayed to your prey when they succeed an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_messages_owner + tab_data["set_action"] = ESCAPE_OWNER + tab_data["tooltip"] = "Displayed to you when your prey succeeds an escape attempt." + return tab_data + if(selected_message == OUTSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_messages_outside + tab_data["set_action"] = ESCAPE_OUTSIDE + tab_data["tooltip"] = "Displayed to nearby players when your prey succeeds an escape attempt." + return tab_data + if(message_subtab == ITEM_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU, OUTSIDE_MESSAGE) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_item_messages_prey + tab_data["set_action"] = ESCAPE_ITEM_PREY + tab_data["tooltip"] = "Displayed to your prey when they manage to push an item out of your belly." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_item_messages_owner + tab_data["set_action"] = ESCAPE_ITEM_OWNER + tab_data["tooltip"] = "Displayed to you when your prey manages to push an item out of your belly." + return tab_data + if(selected_message == OUTSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_item_messages_outside + tab_data["set_action"] = ESCAPE_ITEM_OUTSIDE + tab_data["tooltip"] = "Displayed to nearby players when your prey manages to push an item out of your belly." + return tab_data + if(message_subtab == FAIL_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_fail_messages_prey + tab_data["set_action"] = ESCAPE_FAIL_PREY + tab_data["tooltip"] = "Displayed to your prey when they fail an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_fail_messages_owner + tab_data["set_action"] = ESCAPE_FAIL_OWNER + tab_data["tooltip"] = "Displayed to you when your prey fails an escape attempt." + return tab_data + + if(message_option == VPANEL_ESCAPE_ABSORBED_TAB) + var/list/tab_data = list( + "subtypes" = list(ATTEMPT_MESSAGE, FAIL_MESSAGE) + ) + if(selected.message_mode || selected.escapechance_absorbed) + tab_data["subtypes"] += SUCCESS_MESSAGE + if(!message_subtab) + message_subtab = ATTEMPT_MESSAGE + if(message_subtab == ATTEMPT_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_attempt_absorbed_messages_prey + tab_data["set_action"] = ABSORBED_ESCAPE_ATTEMPT_PREY + tab_data["tooltip"] = "Displayed to your prey when they trigger an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_attempt_absorbed_messages_owner + tab_data["set_action"] = ABSORBED_ESCAPE_ATTEMPT_OWNER + tab_data["tooltip"] = "Displayed to you when your prey triggers an escape attempt." + return tab_data + if(message_subtab == SUCCESS_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU, OUTSIDE_MESSAGE) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_absorbed_messages_prey + tab_data["set_action"] = ABSORBED_ESCAPE_PREY + tab_data["tooltip"] = "Displayed to your absorbed prey when they succeed an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_absorbed_messages_owner + tab_data["set_action"] = ABSORBED_ESCAPE_OWNER + tab_data["tooltip"] = "Displayed to you when your absorbed prey succeeds an escape attempt." + return tab_data + if(selected_message == OUTSIDE_MESSAGE) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_absorbed_messages_outside + tab_data["set_action"] = ABSORBED_ESCAPE_OUTSIDE + tab_data["tooltip"] = "Displayed to nearby players when your absorbed prey succeeds an escape attempt." + return tab_data + if(message_subtab == FAIL_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_fail_absorbed_messages_prey + tab_data["set_action"] = ABSORBED_ESCAPE_FAIL_PREY + tab_data["tooltip"] = "Displayed to your absorbed prey when they fail an escape attempt." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.escape_fail_absorbed_messages_owner + tab_data["set_action"] = ABSORBED_ESCAPE_FAIL_OWNER + tab_data["tooltip"] = "Displayed to you when your absorbed prey fails an escape attempt." + return tab_data + + if(message_option == VPANEL_TRANSFER_TAB) + var/list/tab_data = list( + "subtypes" = list() + ) + if(selected.message_mode || selected.transferlocation) + tab_data["subtypes"] += PRIMARY_MESSAGE + if(selected.message_mode || selected.transferlocation_secondary) + tab_data["subtypes"] += SECONARY_MESSAGE + if(selected.message_mode || selected.autotransferlocation) + tab_data["subtypes"] += PRIMARY_AUTO_MESSAGE + if(selected.message_mode || selected.autotransferlocation_secondary) + tab_data["subtypes"] += SECONARY_AUTO_MESSAGE + if(!message_subtab) + message_subtab = PRIMARY_MESSAGE + if(message_subtab == PRIMARY_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.primary_transfer_messages_prey + tab_data["set_action"] = PRIMARY_TRANSFER_PREY + tab_data["tooltip"] = "Displayed to your prey when they get transfered to the primary transfer location." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.primary_transfer_messages_owner + tab_data["set_action"] = PRIMARY_TRANSFER_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets transfered to the primary transfer location." + return tab_data + if(message_subtab == SECONARY_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.secondary_transfer_messages_prey + tab_data["set_action"] = SECONDARY_TRANSFER_PREY + tab_data["tooltip"] = "Displayed to your prey when they get transfered to the secondary transfer location." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.secondary_transfer_messages_owner + tab_data["set_action"] = SECONDARY_TRANSFER_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets transfered to the secondary transfer location." + return tab_data + if(message_subtab == PRIMARY_AUTO_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.primary_autotransfer_messages_prey + tab_data["set_action"] = PRIMARY_AUTO_TRANSFER_PREY + tab_data["tooltip"] = "Displayed to your prey when they get transfered to the primary auto transfer location." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.primary_autotransfer_messages_owner + tab_data["set_action"] = PRIMARY_AUTO_TRANSFER_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets transfered to the primary auto transfer location." + return tab_data + if(message_subtab == SECONARY_AUTO_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.secondary_autotransfer_messages_prey + tab_data["set_action"] = SECONDARY_AUTO_TRANSFER_PREY + tab_data["tooltip"] = "Displayed to your prey when they get transfered to the secondary auto transfer location." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.secondary_autotransfer_messages_owner + tab_data["set_action"] = SECONDARY_AUTO_TRANSFER_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets transfered to the secondary auto transfer location." + return tab_data + + if(message_option == VPANEL_INTERACTION_TAB) + var/list/tab_data = list( + "subtypes" = list() + ) + if(selected.message_mode || selected.digestchance) + tab_data["subtypes"] += DIGEST_MESSAGE + if(selected.message_mode || selected.absorbchance) + tab_data["subtypes"] += ABSORB_MESSAGE + if(!message_subtab) + message_subtab = DIGEST_MESSAGE + if(message_subtab == DIGEST_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.digest_chance_messages_prey + tab_data["set_action"] = DIGEST_CHANCE_PREY + tab_data["tooltip"] = "Displayed to your prey when their struggles trigger digest mode." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.digest_chance_messages_owner + tab_data["set_action"] = DIGEST_CHANCE_OWNER + tab_data["tooltip"] = "Displayed to you when your prey's struggles trigger digest mode." + return tab_data + if(message_subtab == ABSORB_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorb_chance_messages_prey + tab_data["set_action"] = ABSORB_CHANCE_PREY + tab_data["tooltip"] = "Displayed to your prey when their struggles trigger absorb mode." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorb_chance_messages_owner + tab_data["set_action"] = ABSORB_CHANCE_OWNER + tab_data["tooltip"] = "Displayed to you when your prey's struggles trigger absorb mode." + return tab_data + + if(message_option == VPANEL_BELLYMODE_TAB) + var/list/tab_data = list( + "subtypes" = list() + ) + if(selected.message_mode || selected.digest_mode == DM_DIGEST || DM_SELECT) + tab_data["subtypes"] += DIGEST_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_ABSORB || DM_SELECT) + tab_data["subtypes"] += ABSORB_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_UNABSORB) + tab_data["subtypes"] += UNABSORB_MESSAGE + if(!message_subtab) + message_subtab = DIGEST_MESSAGE + if(message_subtab == DIGEST_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.digest_messages_prey + tab_data["set_action"] = DIGEST_PREY + tab_data["tooltip"] = "Displayed to your prey when they get digested." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.digest_messages_owner + tab_data["set_action"] = DIGEST_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets digested." + return tab_data + if(message_subtab == ABSORBED_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorb_messages_prey + tab_data["set_action"] = ABSORB_PREY + tab_data["tooltip"] = "Displayed to your prey when they get absorbed." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.absorb_messages_owner + tab_data["set_action"] = ABSORB_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets absorbed." + if(message_subtab == UNABSORB_MESSAGE) + tab_data["possible_messages"] = list(TO_PREY, TO_YOU) + if(!selected_message) + selected_message = TO_PREY + if(selected_message == TO_PREY) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.unabsorb_messages_prey + tab_data["set_action"] = UNABSORBS_PREY + tab_data["tooltip"] = "Displayed to your prey when they get unabsorbed." + return tab_data + if(selected_message == TO_YOU) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = selected.unabsorb_messages_owner + tab_data["set_action"] = UNABSORBS_OWNER + tab_data["tooltip"] = "Displayed to you when your prey gets unabsorbed." + return tab_data + + if(message_option == VPANEL_IDLE_TAB) + var/list/tab_data = list( + "possible_messages" = list() + ) + if(selected.message_mode || selected.digest_mode == DM_DIGEST || selected.digest_mode == DM_SELECT) + tab_data["possible_messages"] += DIGEST_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_HOLD || selected.digest_mode == DM_SELECT) + tab_data["possible_messages"] += HOLD_MESSAGE + tab_data["possible_messages"] += HOLDABSORBED_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_ABSORB || selected.digest_mode == DM_SELECT) + tab_data["possible_messages"] += ABSORB_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_HEAL) + tab_data["possible_messages"] += HEAL_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_DRAIN || selected.digest_mode == DM_SELECT) + tab_data["possible_messages"] += DRAIN_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_SIZE_STEAL) + tab_data["possible_messages"] += STEAL_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_EGG) + tab_data["possible_messages"] += EGG_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_SHRINK) + tab_data["possible_messages"] += SHRINK_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_GROW) + tab_data["possible_messages"] += GROW_MESSAGE + if(selected.message_mode || selected.digest_mode == DM_UNABSORB) + tab_data["possible_messages"] += UNABSORB_MESSAGE + if(!selected_message) + selected_message = DIGEST_MESSAGE + if(selected_message == DIGEST_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_DIGEST]) + tab_data["set_action"] = BELLY_MODE_DIGEST + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting digested." + return tab_data + if(selected_message == HOLD_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_HOLD]) + tab_data["set_action"] = BELLY_MODE_HOLD + tab_data["tooltip"] = "Cyclic idle messages while your prey is being held." + return tab_data + if(selected_message == HOLDABSORBED_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_HOLD_ABSORBED]) + tab_data["set_action"] = BELLY_MODE_HOLD_ABSORB + tab_data["tooltip"] = "Cyclic idle messages while your absorbed prey is being held." + return tab_data + if(selected_message == ABSORB_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_ABSORB]) + tab_data["set_action"] = BELLY_MODE_ABSORB + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting absorbed." + return tab_data + if(selected_message == HEAL_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_HEAL]) + tab_data["set_action"] = BELLY_MODE_HEAL + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting healed." + return tab_data + if(selected_message == DRAIN_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_DRAIN]) + tab_data["set_action"] = BELLY_MODE_DRAIN + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting drained." + return tab_data + if(selected_message == STEAL_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_SIZE_STEAL]) + tab_data["set_action"] = BELLY_MODE_STEAL + tab_data["tooltip"] = "Cyclic idle messages while your prey's size is stolen." + return tab_data + if(selected_message == EGG_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_EGG]) + tab_data["set_action"] = BELLY_MODE_EGG + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting getting encased in an egg." + return tab_data + if(selected_message == SHRINK_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_SHRINK]) + tab_data["set_action"] = BELLY_MODE_SHRINK + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting shrunk." + return tab_data + if(selected_message == GROW_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_GROW]) + tab_data["set_action"] = BELLY_MODE_GROW + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting grown." + return tab_data + if(selected_message == UNABSORB_MESSAGE) + tab_data["max_length"] = BELLIES_IDLE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.emote_lists[DM_UNABSORB]) + tab_data["set_action"] = BELLY_MODE_UNABSORB + tab_data["tooltip"] = "Cyclic idle messages while your prey is getting unabsorbed." + return tab_data + + if(message_option == VPANEL_LIQUIDS_TAB) + var/list/tab_data = list( + "possible_messages" = list(LIQUID0, LIQUID20, LIQUID40, LIQUID60, LIQUID80) + ) + if(!selected_message) + selected_message = LIQUID0 + if(selected_message == LIQUID0) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.fullness1_messages) + tab_data["set_action"] = BELLY_LIQUID_MESSAGE1 + tab_data["tooltip"] = "Displayed on examine when the belly contains 0 to 20% of liquids." + tab_data["button_label"] = "Display Fullness 0-20%" + tab_data["button_action"] = "b_liq_msg_toggle1" + tab_data["button_data"] = selected.liquid_fullness1_messages + tab_data["button_tooltip"] = "the 0-20% examine description." // those will automatically be preceeded by Enables / Disables! + return tab_data + if(selected_message == LIQUID20) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.fullness2_messages) + tab_data["set_action"] = BELLY_LIQUID_MESSAGE2 + tab_data["tooltip"] = "Displayed on examine when the belly contains 20 to 40% of liquids." + tab_data["button_label"] = "Display Fullness 20-40%" + tab_data["button_action"] = "b_liq_msg_toggle2" + tab_data["button_data"] = selected.liquid_fullness2_messages + tab_data["button_tooltip"] = "the 20-40% examine description." // those will automatically be preceeded by Enables / Disables! + return tab_data + if(selected_message == LIQUID40) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.fullness3_messages) + tab_data["set_action"] = BELLY_LIQUID_MESSAGE3 + tab_data["tooltip"] = "Displayed on examine when the belly contains 40 to 60% of liquids." + tab_data["button_label"] = "Display Fullness 40-60%" + tab_data["button_action"] = "b_liq_msg_toggle3" + tab_data["button_data"] = selected.liquid_fullness3_messages + tab_data["button_tooltip"] = "the 40-60% examine description." // those will automatically be preceeded by Enables / Disables! + return tab_data + if(selected_message == LIQUID60) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.fullness4_messages) + tab_data["set_action"] = BELLY_LIQUID_MESSAGE4 + tab_data["tooltip"] = "Displayed on examine when the belly contains 60 to 80% of liquids." + tab_data["button_label"] = "Display Fullness 60-80%" + tab_data["button_action"] = "b_liq_msg_toggle4" + tab_data["button_data"] = selected.liquid_fullness4_messages + tab_data["button_tooltip"] = "the 60-80% examine description." // those will automatically be preceeded by Enables / Disables! + return tab_data + if(selected_message == LIQUID80) + tab_data["max_length"] = BELLIES_MESSAGE_MAX + tab_data["active_message"] = SANITIZE_LIST(selected.fullness5_messages) + tab_data["set_action"] = BELLY_LIQUID_MESSAGE5 + tab_data["tooltip"] = "Displayed on examine when the belly contains 80 to 100% of liquids." + tab_data["button_label"] = "Display Fullness 80-100%" + tab_data["button_action"] = "b_liq_msg_toggle5" + tab_data["button_data"] = selected.liquid_fullness5_messages + tab_data["button_tooltip"] = "the 80-100% examine description." // those will automatically be preceeded by Enables / Disables! + return tab_data + + +/datum/vore_look/proc/compile_interact_data(obj/belly/selected) + var/list/interact_data = list() + if(selected.escapable) + interact_data += list( + "escapechance" = selected.escapechance, + "escapechance_absorbed" = selected.escapechance_absorbed, + "escapetime" = selected.escapetime, + "transferchance" = selected.transferchance, + "transferlocation" = selected.transferlocation, + "transferchance_secondary" = selected.transferchance_secondary, + "transferlocation_secondary" = selected.transferlocation_secondary, + "absorbchance" = selected.absorbchance, + "digestchance" = selected.digestchance, + "belchchance" = selected.belchchance + ) + + return interact_data + +/datum/vore_look/proc/compile_autotransfer_data(obj/belly/selected) + var/list/autotransfer_data = list() + if(selected.autotransfer_enabled) + //auto-transfer flags + var/list/at_whitelist = list() + var/list/at_secondary_whitelist = list() + var/list/at_blacklist = list() + var/list/at_secondary_blacklist = list() + for(var/flag_name in selected.autotransfer_flags_list) + UNTYPED_LIST_ADD(at_whitelist, list("label" = flag_name, "selection" = selected.autotransfer_whitelist & selected.autotransfer_flags_list[flag_name])) + UNTYPED_LIST_ADD(at_blacklist, list("label" = flag_name, "selection" = selected.autotransfer_blacklist & selected.autotransfer_flags_list[flag_name])) + UNTYPED_LIST_ADD(at_secondary_whitelist, list("label" = flag_name, "selection" = selected.autotransfer_secondary_whitelist & selected.autotransfer_flags_list[flag_name])) + UNTYPED_LIST_ADD(at_secondary_blacklist, list("label" = flag_name, "selection" = selected.autotransfer_secondary_blacklist & selected.autotransfer_flags_list[flag_name])) + var/list/at_whitelist_items = list() + var/list/at_blacklist_items = list() + var/list/at_secondary_whitelist_items = list() + var/list/at_secondary_blacklist_items = list() + for(var/flag_name in selected.autotransfer_flags_list_items) + UNTYPED_LIST_ADD(at_whitelist_items, list("label" = flag_name, "selection" = selected.autotransfer_whitelist_items & selected.autotransfer_flags_list_items[flag_name])) + UNTYPED_LIST_ADD(at_blacklist_items, list("label" = flag_name, "selection" = selected.autotransfer_blacklist_items & selected.autotransfer_flags_list_items[flag_name])) + UNTYPED_LIST_ADD(at_secondary_whitelist_items, list("label" = flag_name, "selection" = selected.autotransfer_secondary_whitelist_items & selected.autotransfer_flags_list_items[flag_name])) + UNTYPED_LIST_ADD(at_secondary_blacklist_items, list("label" = flag_name, "selection" = selected.autotransfer_secondary_blacklist_items & selected.autotransfer_flags_list_items[flag_name])) + + var/list/primary_transfer = list( + "autotransferchance" = selected.autotransferchance, + "autotransferlocation" = selected.autotransferlocation, + "autotransferextralocation" = selected.autotransferextralocation, + "autotransfer_whitelist" = at_whitelist, + "autotransfer_blacklist" = at_blacklist, + "autotransfer_whitelist_items" = at_whitelist_items, + "autotransfer_blacklist_items" = at_blacklist_items + ) + var/list/secondary_transfer = list( + "autotransferchance" = selected.autotransferchance_secondary, + "autotransferlocation" = selected.autotransferlocation_secondary, + "autotransferextralocation" = selected.autotransferextralocation_secondary, + "autotransfer_whitelist" = at_secondary_whitelist, + "autotransfer_blacklist" = at_secondary_blacklist, + "autotransfer_whitelist_items" = at_secondary_whitelist_items, + "autotransfer_blacklist_items" = at_secondary_blacklist_items + ) + + autotransfer_data += list( + "autotransferwait" = selected.autotransferwait, + "autotransfer_min_amount" = selected.autotransfer_min_amount, + "autotransfer_max_amount" = selected.autotransfer_max_amount, + "primary_transfer" = primary_transfer, + "secondary_transfer" = secondary_transfer + ) + return autotransfer_data + +/datum/vore_look/proc/compile_liquid_interact_data(obj/belly/selected) + var/list/liq_interacts = list() + if(selected.show_liquids) + var/list/liquid_addon_list = list() + for(var/flag_name in selected.reagent_mode_flag_list) + UNTYPED_LIST_ADD(liquid_addon_list, list("label" = flag_name, "selection" = selected.reagent_mode_flags & selected.reagent_mode_flag_list[flag_name])) + + liq_interacts += list( + "liq_reagent_gen" = selected.reagentbellymode, + "liq_reagent_type" = selected.reagent_chosen, + "liq_reagent_types" = selected.reagent_choices, + "liq_reagent_name" = selected.reagent_name, + "liq_custom_name_max" = BELLIES_NAME_MAX, + "liq_custom_name_min" = BELLIES_NAME_MIN, + "liq_reagent_transfer_verb" = selected.reagent_transfer_verb, + "liq_reagent_nutri_rate" = selected.gen_time, + "liq_reagent_capacity" = selected.custom_max_volume, + "liq_sloshing" = selected.vorefootsteps_sounds, + "liq_reagent_addons" = liquid_addon_list, + "custom_reagentcolor" = (selected.custom_reagentcolor ? selected.custom_reagentcolor : selected.reagentcolor), + "custom_reagentalpha" = selected.custom_reagentalpha, + "liquid_overlay" = selected.liquid_overlay, + "max_liquid_level" = selected.max_liquid_level, + "reagent_touches" = selected.reagent_touches, + "mush_overlay" = selected.mush_overlay, + "mush_color" = selected.mush_color, + "mush_alpha" = selected.mush_alpha, + "max_mush" = selected.max_mush, + "min_mush" = selected.min_mush, + "item_mush_val" = selected.item_mush_val, + "metabolism_overlay" = selected.metabolism_overlay, + "metabolism_mush_ratio" = selected.metabolism_mush_ratio, + "max_ingested" = selected.max_ingested, + "custom_ingested_color" = (selected.custom_ingested_color ? selected.custom_ingested_color : "#3f6088"), + "custom_ingested_alpha" = selected.custom_ingested_alpha + ) + return liq_interacts + +#undef DEFAULT_MESSAGE +#undef ABSORBED_MESSAGE +#undef WITH_PREY +#undef WITH_ABSORBED_PREY +#undef TRASH_EAT +#undef TRASH_EXPEL +#undef OUTSIDE_MESSAGE +#undef INSIDE_MESSAGE +#undef TO_YOU +#undef TO_PREY +#undef ATTEMPT_MESSAGE +#undef SUCCESS_MESSAGE +#undef ITEM_MESSAGE +#undef FAIL_MESSAGE +#undef PRIMARY_MESSAGE +#undef SECONARY_MESSAGE +#undef PRIMARY_AUTO_MESSAGE +#undef SECONARY_AUTO_MESSAGE +#undef DIGEST_MESSAGE +#undef HOLD_MESSAGE +#undef HOLDABSORBED_MESSAGE +#undef ABSORB_MESSAGE +#undef HEAL_MESSAGE +#undef DRAIN_MESSAGE +#undef STEAL_MESSAGE +#undef EGG_MESSAGE +#undef SHRINK_MESSAGE +#undef GROW_MESSAGE +#undef UNABSORB_MESSAGE +#undef LIQUID0 +#undef LIQUID20 +#undef LIQUID40 +#undef LIQUID60 +#undef LIQUID80 diff --git a/code/modules/vore/eating/soulcatcher.dm b/code/modules/vore/eating/soulcatcher.dm index f81c9a29ff..72ea61c334 100644 --- a/code/modules/vore/eating/soulcatcher.dm +++ b/code/modules/vore/eating/soulcatcher.dm @@ -198,7 +198,7 @@ // Allows to adjust the interior of the soulcatcher /obj/soulgem/proc/adjust_interior(var/new_flavor) - new_flavor = sanitize(new_flavor, MAX_MESSAGE_LEN * 2) + new_flavor = sanitize(new_flavor, VORE_SC_DESC_MAX, FALSE, TRUE, FALSE) inside_flavor = new_flavor notify_holder("Updating environment...") for(var/mob/living/carbon/brain/caught_soul/vore/CS as anything in brainmobs) @@ -225,26 +225,27 @@ // Sets the custom messages depending on the input /obj/soulgem/proc/set_custom_message(var/message, var/target) - message = sanitize(message, MAX_MESSAGE_LEN / 4) + message = sanitize(message, VORE_SC_MAX, FALSE, TRUE, FALSE) switch(target) - if("capture") + if(SC_CAPTURE_MEESAGE) capture_message = message - if("transit") + if(SC_TRANSIT_MESSAGE) transit_message = message - if("release") + if(SC_RELEASE_MESSAGE) release_message = message - if("transfer") + if(SC_TRANSFERE_MESSAGE) transfer_message = message - if("delete") + if(SC_DELETE_MESSAGE) delete_message = message // Allows to rename the soulgem /obj/soulgem/proc/rename(var/new_name) if(length(new_name) < 3 || length(new_name) > 60) to_chat(owner, span_warning("Your soulcatcher's name needs to be between 3 and 60 characters long!")) - return - new_name = sanitize(new_name, 60) + return FALSE + new_name = sanitize(new_name, 60, FALSE, TRUE, FALSE) name = new_name + return TRUE // Toggles the given flag /obj/soulgem/proc/toggle_setting(var/flag) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 9b427ad1cc..38b884ee70 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -2,8 +2,11 @@ // Vore management panel for players // -#define VORE_RESIZE_COST 125 #define STATION_PREF_NAME "Virgo" +#define VORE_BELLY_TAB 0 +#define SOULCATCHER_TAB 1 +#define GENERAL_TAB 2 +#define PREFERENCE_TAB 3 /mob var/datum/vore_look/vorePanel @@ -38,6 +41,13 @@ var/show_pictures = TRUE var/icon_overflow = FALSE var/max_icon_content = 21 //Contents above this disable icon mode. 21 for nice 3 rows to fill the default panel window. + var/active_tab = 0 // our current tab + var/active_vore_tab = 0 // our vore sub tab + var/message_option = 0 // our examine subtab + var/message_subtab // our examine subtab + var/sc_message_subtab // our soulcatcher message subtab + var/aset_message_subtab + var/selected_message /datum/vore_look/New(mob/new_host) if(istype(new_host)) @@ -114,467 +124,53 @@ if(!host) return data + // General Data data["unsaved_changes"] = unsaved_changes - data["show_pictures"] = show_pictures - data["icon_overflow"] = icon_overflow + data["active_tab"] = active_tab - var/atom/hostloc = host.loc - //Allow VorePanel to show pred belly details even while indirectly inside - if(istype(host, /mob/living)) - var/mob/living/H = host - hostloc = H.surrounding_belly() - //End of indirect vorefx additions - var/list/inside = list() - if(isbelly(hostloc)) - var/obj/belly/inside_belly = hostloc - var/mob/living/pred = inside_belly.owner + // Inisde Data + data["inside"] = get_inside_data(host) - var/inside_desc = "No description." - if(host.absorbed && inside_belly.absorbed_desc) - inside_desc = inside_belly.absorbed_desc - else if(inside_belly.desc) - inside_desc = inside_belly.desc - - if(inside_desc != "No description.") - inside_desc = inside_belly.belly_format_string(inside_desc, host, use_first_only = TRUE) - - inside = list( - "absorbed" = host.absorbed, - "belly_name" = inside_belly.name, - "belly_mode" = inside_belly.digest_mode, - "desc" = inside_desc, - "pred" = pred, - "ref" = "\ref[inside_belly]", - "liq_lvl" = inside_belly.reagents.total_volume, - "liq_reagent_type" = inside_belly.reagent_chosen, - "liuq_name" = inside_belly.reagent_name, - ) - - var/list/inside_contents = list() - for(var/atom/movable/O in inside_belly) - if(O == host) - continue - - var/list/info = list( - "name" = "[O]", - "absorbed" = FALSE, - "stat" = 0, - "ref" = "\ref[O]", - "outside" = FALSE, - ) - if(show_pictures) //disables icon mode - if(inside_belly.contents.len <= max_icon_content) - icon_overflow = FALSE - info["icon"] = cached_nom_icon(O) - else - icon_overflow = TRUE - if(isliving(O)) - var/mob/living/M = O - info["stat"] = M.stat - if(M.absorbed) - info["absorbed"] = TRUE - inside_contents.Add(list(info)) - inside["contents"] = inside_contents - data["inside"] = inside - - var/is_cyborg = FALSE - var/is_vore_simple_mob = FALSE - if(isrobot(host)) - is_cyborg = TRUE - else if(istype(host, /mob/living/simple_mob/vore)) //So far, this does nothing. But, creating this for future belly work - is_vore_simple_mob = TRUE - data["host_mobtype"] = list( - "is_cyborg" = is_cyborg, - "is_vore_simple_mob" = is_vore_simple_mob - ) - - var/list/our_bellies = list() - for(var/obj/belly/B as anything in host.vore_organs) - our_bellies.Add(list(list( - "selected" = (B == host.vore_selected), - "name" = B.name, - "ref" = "\ref[B]", - "digest_mode" = B.digest_mode, - "contents" = LAZYLEN(B.contents), - "prevent_saving" = B.prevent_saving, - ))) - data["our_bellies"] = our_bellies - - var/list/selected_list = null - if(host.vore_selected) - var/obj/belly/selected = host.vore_selected - selected_list = list( - "belly_name" = selected.name, - "message_mode" = selected.message_mode, - "is_wet" = selected.is_wet, - "wet_loop" = selected.wet_loop, - "mode" = selected.digest_mode, - "item_mode" = selected.item_digest_mode, - "verb" = selected.vore_verb, - "release_verb" = selected.release_verb, - "desc" = selected.desc, - "absorbed_desc" = selected.absorbed_desc, - "fancy" = selected.fancy_vore, - "sound" = selected.vore_sound, - "release_sound" = selected.release_sound, - // "messages" // TODO - "can_taste" = selected.can_taste, - "is_feedable" = selected.is_feedable, - "egg_type" = selected.egg_type, - "egg_name" = selected.egg_name, - "egg_size" = selected.egg_size, - "recycling" = selected.recycling, - "storing_nutrition" = selected.storing_nutrition, - "entrance_logs" = selected.entrance_logs, - "nutrition_percent" = selected.nutrition_percent, - "digest_brute" = selected.digest_brute, - "digest_burn" = selected.digest_burn, - "digest_oxy" = selected.digest_oxy, - "digest_tox" = selected.digest_tox, - "digest_clone" = selected.digest_clone, - "bulge_size" = selected.bulge_size, - "save_digest_mode" = selected.save_digest_mode, - "display_absorbed_examine" = selected.display_absorbed_examine, - "shrink_grow_size" = selected.shrink_grow_size, - "emote_time" = selected.emote_time, - "emote_active" = selected.emote_active, - "selective_preference" = selected.selective_preference, - "nutrition_ex" = host.nutrition_message_visible, - "weight_ex" = host.weight_message_visible, - "belly_fullscreen" = selected.belly_fullscreen, - "eating_privacy_local" = selected.eating_privacy_local, - "silicon_belly_overlay_preference" = selected.silicon_belly_overlay_preference, - "belly_mob_mult" = selected.belly_mob_mult, - "belly_item_mult" = selected.belly_item_mult, - "belly_overall_mult" = selected.belly_overall_mult, - "drainmode" = selected.drainmode, - "affects_voresprite" = selected.affects_vore_sprites, - "absorbed_voresprite" = selected.count_absorbed_prey_for_sprite, - "absorbed_multiplier" = selected.absorbed_multiplier, - "liquid_voresprite" = selected.count_liquid_for_sprite, - "liquid_multiplier" = selected.liquid_multiplier, - "item_voresprite" = selected.count_items_for_sprite, - "item_multiplier" = selected.item_multiplier, - "health_voresprite" = selected.health_impacts_size, - "resist_animation" = selected.resist_triggers_animation, - "voresprite_size_factor" = selected.size_factor_for_sprite, - "belly_sprite_to_affect" = selected.belly_sprite_to_affect, - "belly_sprite_option_shown" = LAZYLEN(host.vore_icon_bellies) >= 1 ? TRUE : FALSE, - "tail_option_shown" = ishuman(host), - "tail_to_change_to" = selected.tail_to_change_to, - "tail_colouration" = selected.tail_colouration, - "tail_extra_overlay" = selected.tail_extra_overlay, - "tail_extra_overlay2" = selected.tail_extra_overlay2, - "undergarment_chosen" = selected.undergarment_chosen, - "undergarment_if_none" = selected.undergarment_if_none || "None", - "undergarment_color" = selected.undergarment_color, - "belly_fullscreen_color" = selected.belly_fullscreen_color, - "belly_fullscreen_color2" = selected.belly_fullscreen_color2, - "belly_fullscreen_color3" = selected.belly_fullscreen_color3, - "belly_fullscreen_color4" = selected.belly_fullscreen_color4, - "belly_fullscreen_alpha" = selected.belly_fullscreen_alpha, - "colorization_enabled" = selected.colorization_enabled, - "custom_reagentcolor" = selected.custom_reagentcolor, - "custom_reagentalpha" = selected.custom_reagentalpha, - "liquid_overlay" = selected.liquid_overlay, - "max_liquid_level" = selected.max_liquid_level, - "reagent_touches" = selected.reagent_touches, - "mush_overlay" = selected.mush_overlay, - "mush_color" = selected.mush_color, - "mush_alpha" = selected.mush_alpha, - "max_mush" = selected.max_mush, - "min_mush" = selected.min_mush, - "item_mush_val" = selected.item_mush_val, - "metabolism_overlay" = selected.metabolism_overlay, - "metabolism_mush_ratio" = selected.metabolism_mush_ratio, - "max_ingested" = selected.max_ingested, - "custom_ingested_color" = selected.custom_ingested_color, - "custom_ingested_alpha" = selected.custom_ingested_alpha, - "vorespawn_blacklist" = selected.vorespawn_blacklist, - "vorespawn_whitelist" = selected.vorespawn_whitelist, - "vorespawn_absorbed" = (global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_YES) + global_flag_check(selected.vorespawn_absorbed, VS_FLAG_ABSORB_PREY)), - "sound_volume" = selected.sound_volume, - "noise_freq" = selected.noise_freq, - "item_digest_logs" = selected.item_digest_logs, - "private_struggle" = selected.private_struggle, - //"marking_to_add" = selected.marking_to_add - ) - - var/list/addons = list() - for(var/flag_name in selected.mode_flag_list) - if(selected.mode_flags & selected.mode_flag_list[flag_name]) - addons.Add(flag_name) - selected_list["addons"] = addons - - var/list/vs_flags = list() - for(var/flag_name in selected.vore_sprite_flag_list) - if(selected.vore_sprite_flags & selected.vore_sprite_flag_list[flag_name]) - vs_flags.Add(flag_name) - selected_list["vore_sprite_flags"] = vs_flags - - - selected_list["egg_type"] = selected.egg_type - selected_list["egg_name"] = selected.egg_name - selected_list["egg_size"] = selected.egg_size - selected_list["recycling"] = selected.recycling - selected_list["storing_nutrition"] = selected.storing_nutrition - selected_list["item_digest_logs"] = selected.item_digest_logs - selected_list["contaminates"] = selected.contaminates - selected_list["contaminate_flavor"] = null - selected_list["contaminate_color"] = null - if(selected.contaminates) - selected_list["contaminate_flavor"] = selected.contamination_flavor - selected_list["contaminate_color"] = selected.contamination_color - - selected_list["escapable"] = selected.escapable - selected_list["interacts"] = list() - if(selected.escapable) - selected_list["interacts"]["escapechance"] = selected.escapechance - selected_list["interacts"]["escapechance_absorbed"] = selected.escapechance_absorbed - selected_list["interacts"]["escapetime"] = selected.escapetime - selected_list["interacts"]["transferchance"] = selected.transferchance - selected_list["interacts"]["transferlocation"] = selected.transferlocation - selected_list["interacts"]["transferchance_secondary"] = selected.transferchance_secondary - selected_list["interacts"]["transferlocation_secondary"] = selected.transferlocation_secondary - selected_list["interacts"]["absorbchance"] = selected.absorbchance - selected_list["interacts"]["digestchance"] = selected.digestchance - selected_list["interacts"]["belchchance"] = selected.belchchance - - selected_list["autotransfer_enabled"] = selected.autotransfer_enabled - selected_list["autotransfer"] = list() - if(selected.autotransfer_enabled) - selected_list["autotransfer"]["autotransferchance"] = selected.autotransferchance - selected_list["autotransfer"]["autotransferwait"] = selected.autotransferwait - selected_list["autotransfer"]["autotransferlocation"] = selected.autotransferlocation - selected_list["autotransfer"]["autotransferextralocation"] = selected.autotransferextralocation - selected_list["autotransfer"]["autotransferchance_secondary"] = selected.autotransferchance_secondary - selected_list["autotransfer"]["autotransferlocation_secondary"] = selected.autotransferlocation_secondary - selected_list["autotransfer"]["autotransferextralocation_secondary"] = selected.autotransferextralocation_secondary - selected_list["autotransfer"]["autotransfer_min_amount"] = selected.autotransfer_min_amount - selected_list["autotransfer"]["autotransfer_max_amount"] = selected.autotransfer_max_amount - //auto-transfer flags - var/list/at_whitelist = list() - for(var/flag_name in selected.autotransfer_flags_list) - if(selected.autotransfer_whitelist & selected.autotransfer_flags_list[flag_name]) - at_whitelist.Add(flag_name) - selected_list["autotransfer"]["autotransfer_whitelist"] = at_whitelist - var/list/at_blacklist = list() - for(var/flag_name in selected.autotransfer_flags_list) - if(selected.autotransfer_blacklist & selected.autotransfer_flags_list[flag_name]) - at_blacklist.Add(flag_name) - selected_list["autotransfer"]["autotransfer_blacklist"] = at_blacklist - var/list/at_whitelist_items = list() - for(var/flag_name in selected.autotransfer_flags_list_items) - if(selected.autotransfer_whitelist_items & selected.autotransfer_flags_list_items[flag_name]) - at_whitelist_items.Add(flag_name) - selected_list["autotransfer"]["autotransfer_whitelist_items"] = at_whitelist_items - var/list/at_blacklist_items = list() - for(var/flag_name in selected.autotransfer_flags_list_items) - if(selected.autotransfer_blacklist_items & selected.autotransfer_flags_list_items[flag_name]) - at_blacklist_items.Add(flag_name) - selected_list["autotransfer"]["autotransfer_blacklist_items"] = at_blacklist_items - var/list/at_secondary_whitelist = list() - for(var/flag_name in selected.autotransfer_flags_list) - if(selected.autotransfer_secondary_whitelist & selected.autotransfer_flags_list[flag_name]) - at_secondary_whitelist.Add(flag_name) - selected_list["autotransfer"]["autotransfer_secondary_whitelist"] = at_secondary_whitelist - var/list/at_secondary_blacklist = list() - for(var/flag_name in selected.autotransfer_flags_list) - if(selected.autotransfer_secondary_blacklist & selected.autotransfer_flags_list[flag_name]) - at_secondary_blacklist.Add(flag_name) - selected_list["autotransfer"]["autotransfer_secondary_blacklist"] = at_secondary_blacklist - var/list/at_secondary_whitelist_items = list() - for(var/flag_name in selected.autotransfer_flags_list_items) - if(selected.autotransfer_secondary_whitelist_items & selected.autotransfer_flags_list_items[flag_name]) - at_secondary_whitelist_items.Add(flag_name) - selected_list["autotransfer"]["autotransfer_secondary_whitelist_items"] = at_secondary_whitelist_items - var/list/at_secondary_blacklist_items = list() - for(var/flag_name in selected.autotransfer_flags_list_items) - if(selected.autotransfer_secondary_blacklist_items & selected.autotransfer_flags_list_items[flag_name]) - at_secondary_blacklist_items.Add(flag_name) - selected_list["autotransfer"]["autotransfer_secondary_blacklist_items"] = at_secondary_blacklist_items - - selected_list["disable_hud"] = selected.disable_hud - selected_list["colorization_enabled"] = selected.colorization_enabled - selected_list["belly_fullscreen_color"] = selected.belly_fullscreen_color - selected_list["belly_fullscreen_color2"] = selected.belly_fullscreen_color2 - selected_list["belly_fullscreen_color3"] = selected.belly_fullscreen_color3 - selected_list["belly_fullscreen_color4"] = selected.belly_fullscreen_color4 - selected_list["belly_fullscreen_alpha"] = selected.belly_fullscreen_alpha - - if(selected.colorization_enabled) - selected_list["possible_fullscreens"] = icon_states('icons/mob/screen_full_vore_list.dmi') //Makes any icons inside of here selectable. - else - selected_list["possible_fullscreens"] = icon_states('icons/mob/screen_full_vore.dmi') //Non colorable - - var/list/selected_contents = list() - for(var/O in selected) - var/list/info = list( - "name" = "[O]", - "absorbed" = FALSE, - "stat" = 0, - "ref" = "\ref[O]", - "outside" = TRUE, - ) - if(show_pictures) //disables icon mode - if(selected.contents.len <= max_icon_content) - icon_overflow = FALSE - info["icon"] = cached_nom_icon(O) - else - icon_overflow = TRUE - - if(isliving(O)) - var/mob/living/M = O - info["stat"] = M.stat - if(M.absorbed) - info["absorbed"] = TRUE - selected_contents.Add(list(info)) - selected_list["contents"] = selected_contents - - // liquid belly options - selected_list["show_liq"] = selected.show_liquids - selected_list["liq_interacts"] = list() - if(selected.show_liquids) - selected_list["liq_interacts"]["liq_reagent_gen"] = selected.reagentbellymode - selected_list["liq_interacts"]["liq_reagent_type"] = selected.reagent_chosen - selected_list["liq_interacts"]["liq_reagent_name"] = selected.reagent_name - selected_list["liq_interacts"]["liq_reagent_transfer_verb"] = selected.reagent_transfer_verb - selected_list["liq_interacts"]["liq_reagent_nutri_rate"] = selected.gen_time - selected_list["liq_interacts"]["liq_reagent_capacity"] = selected.custom_max_volume - selected_list["liq_interacts"]["liq_sloshing"] = selected.vorefootsteps_sounds - selected_list["liq_interacts"]["liq_reagent_addons"] = list() - for(var/flag_name in selected.reagent_mode_flag_list) - if(selected.reagent_mode_flags & selected.reagent_mode_flag_list[flag_name]) - var/list/selected_list_member = selected_list["liq_interacts"]["liq_reagent_addons"] - ASSERT(islist(selected_list_member)) - selected_list_member.Add(flag_name) - selected_list["liq_interacts"]["custom_reagentcolor"] = selected.custom_reagentcolor ? selected.custom_reagentcolor : selected.reagentcolor - selected_list["liq_interacts"]["custom_reagentalpha"] = selected.custom_reagentalpha ? selected.custom_reagentalpha : "Default" - selected_list["liq_interacts"]["liquid_overlay"] = selected.liquid_overlay - selected_list["liq_interacts"]["max_liquid_level"] = selected.max_liquid_level - selected_list["liq_interacts"]["reagent_touches"] = selected.reagent_touches - selected_list["liq_interacts"]["mush_overlay"] = selected.mush_overlay - selected_list["liq_interacts"]["mush_color"] = selected.mush_color - selected_list["liq_interacts"]["mush_alpha"] = selected.mush_alpha - selected_list["liq_interacts"]["max_mush"] = selected.max_mush - selected_list["liq_interacts"]["min_mush"] = selected.min_mush - selected_list["liq_interacts"]["item_mush_val"] = selected.item_mush_val - selected_list["liq_interacts"]["metabolism_overlay"] = selected.metabolism_overlay - selected_list["liq_interacts"]["metabolism_mush_ratio"] = selected.metabolism_mush_ratio - selected_list["liq_interacts"]["max_ingested"] = selected.max_ingested - selected_list["liq_interacts"]["custom_ingested_color"] = selected.custom_ingested_color ? selected.custom_ingested_color : "#3f6088" - selected_list["liq_interacts"]["custom_ingested_alpha"] = selected.custom_ingested_alpha - - selected_list["show_liq_fullness"] = selected.show_fullness_messages - selected_list["liq_messages"] = list() - if(selected.show_fullness_messages) - selected_list["liq_messages"]["liq_msg_toggle1"] = selected.liquid_fullness1_messages - selected_list["liq_messages"]["liq_msg_toggle2"] = selected.liquid_fullness2_messages - selected_list["liq_messages"]["liq_msg_toggle3"] = selected.liquid_fullness3_messages - selected_list["liq_messages"]["liq_msg_toggle4"] = selected.liquid_fullness4_messages - selected_list["liq_messages"]["liq_msg_toggle5"] = selected.liquid_fullness5_messages - - selected_list["liq_messages"]["liq_msg1"] = selected.liquid_fullness1_messages - selected_list["liq_messages"]["liq_msg2"] = selected.liquid_fullness2_messages - selected_list["liq_messages"]["liq_msg3"] = selected.liquid_fullness3_messages - selected_list["liq_messages"]["liq_msg4"] = selected.liquid_fullness4_messages - selected_list["liq_messages"]["liq_msg5"] = selected.liquid_fullness5_messages - - data["selected"] = selected_list - data["prefs"] = list( - "digestable" = host.digestable, - "devourable" = host.devourable, - "resizable" = host.resizable, - "feeding" = host.feeding, - "absorbable" = host.absorbable, - "digest_leave_remains" = host.digest_leave_remains, - "allowmobvore" = host.allowmobvore, - "permit_healbelly" = host.permit_healbelly, - "show_vore_fx" = host.show_vore_fx, - "can_be_drop_prey" = host.can_be_drop_prey, - "can_be_drop_pred" = host.can_be_drop_pred, - "latejoin_vore" = host.latejoin_vore, - "latejoin_prey" = host.latejoin_prey, - "no_spawnpred_warning" = host.no_latejoin_vore_warning, - "no_spawnprey_warning" = host.no_latejoin_prey_warning, - "no_spawnpred_warning_time" = host.no_latejoin_vore_warning_time, - "no_spawnprey_warning_time" = host.no_latejoin_prey_warning_time, - "no_spawnpred_warning_save" = host.no_latejoin_vore_warning_persists, - "no_spawnprey_warning_save" = host.no_latejoin_prey_warning_persists, - "allow_spontaneous_tf" = host.allow_spontaneous_tf, - "step_mechanics_active" = host.step_mechanics_pref, - "pickup_mechanics_active" = host.pickup_pref, - "strip_mechanics_active" = host.strip_pref, - "noisy" = host.noisy, - //liquid belly prefs - "liq_rec" = host.receive_reagents, - "liq_giv" = host.give_reagents, - "liq_apply" = host.apply_reagents, - "autotransferable" = host.autotransferable, - "noisy_full" = host.noisy_full, //Belching while full - "selective_active" = host.selective_preference, //Reveal active selective mode in prefs - - "allow_mind_transfer" = host.allow_mind_transfer, - "drop_vore" = host.drop_vore, - "slip_vore" = host.slip_vore, - "stumble_vore" = host.stumble_vore, - "throw_vore" = host.throw_vore, - "phase_vore" = host.phase_vore, - "food_vore" = host.food_vore, - "consume_liquid_belly" = host.consume_liquid_belly, - "digest_pain" = host.digest_pain, - "nutrition_message_visible" = host.nutrition_message_visible, - "nutrition_messages" = host.nutrition_messages, - "weight_message_visible" = host.weight_message_visible, - "weight_messages" = host.weight_messages, - "eating_privacy_global" = host.eating_privacy_global, - "allow_mimicry" = host.allow_mimicry, - // start, vore sprites - "belly_rub_target" = host.belly_rub_target, - "vore_sprite_color" = host.vore_sprite_color, - "vore_sprite_multiply" = host.vore_sprite_multiply, - //Soulcatcher - "soulcatcher_allow_capture" = host.soulcatcher_pref_flags & SOULCATCHER_ALLOW_CAPTURE, - "soulcatcher_allow_transfer" = host.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TRANSFER, - "soulcatcher_allow_takeover" = host.soulcatcher_pref_flags & SOULCATCHER_ALLOW_TAKEOVER, - "soulcatcher_allow_deletion" = (global_flag_check(host.soulcatcher_pref_flags, SOULCATCHER_ALLOW_DELETION) + global_flag_check(host.soulcatcher_pref_flags, SOULCATCHER_ALLOW_DELETION_INSTANT)) - ) - // Soulcatcher - var/list/stored_souls = list() + data["host_mobtype"] = null + data["show_pictures"] = null + data["icon_overflow"] = null + data["our_bellies"] = null + data["selected"] = null data["soulcatcher"] = null - if(host.soulgem) - data["soulcatcher"] = list() - for(var/soul in host.soulgem.brainmobs) - var/list/info = list("displayText" = "[soul]", "value" = "\ref[soul]") - stored_souls.Add(list(info)) - data["soulcatcher"]["active"] = host.soulgem.flag_check(SOULGEM_ACTIVE) - data["soulcatcher"]["name"] = host.soulgem.name - data["soulcatcher"]["caught_souls"] = stored_souls - data["soulcatcher"]["selected_soul"] = host.soulgem.selected_soul - data["soulcatcher"]["selected_sfx"] = host.soulgem.linked_belly - data["soulcatcher"]["interior_design"] = host.soulgem.inside_flavor - data["soulcatcher"]["taken_over"] = host.soulgem.is_taken_over() - data["soulcatcher"]["catch_self"] = host.soulgem.flag_check(NIF_SC_CATCHING_ME) - data["soulcatcher"]["catch_prey"] = host.soulgem.flag_check(NIF_SC_CATCHING_OTHERS) - data["soulcatcher"]["catch_drain"] = host.soulgem.flag_check(SOULGEM_CATCHING_DRAIN) - data["soulcatcher"]["catch_ghost"] = host.soulgem.flag_check(SOULGEM_CATCHING_GHOSTS) - data["soulcatcher"]["ext_hearing"] = host.soulgem.flag_check(NIF_SC_ALLOW_EARS) - data["soulcatcher"]["ext_vision"] = host.soulgem.flag_check(NIF_SC_ALLOW_EYES) - data["soulcatcher"]["mind_backups"] = host.soulgem.flag_check(NIF_SC_BACKUPS) - data["soulcatcher"]["sr_projecting"] = host.soulgem.flag_check(NIF_SC_PROJECTING) - data["soulcatcher"]["show_vore_sfx"] = host.soulgem.flag_check(SOULGEM_SHOW_VORE_SFX) - data["soulcatcher"]["see_sr_projecting"] = host.soulgem.flag_check(SOULGEM_SEE_SR_SOULS) - var/nutri_value = 0 - if(istype(host, /mob/living)) - var/mob/living/H = host - nutri_value = H.nutrition - data["abilities"] = list ( - "nutrition" = nutri_value, - "current_size" = host.size_multiplier, - "minimum_size" = host.has_large_resize_bounds() ? RESIZE_MINIMUM_DORMS : RESIZE_MINIMUM, - "maximum_size" = host.has_large_resize_bounds() ? RESIZE_MAXIMUM_DORMS : RESIZE_MAXIMUM, - "resize_cost" = VORE_RESIZE_COST - ) + data["abilities"] = null + data["prefs"] = null + data["general_pref_data"] = null + + if(active_tab == VORE_BELLY_TAB) + data["active_vore_tab"] = active_vore_tab + data["host_mobtype"] = get_host_mobtype(host) + + // Content Data + data["show_pictures"] = show_pictures + data["icon_overflow"] = icon_overflow + + // List of all our bellies + data["our_bellies"] = get_vorebellies(host) + + // Selected belly data. TODO, split this into sub data per tab, we don't need all of this at once, ever! + data["selected"] = get_selected_data(host) + + if(active_tab == SOULCATCHER_TAB) + // Soulcatcher and abilities + data["our_bellies"] = get_vorebellies(host, FALSE) + data["soulcatcher"] = get_soulcatcher_data(host) + data["abilities"] = get_ability_data(host) + + if(active_tab == PREFERENCE_TAB) + // Preference data, we only ever need that when we go to the pref page! + data["prefs"] = get_preference_data(host) + // Content Data + data["show_pictures"] = show_pictures + data["icon_overflow"] = icon_overflow + + if(active_tab == GENERAL_TAB) + data["general_pref_data"] = get_general_data(host) + data["our_bellies"] = get_vorebellies(host, FALSE) return data @@ -583,16 +179,54 @@ return TRUE switch(action) + if("change_tab") + var/new_tab = params["tab"] + if(isnum(new_tab)) + active_tab = new_tab + return TRUE + + if("change_vore_tab") + var/new_tab = params["tab"] + if(isnum(new_tab)) + active_vore_tab = new_tab + return TRUE + + if("change_message_option") + var/new_tab = params["tab"] + if(isnum(new_tab)) + message_option = new_tab + message_subtab = null + selected_message = null + return TRUE + + if("change_message_type") + var/new_tab = params["tab"] + if(istext(new_tab)) + message_subtab = new_tab + selected_message = null + return TRUE + + if("set_current_message") + var/new_tab = params["tab"] + if(istext(new_tab)) + selected_message = new_tab + return TRUE + + if("change_sc_message_option") + var/new_tab = params["tab"] + if(istext(new_tab)) + sc_message_subtab = new_tab + return TRUE + + if("change_aset_message_option") + var/new_tab = params["tab"] + if(istext(new_tab)) + aset_message_subtab = new_tab + return TRUE + if("show_pictures") show_pictures = !show_pictures return TRUE - if("int_help") - tgui_alert(ui.user, "These control how your belly responds to someone using 'resist' while inside you. The percent chance to trigger each is listed below, \ - and you can change them to whatever you see fit. Setting them to 0% will disable the possibility of that interaction. \ - These only function as long as interactions are turned on in general. Keep in mind, the 'belly mode' interactions (digest/absorb) \ - will affect all prey in that belly, if one resists and triggers digestion/absorption. If multiple trigger at the same time, \ - only the first in the order of 'Escape > Transfer > Absorb > Digest' will occur.","Interactions Help") - return TRUE // Host is inside someone else, and is trying to interact with something else inside that person. if("pick_from_inside") @@ -716,28 +350,12 @@ exportPanel.open_export_panel(ui.user) return TRUE - if("setflavor") - var/new_flavor = html_encode(tgui_input_text(ui.user,"What your character tastes like (400ch limit). This text will be printed to the pred after 'X tastes of...' so just put something like 'strawberries and cream':","Character Flavor",host.vore_taste)) - if(!new_flavor) - return FALSE - - new_flavor = readd_quotes(new_flavor) - if(length(new_flavor) > FLAVOR_MAX) - tgui_alert_async(ui.user, "Entered flavor/taste text too long. [FLAVOR_MAX] character limit.","Error!") - return FALSE - host.vore_taste = new_flavor + if(TASTE_FLAVOR) + host.vore_taste = sanitize(params["val"], FLAVOR_MAX, FALSE, TRUE, FALSE) unsaved_changes = TRUE return TRUE - if("setsmell") - var/new_smell = html_encode(tgui_input_text(ui.user,"What your character smells like (400ch limit). This text will be printed to the pred after 'X smells of...' so just put something like 'strawberries and cream':","Character Smell",host.vore_smell)) - if(!new_smell) - return FALSE - - new_smell = readd_quotes(new_smell) - if(length(new_smell) > FLAVOR_MAX) - tgui_alert_async(ui.user, "Entered perfume/smell text too long. [FLAVOR_MAX] character limit.","Error!") - return FALSE - host.vore_smell = new_smell + if(SMELL_FLAVOR) + host.vore_smell = sanitize(params["val"], FLAVOR_MAX, FALSE, TRUE, FALSE) unsaved_changes = TRUE return TRUE if("toggle_dropnom_pred") @@ -874,8 +492,6 @@ // liquid belly code if("liq_set_attribute") return liq_set_attr(ui.user, params) - if("liq_set_messages") - return liq_set_msg(ui.user, params) if("toggle_liq_rec") host.receive_reagents = !host.receive_reagents if(host.client.prefs_vr) @@ -968,24 +584,34 @@ unsaved_changes = TRUE return TRUE if("set_vs_color") - var/belly_choice = tgui_input_list(ui.user, "Which vore sprite are you going to edit the color of?", "Vore Sprite Color", host.vore_icon_bellies) - if(belly_choice) - var/newcolor = tgui_color_picker(ui.user, "Choose a color.", "", host.vore_sprite_color[belly_choice]) - if(newcolor) - host.vore_sprite_color[belly_choice] = newcolor - var/multiply = tgui_input_list(ui.user, "Set the color to be applied multiplicatively or additively? Currently in [host.vore_sprite_multiply[belly_choice] ? "Multiply" : "Add"]", "Vore Sprite Color", list("Multiply", "Add")) - if(multiply == "Multiply") - host.vore_sprite_multiply[belly_choice] = TRUE - else if(multiply == "Add") - host.vore_sprite_multiply[belly_choice] = FALSE - host.update_icons_body() - unsaved_changes = TRUE + var/belly_choice = params["attribute"] + if(!(belly_choice in host.vore_icon_bellies)) + return FALSE + var/newcolor = tgui_color_picker(ui.user, "Choose a color.", "", host.vore_sprite_color[belly_choice]) + if(!newcolor) + return FALSE + host.vore_sprite_color[belly_choice] = newcolor + host.update_icons_body() + unsaved_changes = TRUE + return TRUE + if("toggle_vs_multiply") + var/belly_choice = params["attribute"] + if(!(belly_choice in host.vore_icon_bellies)) + return FALSE + if(!host.vore_sprite_multiply[belly_choice]) + host.vore_sprite_multiply[belly_choice] = TRUE + else + host.vore_sprite_multiply[belly_choice] = !host.vore_sprite_multiply[belly_choice] + host.update_icons_body() + unsaved_changes = TRUE return TRUE //vore sprites color if("set_belly_rub") - host.belly_rub_target = tgui_input_list(ui.user, "Which belly would you prefer to be rubbed?","Select Target", host.vore_organs) - if(!(host.belly_rub_target)) + var/rub_target = params["val"] + if(rub_target == "Current Selected") host.belly_rub_target = null + else + host.belly_rub_target = rub_target if(host.client.prefs_vr) host.client.prefs_vr.belly_rub_target = host.belly_rub_target unsaved_changes = TRUE @@ -1103,9 +729,11 @@ unsaved_changes = TRUE return TRUE if("soulcatcher_sfx") - var/obj/belly = locate(params["selected_belly"]) - if(istype(belly)) - host.soulgem.update_linked_belly(belly) + var/obj/belly = locate(params["val"]) + if(!istype(belly)) + host.soulgem.update_linked_belly(null) + return TRUE + host.soulgem.update_linked_belly(belly) unsaved_changes = TRUE return TRUE if("toggle_self_catching") @@ -1149,56 +777,46 @@ unsaved_changes = TRUE return TRUE if("soulcatcher_rename") - var/new_name = tgui_input_text(host, "Adjust the name of your soulcatcher. Limit 60 chars.", \ - "New Name", html_decode(host.soulgem.name), 60, prevent_enter = TRUE) - if(new_name) - unsaved_changes = TRUE - host.soulgem.rename(new_name) + var/new_name = params["val"] + if(!host.soulgem.rename(new_name)) + return FALSE + unsaved_changes = TRUE return TRUE - if("soulcatcher_interior_design") - var/new_flavor = tgui_input_text(host, "Type what the prey sees after being 'caught'. This will be \ - printed after an intro set in the capture message to the prey. If you already \ - have prey, this will be printed to them after the transit message. Limit [MAX_MESSAGE_LEN * 2] chars.", \ - "VR Environment", html_decode(host.soulgem.inside_flavor), MAX_MESSAGE_LEN * 2, TRUE, prevent_enter = TRUE) + if(SC_INTERIOR_MESSAGE) + var/new_flavor = params["val"] if(new_flavor) unsaved_changes = TRUE host.soulgem.adjust_interior(new_flavor) return TRUE - if("soulcatcher_capture_message") - var/message = tgui_input_text(host, "Type what the prey sees while being 'caught'. This will be \ - printed before the iterior design to the prey. Limit [MAX_MESSAGE_LEN / 4] chars.", \ - "VR Capture", html_decode(host.soulgem.capture_message), MAX_MESSAGE_LEN / 4, TRUE, prevent_enter = TRUE) + if(SC_CAPTURE_MEESAGE) + var/message = params["val"] if(message) unsaved_changes = TRUE - host.soulgem.set_custom_message(message, "capture") + host.soulgem.set_custom_message(message, SC_CAPTURE_MEESAGE) return TRUE - if("soulcatcher_transit_message") - var/message = tgui_input_text(host, "Type what the prey sees when you change the interior with them already captured. \ - Limit [MAX_MESSAGE_LEN / 4] chars.", "VR Transit", html_decode(host.soulgem.transit_message), MAX_MESSAGE_LEN / 4, TRUE, prevent_enter = TRUE) + if(SC_TRANSIT_MESSAGE) + var/message = params["val"] if(message) unsaved_changes = TRUE - host.soulgem.set_custom_message(message, "transit") + host.soulgem.set_custom_message(message, SC_TRANSIT_MESSAGE) return TRUE - if("soulcatcher_release_message") - var/message = tgui_input_text(host, "Type what the prey sees when they are released. \ - Limit [MAX_MESSAGE_LEN / 4] chars.", "VR Release", html_decode(host.soulgem.release_message), MAX_MESSAGE_LEN / 4, TRUE, prevent_enter = TRUE) + if(SC_RELEASE_MESSAGE) + var/message = params["val"] if(message) unsaved_changes = TRUE - host.soulgem.set_custom_message(message, "release") + host.soulgem.set_custom_message(message, SC_RELEASE_MESSAGE) return TRUE - if("soulcatcher_transfer_message") - var/message = tgui_input_text(host, "Type what the prey sees when they are transfered. \ - Limit [MAX_MESSAGE_LEN / 4] chars.", "VR Transfer", html_decode(host.soulgem.transfer_message), MAX_MESSAGE_LEN / 4, TRUE, prevent_enter = TRUE) + if(SC_TRANSFERE_MESSAGE) + var/message = params["val"] if(message) unsaved_changes = TRUE - host.soulgem.set_custom_message(message, "transfer") + host.soulgem.set_custom_message(message, SC_TRANSFERE_MESSAGE) return TRUE - if("soulcatcher_delete_message") - var/message = tgui_input_text(host, "Type what the prey sees when they are deleted. \ - Limit [MAX_MESSAGE_LEN / 4] chars.", "VR Transfer", html_decode(host.soulgem.delete_message), MAX_MESSAGE_LEN / 4, TRUE, prevent_enter = TRUE) + if(SC_DELETE_MESSAGE) + var/message = params["val"] if(message) unsaved_changes = TRUE - host.soulgem.set_custom_message(message, "delete") + host.soulgem.set_custom_message(message, SC_DELETE_MESSAGE) return TRUE /datum/vore_look/proc/pick_from_inside(mob/user, params) @@ -1238,7 +856,7 @@ return TRUE if(!isliving(target)) - return + return FALSE var/mob/living/M = target switch(intent) @@ -1291,12 +909,9 @@ //Handle the [All] choice. Ugh inelegant. Someone make this pretty. if(params["pickall"]) - intent = tgui_alert(user, "Eject all, Move all?","Query",list("Eject all","Cancel","Move all")) + intent = params["intent"] switch(intent) - if("Cancel") - return TRUE - - if("Eject all") + if("eject_all") if(host.stat) to_chat(user,span_warning("You can't do that in your state!")) return TRUE @@ -1304,12 +919,12 @@ host.vore_selected.release_all_contents() return TRUE - if("Move all") + if("move_all") if(host.stat) to_chat(user,span_warning("You can't do that in your state!")) return TRUE - var/obj/belly/choice = tgui_input_list(user, "Move all where?","Select Belly", host.vore_organs) + var/obj/belly/choice = locate(params["val"]) if(!choice) return FALSE @@ -1319,7 +934,7 @@ to_chat(host.vore_selected.get_belly_surrounding(target.contents),span_warning("You're squished along with [target] from [host]'s [lowertext(host.vore_selected)] to their [lowertext(choice.name)]!")) host.vore_selected.transfer_contents(target, choice, 1) return TRUE - return + return FALSE var/atom/movable/target = locate(params["pick"]) if(!(target in host.vore_selected)) @@ -1427,10 +1042,10 @@ var/mob/living/carbon/human/H = target if(!istype(H)) - return + return FALSE if(!H.allow_spontaneous_tf) - return + return FALSE var/datum/tgui_module/appearance_changer/vore/V = new(host, H) V.tgui_interact(user) @@ -1607,27 +1222,27 @@ process_options += "Cancel" else to_chat(user, span_vwarning("You cannot instantly process [ourtarget].")) - return + return FALSE var/ourchoice = tgui_input_list(user, "How would you prefer to process \the [target]? This will perform the given action instantly if the prey accepts.","Instant Process", process_options) if(!ourchoice) - return + return FALSE if(!ourtarget.client) to_chat(user, span_vwarning("You cannot instantly process [ourtarget].")) - return + return FALSE var/obj/belly/b = ourtarget.loc switch(ourchoice) if("Digest") if(ourtarget.absorbed) to_chat(user, span_vwarning("\The [ourtarget] is absorbed, and cannot presently be digested.")) - return + return FALSE if(tgui_alert(ourtarget, "\The [user] is attempting to instantly digest you. Is this something you are okay with happening to you?","Instant Digest", list("No", "Yes")) != "Yes") to_chat(user, span_vwarning("\The [ourtarget] declined your digest attempt.")) to_chat(ourtarget, span_vwarning("You declined the digest attempt.")) - return + return FALSE if(ourtarget.loc != b) to_chat(user, span_vwarning("\The [ourtarget] is no longer in \the [b].")) - return + return FALSE if(isliving(user)) var/mob/living/l = user var/thismuch = ourtarget.health + 100 @@ -1648,10 +1263,10 @@ if(tgui_alert(ourtarget, "\The [user] is attempting to instantly absorb you. Is this something you are okay with happening to you?","Instant Absorb", list("No", "Yes")) != "Yes") to_chat(user, span_vwarning("\The [ourtarget] declined your absorb attempt.")) to_chat(ourtarget, span_vwarning("You declined the absorb attempt.")) - return + return FALSE if(ourtarget.loc != b) to_chat(user, span_vwarning("\The [ourtarget] is no longer in \the [b].")) - return + return FALSE if(isliving(user)) var/mob/living/l = user l.adjust_nutrition(ourtarget.nutrition) @@ -1662,14 +1277,14 @@ if(tgui_alert(ourtarget, "\The [user] is attempting to instantly make you unconscious, you will be unable until ejected from the pred. Is this something you are okay with happening to you?","Instant Knockout", list("No", "Yes")) != "Yes") to_chat(user, span_vwarning("\The [ourtarget] declined your knockout attempt.")) to_chat(ourtarget, span_vwarning("You declined the knockout attempt.")) - return + return FALSE if(ourtarget.loc != b) to_chat(user, span_vwarning("\The [ourtarget] is no longer in \the [b].")) - return + return FALSE ourtarget.AdjustSleeping(500000) to_chat(ourtarget, span_vwarning("\The [user] has put you to sleep, you will remain unconscious until ejected from the belly.")) if("Cancel") - return + return FALSE if("Health Check") var/mob/living/carbon/human/H = target var/target_health = round((H.health/H.getMaxHealth())*100) @@ -1693,1467 +1308,27 @@ condition_consequences += "hear or do anything" if(condition) to_chat(user, span_vwarning("\The [target] is currently [condition], they will not be able to [condition_consequences].")) - return + return FALSE +/datum/vore_look/proc/sanitize_fixed_list(var/list/messages, type, delim = "\n\n", limit) + if(!limit) + CRASH("[type] set message called without limit!") + VPPREF_MESSAGE_SANITY(type) -/datum/vore_look/proc/set_attr(mob/user, params) - if(!host.vore_selected) - tgui_alert_async(user, "No belly selected to modify.") - return FALSE - var/attr = params["attribute"] - switch(attr) - if("b_name") - var/new_name = html_encode(tgui_input_text(user,"Belly's new name:","New Name")) + if(!islist(messages) || LAZYLEN(messages) != 10) + CRASH("[type] set message lists with invalid length!") - var/failure_msg - if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) - failure_msg = "Entered belly name length invalid (must be longer than [BELLIES_NAME_MIN], no more than than [BELLIES_NAME_MAX])." - // else if(whatever) //Next test here. - else - for(var/obj/belly/B as anything in host.vore_organs) - if(lowertext(new_name) == lowertext(B.name)) - failure_msg = "No duplicate belly names, please." - break + for(var/i = 1, i <= messages.len, i++) + messages[i] = sanitize(messages[i], limit, FALSE, TRUE, FALSE) - if(failure_msg) //Something went wrong. - tgui_alert_async(user,failure_msg,"Error!") - return FALSE + switch(type) + if(GENERAL_EXAMINE_NUTRI) + host.nutrition_messages = messages + if(GENERAL_EXAMINE_WEIGHT) + host.weight_messages = messages - host.vore_selected.name = new_name - . = TRUE - if("b_message_mode") - host.vore_selected.message_mode = !host.vore_selected.message_mode - . = TRUE - if("b_wetness") - host.vore_selected.is_wet = !host.vore_selected.is_wet - . = TRUE - if("b_wetloop") - host.vore_selected.wet_loop = !host.vore_selected.wet_loop - . = TRUE - if("b_mode") - var/list/menu_list = host.vore_selected.digest_modes.Copy() - var/new_mode = tgui_input_list(user, "Choose Mode (currently [host.vore_selected.digest_mode])", "Mode Choice", menu_list) - if(!new_mode) - return FALSE - - host.vore_selected.digest_mode = new_mode - host.vore_selected.updateVRPanels() - . = TRUE - if("b_addons") - var/list/menu_list = host.vore_selected.mode_flag_list.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Addon", "Addon Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.mode_flags ^= host.vore_selected.mode_flag_list[toggle_addon] - host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on - host.vore_selected.slow_digestion = FALSE - if(host.vore_selected.mode_flags & DM_FLAG_SLOWBODY) - host.vore_selected.slow_digestion = TRUE - if(toggle_addon == "TURBO MODE") - STOP_PROCESSING(SSbellies, host.vore_selected) - STOP_PROCESSING(SSobj, host.vore_selected) - if(host.vore_selected.mode_flags & DM_FLAG_TURBOMODE) - host.vore_selected.speedy_mob_processing = TRUE - START_PROCESSING(SSobj, host.vore_selected) - to_chat(user, span_warning("TURBO MODE activated! Belly processing speed tripled! This also affects timed settings, such as autotransfer and liquid generation.")) - else - host.vore_selected.speedy_mob_processing = FALSE - START_PROCESSING(SSbellies, host.vore_selected) - to_chat(user, span_warning("TURBO MODE deactivated. Belly processing returned to normal speed.")) - . = TRUE - if("b_item_mode") - var/list/menu_list = host.vore_selected.item_digest_modes.Copy() - - var/new_mode = tgui_input_list(user, "Choose Mode (currently [host.vore_selected.item_digest_mode])", "Mode Choice", menu_list) - if(!new_mode) - return FALSE - - host.vore_selected.item_digest_mode = new_mode - host.vore_selected.items_preserved.Cut() //Re-evaltuate all items in belly on belly-mode change - . = TRUE - if("b_contaminates") // Reverting upstream's change because why reset save files due to a different server's drama? - host.vore_selected.contaminates = !host.vore_selected.contaminates - . = TRUE - if("b_contamination_flavor") - var/list/menu_list = GLOB.contamination_flavors.Copy() - var/new_flavor = tgui_input_list(user, "Choose Contamination Flavor Text Type (currently [host.vore_selected.contamination_flavor])", "Flavor Choice", menu_list) - if(!new_flavor) - return FALSE - host.vore_selected.contamination_flavor = new_flavor - . = TRUE - if("b_contamination_color") - var/list/menu_list = GLOB.contamination_colors.Copy() - var/new_color = tgui_input_list(user, "Choose Contamination Color (currently [host.vore_selected.contamination_color])", "Color Choice", menu_list) - if(!new_color) - return FALSE - host.vore_selected.contamination_color = new_color - host.vore_selected.items_preserved.Cut() //To re-contaminate for new color - . = TRUE - if("b_egg_type") - var/list/menu_list = GLOB.global_vore_egg_types.Copy() - var/new_egg_type = tgui_input_list(user, "Choose Egg Type (currently [host.vore_selected.egg_type])", "Egg Choice", menu_list) - if(!new_egg_type) - return FALSE - host.vore_selected.egg_type = new_egg_type - . = TRUE - if("b_egg_name") - var/new_egg_name = html_encode(tgui_input_text(user,"Custom Egg Name (Leave empty for default egg name)","New Egg Name")) - if(length(new_egg_name) > BELLIES_NAME_MAX) - tgui_alert_async(user, "Entered name too long (max [BELLIES_NAME_MAX]).","Error") - return FALSE - host.vore_selected.egg_name = new_egg_name - . = TRUE - if("b_egg_size") - var/new_egg_size = tgui_input_number(user,"Custom Egg Size 25% to 200% (0 for automatic item depending egg size from 25% to 100%)","New Egg Size", 0, 200) - if(new_egg_size == null) - return FALSE - if(new_egg_size == 0) //Disable. - host.vore_selected.egg_size = 0 - to_chat(user,span_notice("Eggs will automatically calculate size depending on contents.")) - else if (!ISINRANGE(new_egg_size,25,200)) - host.vore_selected.egg_size = 0.25 //Set it to the default. - to_chat(user,span_notice("Invalid size.")) - else if(new_egg_size) - host.vore_selected.egg_size = (new_egg_size/100) - . = TRUE - if("b_recycling") - host.vore_selected.recycling = !host.vore_selected.recycling - . = TRUE - if("b_storing_nutrition") - host.vore_selected.storing_nutrition = !host.vore_selected.storing_nutrition - . = TRUE - if("b_desc") - var/new_desc = html_encode(tgui_input_text(user,"Belly Description, '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name. ([BELLIES_DESC_MAX] char limit):","New Description",host.vore_selected.desc, multiline = TRUE, prevent_enter = TRUE)) - - if(new_desc) - new_desc = readd_quotes(new_desc) - if(length(new_desc) > BELLIES_DESC_MAX) - tgui_alert_async(user, "Entered belly desc too long. [BELLIES_DESC_MAX] character limit.","Error") - return FALSE - host.vore_selected.desc = new_desc - . = TRUE - if("b_absorbed_desc") - var/new_desc = html_encode(tgui_input_text(user,"Belly Description for absorbed prey, '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name. ([BELLIES_DESC_MAX] char limit):","New Description",host.vore_selected.absorbed_desc, multiline = TRUE, prevent_enter = TRUE)) - - if(new_desc) - new_desc = readd_quotes(new_desc) - if(length(new_desc) > BELLIES_DESC_MAX) - tgui_alert_async(user, "Entered belly desc too long. [BELLIES_DESC_MAX] character limit.","Error") - return FALSE - host.vore_selected.absorbed_desc = new_desc - . = TRUE - if("b_msgs") - if(user.text_warnings) - if(tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max [MAX_MESSAGE_LEN / 4] characters per message ([MAX_MESSAGE_LEN / 2] for examines, [MAX_MESSAGE_LEN / 4] for idle messages), max 10 messages per topic or a total of [MAX_MESSAGE_LEN * 1.5] characters.","Really, don't.",list("OK", "Disable Warnings")) == "Disable Warnings") // Should remain tgui_alert() (blocking) - user.text_warnings = FALSE - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name. '%count' will be replaced with the number of anything in your belly. '%countprey' will be replaced with the number of living prey in your belly." - switch(params["msgtype"]) - if(DIGEST_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they expire. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Digest Message (to prey)",host.vore_selected.get_messages(DIGEST_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,DIGEST_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(DIGEST_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey expires in you. Write them in 2nd person ('you feel X'). Avoid using %pred in this type."+help,"Digest Message (to you)",host.vore_selected.get_messages(DIGEST_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,DIGEST_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORB_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when their absorption finishes. Write them in 2nd person ('you feel X'). Avoid using %prey in this type. %count will not work for this type, and %countprey will only count absorbed victims."+help,"Absorb Message (to prey)",host.vore_selected.get_messages(ABSORB_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORB_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORB_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey's absorption finishes. Write them in 2nd person ('you feel X'). Avoid using %pred in this type. %count will not work for this type, and %countprey will only count absorbed victims."+help,"Absorb Message (to you)",host.vore_selected.get_messages(ABSORB_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORB_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(UNABSORBS_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when their unnabsorption finishes. Write them in 2nd person ('you feel X'). Avoid using %prey in this type. %count will not work for this type, and %countprey will only count absorbed victims."+help,"Unabsorb Message (to prey)",host.vore_selected.get_messages(UNABSORBS_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,UNABSORBS_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(UNABSORBS_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey's unabsorption finishes. Write them in 2nd person ('you feel X'). Avoid using %pred in this type. %count will not work for this type, and %countprey will only count absorbed victims."+help,"Unabsorb Message (to you)",host.vore_selected.get_messages(UNABSORBS_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,UNABSORBS_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(STRUGGLE_OUTSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to those nearby when prey struggles. Write them in 3rd person ('X's Y bulges')."+help,"Struggle Message (outside)",host.vore_selected.get_messages(STRUGGLE_OUTSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,STRUGGLE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(STRUGGLE_INSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they struggle. Write them in 2nd person ('you feel X'). Avoid using %prey in this type."+help,"Struggle Message (inside)",host.vore_selected.get_messages(STRUGGLE_INSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,STRUGGLE_INSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_STRUGGLE_OUSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to those nearby when absorbed prey struggles. Write them in 3rd person ('X's Y bulges'). %count will not work for this type, and %countprey will only count absorbed victims."+help,"Absorbed Struggle Message (outside)",host.vore_selected.get_messages(ABSORBED_STRUGGLE_OUSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_STRUGGLE_OUSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_STRUGGLE_INSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to absorbed prey when they struggle. Write them in 2nd person ('you feel X'). Avoid using %prey in this type. %count will not work for this type, and %countprey will only count absorbed victims."+help,"Absorbed Struggle Message (inside)",host.vore_selected.get_messages(ABSORBED_STRUGGLE_INSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_STRUGGLE_INSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_ATTEMPT_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they try to escape from within you. Write them in 2nd person ('you start to X')."+help,"Escape Attempt Message (to prey)",host.vore_selected.get_messages(ESCAPE_ATTEMPT_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_ATTEMPT_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_ATTEMPT_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey tries to escape from within you. Write them in 2nd person ('X ... from your Y')."+help,"Escape Attempt Message (to you)",host.vore_selected.get_messages(ESCAPE_ATTEMPT_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_ATTEMPT_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they escape from within you. Write them in 2nd person ('you climb out of Y)."+help,"Escape Message (to prey)",host.vore_selected.get_messages(ESCAPE_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey escapes from within you. Write them in 2nd person ('X ... from your Y')."+help,"Escape Message (to you)",host.vore_selected.get_messages(ESCAPE_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_OUTSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to those around you when prey escapes from within you. Write them in 3rd person ('X climbs out of Z's Y')."+help,"Escape Message (outside)",host.vore_selected.get_messages(ESCAPE_OUTSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_ITEM_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they manage to eject an item from within you. Write them in 2nd person ('you manage to O'). Use %item to refer to the ejected item in this type."+help,"Escape Item Message (to prey)",host.vore_selected.get_messages(ESCAPE_ITEM_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_ITEM_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_ITEM_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey manages to eject an item from within you. Write them in 2nd person ('O slips from Y'). Use %item to refer to the ejected item in this type."+help,"Escape Item Message (to you)",host.vore_selected.get_messages(ESCAPE_ITEM_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_ITEM_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_ITEM_OUTSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to those around you when prey manages to eject an item from within you. Write them in 3rd person ('O from Y'). Use %item to refer to the ejected item in this type."+help,"Escape Item Message (outside)",host.vore_selected.get_messages(ESCAPE_ITEM_OUTSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_ITEM_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_FAIL_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they fail to escape from within you. Write them in 2nd person ('you failed to Y')."+help,"Escape Fail Message (to prey)",host.vore_selected.get_messages(ESCAPE_FAIL_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_FAIL_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ESCAPE_FAIL_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey fails to escape from within you. Write them in 2nd person ('X failed ... your Y')."+help,"Escape Fail Message (to you)",host.vore_selected.get_messages(ESCAPE_FAIL_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ESCAPE_FAIL_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_ESCAPE_ATTEMPT_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to absorbed prey when they try to escape from within you. Write them in 2nd person ('you start to X')."+help,"Absorbed Escape Attempt Message (to prey)",host.vore_selected.get_messages(ABSORBED_ESCAPE_ATTEMPT_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_ESCAPE_ATTEMPT_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_ESCAPE_ATTEMPT_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when absorbed prey tries to escape from within you. Write them in 2nd person ('X ... from your Y')."+help,"Absorbed Escape Attempt Message (to you)",host.vore_selected.get_messages(ABSORBED_ESCAPE_ATTEMPT_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_ESCAPE_ATTEMPT_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_ESCAPE_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to absorbed prey when they escape from within you. Write them in 2nd person ('you escape from Y')."+help,"Absorbed Escape Message (to prey)",host.vore_selected.get_messages(ABSORBED_ESCAPE_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_ESCAPE_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when absorbed prey escapes from within you. Write them in 2nd person ('X ... from your Y')."+help,"Absorbed Escape Message (to you)",host.vore_selected.get_messages(ABSORBED_ESCAPE_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORBED_ESCAPE_OUTSIDE) - var/new_message = sanitize(tgui_input_text(user,"These are sent to those around you when absorbed prey escapes from within you. Write them in 3rd person ('X escapes from Z's Y')."+help,"Absorbed Escape Message (outside)",host.vore_selected.get_messages(ABSORBED_ESCAPE_OUTSIDE), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORBED_ESCAPE_OUTSIDE, limit = MAX_MESSAGE_LEN / 4) - - if(FULL_ABSORBED_ESCAPE_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to absorbed prey when they fail to escape from within you. Write them in 2nd person ('you failed to Y')."+help,"Absorbed Escape Fail Message (to prey)",host.vore_selected.get_messages(FULL_ABSORBED_ESCAPE_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,FULL_ABSORBED_ESCAPE_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(FULL_ABSORBED_ESCAPE_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when absorbed prey fails to escape from within you. Write them in 2nd person ('X failed ... your Y')."+help,"Absorbed Escape Fail Message (to you)",host.vore_selected.get_messages(FULL_ABSORBED_ESCAPE_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,FULL_ABSORBED_ESCAPE_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(PRIMARY_TRANSFER_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they struggle and are transferred into your primary destination. Write them in 2nd person ('you slide into Y'). Use %dest to refer to the target location in this type."+help,"Primary Transfer Message (to prey)",host.vore_selected.get_messages(PRIMARY_TRANSFER_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,PRIMARY_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(PRIMARY_TRANSFER_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey struggle and are transferred into your primary destination. Write them in 2nd person ('X slid into your Y'). Use %dest to refer to the target location in this type."+help,"Primary Transfer Message (to you)",host.vore_selected.get_messages(PRIMARY_TRANSFER_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,PRIMARY_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(SECONDARY_TRANSFER_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they struggle and are transferred into your secondary destination. Write them in 2nd person ('you slide into Y'). Use %dest to refer to the target location in this type."+help,"Secondary Transfer Message (to prey)",host.vore_selected.get_messages(SECONDARY_TRANSFER_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,SECONDARY_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(SECONDARY_TRANSFER_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey struggle and are transferred into your primary destination. Write them in 2nd person ('X slid into your Y'). Use %dest to refer to the target location in this type."+help,"Secondary Transfer Message (to you)",host.vore_selected.get_messages(SECONDARY_TRANSFER_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,SECONDARY_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(PRIMARY_AUTO_TRANSFER_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they are automatically transferred into your primary destination. Write them in 2nd person ('you slide into Y'). Use %dest to refer to the target location in this type."+help,"Primary Auto-Transfer Message (to prey)",host.vore_selected.get_messages(PRIMARY_AUTO_TRANSFER_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,PRIMARY_AUTO_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(PRIMARY_AUTO_TRANSFER_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey is automatically transferred into your primary destination. Write them in 2nd person ('X slid into your Y'). Use %dest to refer to the target location in this type."+help,"Primary Auto-Transfer Message (to you)",host.vore_selected.get_messages(PRIMARY_AUTO_TRANSFER_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,PRIMARY_AUTO_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(SECONDARY_AUTO_TRANSFER_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they are automatically transferred into your secondary destination. Write them in 2nd person ('you slide into Y'). Use %dest to refer to the target location in this type."+help,"Secondary Auto-Transfer Message (to prey)",host.vore_selected.get_messages(SECONDARY_AUTO_TRANSFER_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,SECONDARY_AUTO_TRANSFER_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(SECONDARY_AUTO_TRANSFER_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey is automatically transferred into your primary destination. Write them in 2nd person ('X slid into your Y'). Use %dest to refer to the target location in this type."+help,"Secondary Auto-Transfer Message (to you)",host.vore_selected.get_messages(SECONDARY_AUTO_TRANSFER_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,SECONDARY_AUTO_TRANSFER_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(DIGEST_CHANCE_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they trigger the interaction digest chance. Write them in 2nd person ('you feel X')."+help,"Stomach Mode Digest Message (to prey)",host.vore_selected.get_messages(DIGEST_CHANCE_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,DIGEST_CHANCE_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(DIGEST_CHANCE_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey triggers the interaction digest chance. Write them in 2nd person ('you feel X')."+help,"Stomach Mode Digest Message (to you)",host.vore_selected.get_messages(DIGEST_CHANCE_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,DIGEST_CHANCE_OWNER, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORB_CHANCE_PREY) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey when they trigger the interaction absorb chance. Write them in 2nd person ('you feel X')."+help,"Stomach Mode Digest Message (to prey)",host.vore_selected.get_messages(ABSORB_CHANCE_PREY), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORB_CHANCE_PREY, limit = MAX_MESSAGE_LEN / 4) - - if(ABSORB_CHANCE_OWNER) - var/new_message = sanitize(tgui_input_text(user,"These are sent to you when prey triggers the interaction absorb chance. Write them in 2nd person ('you feel X')."+help,"Stomach Mode Digest Message (to you)",host.vore_selected.get_messages(ABSORB_CHANCE_OWNER), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,ABSORB_CHANCE_OWNER, limit = MAX_MESSAGE_LEN / 4) - if(EXAMINES) - var/new_message = sanitize(tgui_input_text(user,"These are sent to people who examine you when this belly has contents. Write them in 3rd person ('Their %belly is bulging')."+help,"Examine Message (when full)",host.vore_selected.get_messages(EXAMINES), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,EXAMINES, limit = MAX_MESSAGE_LEN / 2) - - if(EXAMINES_ABSORBED) - var/new_message = sanitize(tgui_input_text(user,"These are sent to people who examine you when this belly has absorbed victims. Write them in 3rd person ('Their %belly is larger'). %count will not work for this type, and %countprey will only count absorbed victims."+help,"Examine Message (with absorbed victims)",host.vore_selected.get_messages(EXAMINES_ABSORBED), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,EXAMINES_ABSORBED, limit = MAX_MESSAGE_LEN / 2) - - if("en") - var/list/indices = list(1,2,3,4,5,6,7,8,9,10) - var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices) - if(index && index <= 10) - var/alert = tgui_alert(user, "What do you wish to do with this message?","Selection",list("Edit","Clear","Cancel")) - switch(alert) - if("Clear") - host.nutrition_messages[index] = "" - if("Edit") - var/new_message = sanitize(tgui_input_text(user, "Input a message", "Input", host.nutrition_messages[index], multiline = TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN,0,0,0) - if(new_message) - host.nutrition_messages[index] = new_message - - if("ew") - var/list/indices = list(1,2,3,4,5,6,7,8,9,10) - var/index = tgui_input_list(user,"Select a message to edit:","Select Message", indices) - if(index && index <= 10) - var/alert = tgui_alert(user, "What do you wish to do with this message?","Selection",list("Edit","Clear","Cancel")) - switch(alert) - if("Clear") - host.weight_messages[index] = "" - if("Edit") - var/new_message = sanitize(tgui_input_text(user, "Input a message", "Input", host.weight_messages[index], multiline = TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN,0,0,0) - if(new_message) - host.weight_messages[index] = new_message - - if(BELLY_MODE_DIGEST) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Digest mode. Write them in 2nd person ('%pred's %belly squishes down on you.')."+help,"Idle Message (Digest)",host.vore_selected.get_messages(BELLY_MODE_DIGEST), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_DIGEST, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_HOLD) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Hold mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Hold)",host.vore_selected.get_messages(BELLY_MODE_HOLD), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_HOLD, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_HOLD_ABSORB) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are absorbed. Write them in 2nd person ('%pred's %belly squishes down on you.') %count will not work for this type, and %countprey will only count absorbed victims."+help,"Idle Message (Hold Absorbed)",host.vore_selected.get_messages(BELLY_MODE_HOLD_ABSORB), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_HOLD_ABSORB, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_ABSORB) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Absorb mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Absorb)",host.vore_selected.get_messages(BELLY_MODE_ABSORB), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_ABSORB, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_HEAL) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Heal mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Heal)",host.vore_selected.get_messages(BELLY_MODE_HEAL), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_HEAL, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_DRAIN) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Drain mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Drain)",host.vore_selected.get_messages(BELLY_MODE_DRAIN), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_DRAIN, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_STEAL) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Size Steal mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Size Steal)",host.vore_selected.get_messages(BELLY_MODE_STEAL), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_STEAL, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_EGG) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Encase In Egg mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Encase In Egg)",host.vore_selected.get_messages(BELLY_MODE_EGG), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_EGG, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_SHRINK) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Shrink mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Shrink)",host.vore_selected.get_messages(BELLY_MODE_SHRINK), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_SHRINK, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_GROW) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Grow mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Grow)",host.vore_selected.get_messages(BELLY_MODE_GROW), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_GROW, limit = MAX_MESSAGE_LEN / 4) - - if(BELLY_MODE_UNABSORB) - var/new_message = sanitize(tgui_input_text(user,"These are sent to prey every [host.vore_selected.emote_time] seconds when you are on Unabsorb mode. Write them in 2nd person ('%pred's %belly squishes down on you.')"+help,"Idle Message (Unabsorb)",host.vore_selected.get_messages(BELLY_MODE_UNABSORB), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_MODE_UNABSORB, limit = MAX_MESSAGE_LEN / 4) - - if("reset") - var/confirm = tgui_alert(user,"This will delete any custom messages. Are you sure?","Confirmation",list("Cancel","DELETE")) - if(confirm == "DELETE") - var/obj/belly/default_belly = new /obj/belly(null) - host.vore_selected.digest_messages_prey = default_belly.digest_messages_prey.Copy() - host.vore_selected.digest_messages_owner = default_belly.digest_messages_owner.Copy() - host.vore_selected.absorb_messages_prey = default_belly.absorb_messages_prey.Copy() - host.vore_selected.absorb_messages_owner = default_belly.absorb_messages_owner.Copy() - host.vore_selected.unabsorb_messages_prey = default_belly.unabsorb_messages_prey.Copy() - host.vore_selected.unabsorb_messages_owner = default_belly.unabsorb_messages_owner.Copy() - host.vore_selected.struggle_messages_outside = default_belly.struggle_messages_outside.Copy() - host.vore_selected.struggle_messages_inside = default_belly.struggle_messages_inside.Copy() - host.vore_selected.absorbed_struggle_messages_outside = default_belly.absorbed_struggle_messages_outside.Copy() - host.vore_selected.absorbed_struggle_messages_inside = default_belly.absorbed_struggle_messages_inside.Copy() - host.vore_selected.escape_attempt_messages_owner = default_belly.escape_attempt_messages_owner.Copy() - host.vore_selected.escape_attempt_messages_prey = default_belly.escape_attempt_messages_prey.Copy() - host.vore_selected.escape_messages_owner = default_belly.escape_messages_owner.Copy() - host.vore_selected.escape_messages_prey = default_belly.escape_messages_prey.Copy() - host.vore_selected.escape_messages_outside = default_belly.escape_messages_outside.Copy() - host.vore_selected.escape_item_messages_owner = default_belly.escape_item_messages_owner.Copy() - host.vore_selected.escape_item_messages_prey = default_belly.escape_item_messages_prey.Copy() - host.vore_selected.escape_item_messages_outside = default_belly.escape_item_messages_outside.Copy() - host.vore_selected.escape_fail_messages_owner = default_belly.escape_fail_messages_owner.Copy() - host.vore_selected.escape_fail_messages_prey = default_belly.escape_fail_messages_prey.Copy() - host.vore_selected.escape_attempt_absorbed_messages_owner = default_belly.escape_attempt_absorbed_messages_owner.Copy() - host.vore_selected.escape_attempt_absorbed_messages_prey = default_belly.escape_attempt_absorbed_messages_prey.Copy() - host.vore_selected.escape_absorbed_messages_owner = default_belly.escape_absorbed_messages_owner.Copy() - host.vore_selected.escape_absorbed_messages_prey = default_belly.escape_absorbed_messages_prey.Copy() - host.vore_selected.escape_absorbed_messages_outside = default_belly.escape_absorbed_messages_outside.Copy() - host.vore_selected.escape_fail_absorbed_messages_owner = default_belly.escape_fail_absorbed_messages_owner.Copy() - host.vore_selected.escape_fail_absorbed_messages_prey = default_belly.escape_fail_absorbed_messages_prey.Copy() - host.vore_selected.primary_transfer_messages_owner = default_belly.primary_transfer_messages_owner.Copy() - host.vore_selected.primary_transfer_messages_prey = default_belly.primary_transfer_messages_prey.Copy() - host.vore_selected.secondary_transfer_messages_owner = default_belly.secondary_transfer_messages_owner.Copy() - host.vore_selected.secondary_transfer_messages_prey = default_belly.secondary_transfer_messages_prey.Copy() - host.vore_selected.primary_autotransfer_messages_owner = default_belly.primary_autotransfer_messages_owner.Copy() - host.vore_selected.primary_autotransfer_messages_prey = default_belly.primary_autotransfer_messages_prey.Copy() - host.vore_selected.secondary_autotransfer_messages_owner = default_belly.secondary_autotransfer_messages_owner.Copy() - host.vore_selected.secondary_autotransfer_messages_prey = default_belly.secondary_autotransfer_messages_prey.Copy() - host.vore_selected.digest_chance_messages_owner = default_belly.digest_chance_messages_owner.Copy() - host.vore_selected.digest_chance_messages_prey = default_belly.digest_chance_messages_prey.Copy() - host.vore_selected.absorb_chance_messages_owner = default_belly.absorb_chance_messages_owner.Copy() - host.vore_selected.absorb_chance_messages_prey = default_belly.absorb_chance_messages_prey.Copy() - host.vore_selected.examine_messages = default_belly.examine_messages.Copy() - host.vore_selected.examine_messages_absorbed = default_belly.examine_messages_absorbed.Copy() - host.vore_selected.emote_lists = default_belly.emote_lists.Copy() - host.vore_selected.trash_eater_in = default_belly.trash_eater_in.Copy() - host.vore_selected.trash_eater_out = default_belly.trash_eater_out.Copy() - qdel(default_belly) - . = TRUE - if("b_verb") - var/new_verb = html_encode(tgui_input_text(user,"New verb when eating (infinitive tense, e.g. nom or swallow):","New Verb")) - - if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) - tgui_alert_async(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") - return FALSE - - host.vore_selected.vore_verb = new_verb - . = TRUE - if("b_release_verb") - var/new_release_verb = html_encode(tgui_input_text(user,"New verb when releasing from stomach (e.g. expels or coughs or drops):","New Release Verb")) - - if(length(new_release_verb) > BELLIES_NAME_MAX || length(new_release_verb) < BELLIES_NAME_MIN) - tgui_alert_async(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") - return FALSE - - host.vore_selected.release_verb = new_release_verb - . = TRUE - if("b_eating_privacy") - var/privacy_choice = tgui_input_list(user, "Choose your belly-specific preference. Default uses global preference!", "Eating message privacy", list("default", "subtle", "loud"), "default") - if(privacy_choice == null) - return FALSE - host.vore_selected.eating_privacy_local = privacy_choice - . = TRUE - if("b_silicon_belly") - var/belly_choice = tgui_alert(user, "Choose whether you'd like your belly overlay to show from sleepers, \ - normal vore bellies, or an average of the two. NOTE: This ONLY applies to silicons, not human mobs!", "Belly Overlay \ - Preference", - list("Sleeper", "Vorebelly", "Both")) - if(belly_choice == null) - return FALSE - for (var/belly in host.vore_organs) - var/obj/belly/B = belly - B.silicon_belly_overlay_preference = belly_choice - host.update_icon() - . = TRUE - if("b_belly_mob_mult") - var/new_prey_mult = tgui_input_number(user, "Choose the multiplier for mobs contributing to belly size, ranging from 0 to 5. Set to 0 to disable mobs contributing to belly size", - "Set Prey Multiplier", host.vore_selected.belly_mob_mult, max_value = 5, min_value = 0) - if(new_prey_mult == null) - return FALSE - host.vore_selected.belly_mob_mult = CLAMP(new_prey_mult, 0, 5) //Max at 5 because in no world will a borg have more than 5 bellies - host.update_icon() - . = TRUE - if("b_belly_item_mult") - var/new_item_mult = tgui_input_number(user, "Choose the multiplier for items contributing to belly size, \ - ranging from 0 to 10. (Item size affects how much they contribute as well) Set to 0 to disable size checks", "Set Item Multiplier", host.vore_selected.belly_item_mult, max_value = 10, min_value = 0) - if(new_item_mult == null) - return FALSE - else - host.vore_selected.belly_item_mult = CLAMP(new_item_mult, 0, 10) //Max at 10 because items contribute less than mobs, in general - host.update_icon() - . = TRUE - if("b_belly_overall_mult") - var/new_overall_mult = tgui_input_number(user, "Choose the overall multiplier to be applied to belly contents after specific multipliers, ranging from 0 to 5. Set to 0 to disable showing belly sprites at all.", - "Set minimum prey amount", host.vore_selected.belly_overall_mult, max_value = 5, min_value = 0) - if(new_overall_mult == null) - return FALSE - else - host.vore_selected.belly_overall_mult = CLAMP(new_overall_mult, 0, 5) // Max at 5 because... no reason to go higher at that point - host.update_icon() - . = TRUE - if("b_fancy_sound") - host.vore_selected.fancy_vore = !host.vore_selected.fancy_vore - host.vore_selected.vore_sound = "Gulp" - host.vore_selected.release_sound = "Splatter" - // defaults as to avoid potential bugs - . = TRUE - if("b_release") - var/choice - if(host.vore_selected.fancy_vore) - choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", GLOB.fancy_release_sounds) - else - choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", GLOB.classic_release_sounds) - - if(!choice) - return FALSE - - host.vore_selected.release_sound = choice - . = TRUE - if("b_releasesoundtest") - var/sound/releasetest - if(host.vore_selected.fancy_vore) - releasetest = GLOB.fancy_release_sounds[host.vore_selected.release_sound] - else - releasetest = GLOB.classic_release_sounds[host.vore_selected.release_sound] - - if(releasetest) - releasetest = sound(releasetest) - releasetest.volume = host.vore_selected.sound_volume - releasetest.frequency = host.vore_selected.noise_freq - SEND_SOUND(user, releasetest) - . = TRUE - if("b_sound") - var/choice - if(host.vore_selected.fancy_vore) - choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", GLOB.fancy_vore_sounds) - else - choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", GLOB.classic_vore_sounds) - - if(!choice) - return FALSE - - host.vore_selected.vore_sound = choice - . = TRUE - if("b_soundtest") - var/sound/voretest - if(host.vore_selected.fancy_vore) - voretest = GLOB.fancy_vore_sounds[host.vore_selected.vore_sound] - else - voretest = GLOB.classic_vore_sounds[host.vore_selected.vore_sound] - if(voretest) - voretest = sound(voretest) - voretest.volume = host.vore_selected.sound_volume - voretest.frequency = host.vore_selected.noise_freq - SEND_SOUND(user, voretest) - . = TRUE - if("b_sound_volume") - var/sound_volume_input = tgui_input_number(user, "Set belly sound volume percentage.", "Sound Volume", null, 100, 0) - if(!isnull(sound_volume_input)) //These have to be 'null' because both cancel and 0 are valid, separate options - host.vore_selected.sound_volume = sanitize_integer(sound_volume_input, 0, 100, initial(host.vore_selected.sound_volume)) - . = TRUE - if("b_noise_freq") - var/list/preset_noise_freqs = list("high" = MAX_VOICE_FREQ, "middle-high" = 56250, "middle" = 42500, "middle-low"= 28750, "low" = MIN_VOICE_FREQ, "custom" = 1, "random" = 0) - var/choice = tgui_input_list(user, "What would you like to set your noise frequency to? ([MIN_VOICE_FREQ] - [MAX_VOICE_FREQ])", "Noise Frequency", preset_noise_freqs) - if(!choice) - return - choice = preset_noise_freqs[choice] - if(choice == 0) - host.vore_selected.noise_freq = 42500 - return TOPIC_REFRESH - else if(choice == 1) - choice = tgui_input_number(user, "Choose your organ's noise frequency, ranging from [MIN_VOICE_FREQ] to [MAX_VOICE_FREQ]", "Custom Noise Frequency", null, MAX_VOICE_FREQ, MIN_VOICE_FREQ, round_value = TRUE) - if(choice > MAX_VOICE_FREQ) - choice = MAX_VOICE_FREQ - else if(choice < MIN_VOICE_FREQ) - choice = MIN_VOICE_FREQ - host.vore_selected.noise_freq = choice - . = TRUE - if("b_tastes") - host.vore_selected.can_taste = !host.vore_selected.can_taste - . = TRUE - if("b_feedable") - host.vore_selected.is_feedable = !host.vore_selected.is_feedable - . = TRUE - if("b_entrance_logs") - host.vore_selected.entrance_logs = !host.vore_selected.entrance_logs - . = TRUE - if("b_item_digest_logs") - host.vore_selected.item_digest_logs = !host.vore_selected.item_digest_logs - . = TRUE - if("b_bulge_size") - var/new_bulge = tgui_input_number(user, "Choose the required size prey must be to show up on examine, ranging from 25% to 200% Set this to 0 for no text on examine.", "Set Belly Examine Size.", max_value = 200, min_value = 0) - if(new_bulge == null) - return FALSE - if(new_bulge == 0) //Disable. - host.vore_selected.bulge_size = 0 - to_chat(user,span_notice("Your stomach will not be seen on examine.")) - else if (!ISINRANGE(new_bulge,25,200)) - host.vore_selected.bulge_size = 0.25 //Set it to the default. - to_chat(user,span_notice("Invalid size.")) - else if(new_bulge) - host.vore_selected.bulge_size = (new_bulge/100) - . = TRUE - if("b_display_absorbed_examine") - host.vore_selected.display_absorbed_examine = !host.vore_selected.display_absorbed_examine - . = TRUE - if("b_grow_shrink") - var/new_grow = tgui_input_number(user, "Choose the size that prey will be grown/shrunk to, ranging from 25% to 200%", "Set Growth Shrink Size.", host.vore_selected.shrink_grow_size, 200, 25) - if (new_grow == null) - return FALSE - if (!ISINRANGE(new_grow,25,200)) - host.vore_selected.shrink_grow_size = 1 //Set it to the default - to_chat(user,span_notice("Invalid size.")) - else if(new_grow) - host.vore_selected.shrink_grow_size = (new_grow*0.01) - . = TRUE - if("b_nutritionpercent") - var/new_nutrition = tgui_input_number(user, "Choose the nutrition gain percentage you will receive per tick from prey. Ranges from 0.01 to 100.", "Set Nutrition Gain Percentage.", host.vore_selected.nutrition_percent, 100, 0.01, round_value=FALSE) - if(new_nutrition == null) - return FALSE - var/new_new_nutrition = CLAMP(new_nutrition, 0.01, 100) - host.vore_selected.nutrition_percent = new_new_nutrition - . = TRUE - // modified these to be flexible rather than maxing at 6/6/12/6/6 - if("b_burn_dmg") - var/new_damage = tgui_input_number(user, "Choose the amount of burn damage prey will take per tick. Max of [host.vore_selected.digest_max] across all damage types. [host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn] remaining.", "Set Belly Burn Damage.", host.vore_selected.digest_burn, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn, 0, round_value=FALSE) - if(new_damage == null) - return FALSE - new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_burn) // sanity check following tgui input - host.vore_selected.digest_burn = new_damage - host.vore_selected.items_preserved.Cut() - . = TRUE - if("b_brute_dmg") - var/new_damage = tgui_input_number(user, "Choose the amount of brute damage prey will take per tick. Max of [host.vore_selected.digest_max] across all damage types. [host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute] remaining.", "Set Belly Brute Damage.", host.vore_selected.digest_brute, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute, 0, round_value=FALSE) - if(new_damage == null) - return FALSE - new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_brute) - host.vore_selected.digest_brute = new_damage - host.vore_selected.items_preserved.Cut() - . = TRUE - if("b_oxy_dmg") - var/new_damage = tgui_input_number(user, "Choose the amount of oxygen damage prey will take per tick. Max of [host.vore_selected.digest_max] across all damage types. [host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy] remaining.", "Set Belly Oxygen Damage.", host.vore_selected.digest_oxy, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy, 0, round_value=FALSE) - if(new_damage == null) - return FALSE - new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_oxy) - host.vore_selected.digest_oxy = new_damage - . = TRUE - if("b_tox_dmg") - var/new_damage = tgui_input_number(user, "Choose the amount of toxin damage prey will take per tick. Max of [host.vore_selected.digest_max] across all damage types. [host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox] remaining.", "Set Belly Toxin Damage.", host.vore_selected.digest_tox, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox, 0, round_value=FALSE) - if(new_damage == null) - return FALSE - new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_tox) - host.vore_selected.digest_tox = new_damage - . = TRUE - if("b_clone_dmg") - var/new_damage = tgui_input_number(user, "Choose the amount of genetic (clone) damage prey will take per tick. Max of [host.vore_selected.digest_max] across all damage types. [host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone] remaining.", "Set Belly Genetic Damage.", host.vore_selected.digest_clone, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone, 0, round_value=FALSE) - if(new_damage == null) - return FALSE - new_damage = CLAMP(new_damage, 0, host.vore_selected.get_unused_digestion_damage() + host.vore_selected.digest_clone) - host.vore_selected.digest_clone = new_damage - . = TRUE - if("b_drainmode") - var/list/menu_list = host.vore_selected.drainmodes.Copy() - var/new_drainmode = tgui_input_list(user, "Choose Mode (currently [host.vore_selected.digest_mode])", "Mode Choice", menu_list) - if(!new_drainmode) - return FALSE - - host.vore_selected.drainmode = new_drainmode - host.vore_selected.updateVRPanels() - if("b_emoteactive") - host.vore_selected.emote_active = !host.vore_selected.emote_active - . = TRUE - if("b_selective_mode_pref_toggle") - if(host.vore_selected.selective_preference == DM_DIGEST) - host.vore_selected.selective_preference = DM_ABSORB - else - host.vore_selected.selective_preference = DM_DIGEST - . = TRUE - if("b_emotetime") - var/new_time = tgui_input_number(user, "Choose the period it takes for idle belly emotes to be shown to prey. Measured in seconds, Minimum 1 minute, Maximum 10 minutes.", "Set Belly Emote Delay.", host.vore_selected.digest_brute, 600, 60) - if(new_time == null) - return FALSE - var/new_new_time = CLAMP(new_time, 60, 600) - host.vore_selected.emote_time = new_new_time - . = TRUE - if("b_escapable") - if(host.vore_selected.escapable == 0) //Possibly escapable and special interactions. - host.vore_selected.escapable = 1 - to_chat(user,span_warning("Prey now have special interactions with your [lowertext(host.vore_selected.name)] depending on your settings.")) - else if(host.vore_selected.escapable == 1) //Never escapable. - host.vore_selected.escapable = 0 - to_chat(user,span_warning("Prey will not be able to have special interactions with your [lowertext(host.vore_selected.name)].")) - else - tgui_alert_async(user, "Something went wrong. Your stomach will now not have special interactions. Press the button enable them again and tell a dev.","Error") //If they somehow have a varable that's not 0 or 1 - host.vore_selected.escapable = 0 - . = TRUE - if("b_escapechance") - var/escape_chance_input = tgui_input_number(user, "Set prey escape chance on resist (as %)", "Prey Escape Chance", null, 100, 0) - if(!isnull(escape_chance_input)) //These have to be 'null' because both cancel and 0 are valid, separate options - host.vore_selected.escapechance = sanitize_integer(escape_chance_input, 0, 100, initial(host.vore_selected.escapechance)) - . = TRUE - if("b_belchchance") - var/belch_chance_input = tgui_input_number(user, "Set chance for belch emote on prey resist (as %)", "Resist Belch Chance", host.vore_selected.belchchance , 100, 0) - if(!isnull(belch_chance_input)) - host.vore_selected.belchchance = sanitize_integer(belch_chance_input, 0, 100, initial(host.vore_selected.belchchance)) - . = TRUE - if("b_escapechance_absorbed") - var/escape_absorbed_chance_input = tgui_input_number(user, "Set absorbed prey escape chance on resist (as %)", "Prey Absorbed Escape Chance", null, 100, 0) - if(!isnull(escape_absorbed_chance_input)) //These have to be 'null' because both cancel and 0 are valid, separate options - host.vore_selected.escapechance_absorbed = sanitize_integer(escape_absorbed_chance_input, 0, 100, initial(host.vore_selected.escapechance_absorbed)) - . = TRUE - if("b_escapetime") - var/escape_time_input = tgui_input_number(user, "Set number of seconds for prey to escape on resist (1-60)", "Prey Escape Time", null, 60, 1) - if(!isnull(escape_time_input)) - host.vore_selected.escapetime = sanitize_integer(escape_time_input*10, 10, 600, initial(host.vore_selected.escapetime)) - . = TRUE - if("b_transferchance") - var/transfer_chance_input = tgui_input_number(user, "Set belly transfer chance on resist (as %). You must also set the location for this to have any effect.", "Prey Escape Time", null, 100, 0) - if(!isnull(transfer_chance_input)) - host.vore_selected.transferchance = sanitize_integer(transfer_chance_input, 0, 100, initial(host.vore_selected.transferchance)) - . = TRUE - if("b_transferlocation") - var/obj/belly/choice = tgui_input_list(user, "Where do you want your [lowertext(host.vore_selected.name)] to lead if prey resists?","Select Belly", (host.vore_organs + "None - Remove" - host.vore_selected)) - - if(!choice) //They cancelled, no changes - return FALSE - else if(choice == "None - Remove") - host.vore_selected.transferlocation = null - else - host.vore_selected.transferlocation = choice.name - . = TRUE - if("b_transferchance_secondary") - var/transfer_secondary_chance_input = tgui_input_number(user, "Set secondary belly transfer chance on resist (as %). You must also set the location for this to have any effect.", "Prey Escape Time", null, 100, 0) - if(!isnull(transfer_secondary_chance_input)) - host.vore_selected.transferchance_secondary = sanitize_integer(transfer_secondary_chance_input, 0, 100, initial(host.vore_selected.transferchance_secondary)) - . = TRUE - if("b_transferlocation_secondary") - var/obj/belly/choice_secondary = tgui_input_list(user, "Where do you want your [lowertext(host.vore_selected.name)] to alternately lead if prey resists?","Select Belly", (host.vore_organs + "None - Remove" - host.vore_selected)) - - if(!choice_secondary) //They cancelled, no changes - return FALSE - else if(choice_secondary == "None - Remove") - host.vore_selected.transferlocation_secondary = null - else - host.vore_selected.transferlocation_secondary = choice_secondary.name - . = TRUE - if("b_absorbchance") - var/absorb_chance_input = tgui_input_number(user, "Set belly absorb mode chance on resist (as %)", "Prey Absorb Chance", null, 100, 0) - if(!isnull(absorb_chance_input)) - host.vore_selected.absorbchance = sanitize_integer(absorb_chance_input, 0, 100, initial(host.vore_selected.absorbchance)) - . = TRUE - if("b_digestchance") - var/digest_chance_input = tgui_input_number(user, "Set belly digest mode chance on resist (as %)", "Prey Digest Chance", null, 100, 0) - if(!isnull(digest_chance_input)) - host.vore_selected.digestchance = sanitize_integer(digest_chance_input, 0, 100, initial(host.vore_selected.digestchance)) - . = TRUE - if("b_autotransferchance") - var/autotransferchance_input = tgui_input_number(user, "Set belly auto-transfer chance (as %). You must also set the location for this to have any effect.", "Auto-Transfer Chance", host.vore_selected.autotransferchance, 100) - if(!isnull(autotransferchance_input)) - host.vore_selected.autotransferchance = sanitize_integer(autotransferchance_input, 0, 100, initial(host.vore_selected.autotransferchance)) - . = TRUE - if("b_autotransferwait") - var/autotransferwait_input = tgui_input_number(user, "Set minimum number of seconds for auto-transfer wait delay.", "Auto-Transfer Time", host.vore_selected.autotransferwait, 1800, 1) - if(!isnull(autotransferwait_input)) - host.vore_selected.autotransferwait = sanitize_integer(autotransferwait_input*10, 10, 18000, initial(host.vore_selected.autotransferwait)) - . = TRUE - if("b_autotransferlocation") - var/obj/belly/choice = tgui_input_list(user, "Where do you want your [lowertext(host.vore_selected.name)] auto-transfer to?","Select Belly", (host.vore_organs + "None - Remove" - host.vore_selected)) - if(!choice) //They cancelled, no changes - return FALSE - else if(choice == "None - Remove") - host.vore_selected.autotransferlocation = null - else - host.vore_selected.autotransferlocation = choice.name - . = TRUE - if("b_autotransferextralocation") - var/obj/belly/choice = tgui_input_list(user, "What extra places do you want your [lowertext(host.vore_selected.name)] auto-transfer to?","Select Belly", (host.vore_organs - host.vore_selected - host.vore_selected.autotransferlocation)) - if(!choice) //They cancelled, no changes - return FALSE - else if(choice.name in host.vore_selected.autotransferextralocation) - host.vore_selected.autotransferextralocation -= choice.name - else - host.vore_selected.autotransferextralocation += choice.name - . = TRUE - if("b_autotransferchance_secondary") - var/autotransferchance_secondary_input = tgui_input_number(user, "Set secondary belly auto-transfer chance (as %). You must also set the location for this to have any effect.", "Secondary Auto-Transfer Chance") - if(!isnull(autotransferchance_secondary_input)) - host.vore_selected.autotransferchance_secondary = sanitize_integer(autotransferchance_secondary_input, 0, 100, initial(host.vore_selected.autotransferchance_secondary)) - . = TRUE - if("b_autotransferlocation_secondary") - var/obj/belly/choice = tgui_input_list(user, "Where do you want your secondary [lowertext(host.vore_selected.name)] auto-transfer to?","Select Belly", (host.vore_organs + "None - Remove" - host.vore_selected)) - if(!choice) //They cancelled, no changes - return FALSE - else if(choice == "None - Remove") - host.vore_selected.autotransferlocation_secondary = null - else - host.vore_selected.autotransferlocation_secondary = choice.name - . = TRUE - if("b_autotransferextralocation_secondary") - var/obj/belly/choice = tgui_input_list(user, "What extra places do you want your [lowertext(host.vore_selected.name)] auto-transfer to?","Select Belly", (host.vore_organs - host.vore_selected - host.vore_selected.autotransferlocation_secondary)) - if(!choice) //They cancelled, no changes - return FALSE - else if(choice.name in host.vore_selected.autotransferextralocation_secondary) - host.vore_selected.autotransferextralocation_secondary -= choice.name - else - host.vore_selected.autotransferextralocation_secondary += choice.name - . = TRUE - if("b_autotransfer_whitelist") - var/list/menu_list = host.vore_selected.autotransfer_flags_list.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Whitelist", "Whitelist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_whitelist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] - . = TRUE - if("b_autotransfer_blacklist") - var/list/menu_list = host.vore_selected.autotransfer_flags_list.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Blacklist", "Blacklist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_blacklist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] - . = TRUE - if("b_autotransfer_secondary_whitelist") - var/list/menu_list = host.vore_selected.autotransfer_flags_list.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Whitelist", "Whitelist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_secondary_whitelist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] - . = TRUE - if("b_autotransfer_secondary_blacklist") - var/list/menu_list = host.vore_selected.autotransfer_flags_list.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Blacklist", "Blacklist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_secondary_blacklist ^= host.vore_selected.autotransfer_flags_list[toggle_addon] - . = TRUE - . = TRUE - if("b_autotransfer_whitelist_items") - var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Whitelist", "Whitelist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] - . = TRUE - if("b_autotransfer_blacklist_items") - var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Blacklist", "Blacklist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] - . = TRUE - if("b_autotransfer_secondary_whitelist_items") - var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Whitelist", "Whitelist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_secondary_whitelist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] - . = TRUE - if("b_autotransfer_secondary_blacklist_items") - var/list/menu_list = host.vore_selected.autotransfer_flags_list_items.Copy() - var/toggle_addon = tgui_input_list(user, "Toggle Blacklist", "Blacklist Choice", menu_list) - if(!toggle_addon) - return FALSE - host.vore_selected.autotransfer_secondary_blacklist_items ^= host.vore_selected.autotransfer_flags_list_items[toggle_addon] - . = TRUE - if("b_autotransfer_min_amount") - var/autotransfer_min_amount_input = tgui_input_number(user, "Set the minimum amount of items your belly can belly auto-transfer at once. Set to 0 for no limit.", "Auto-Transfer Min Amount", host.vore_selected.autotransfer_min_amount, 100) - if(!isnull(autotransfer_min_amount_input)) - host.vore_selected.autotransfer_min_amount = sanitize_integer(autotransfer_min_amount_input, 0, 100, initial(host.vore_selected.autotransfer_min_amount)) - . = TRUE - if("b_autotransfer_max_amount") - var/autotransfer_max_amount_input = tgui_input_number(user, "Set the maximum amount of items your belly can belly auto-transfer at once. Set to 0 for no limit.", "Auto-Transfer Max Amount", host.vore_selected.autotransfer_max_amount, 100) - if(!isnull(autotransfer_max_amount_input)) - host.vore_selected.autotransfer_max_amount = sanitize_integer(autotransfer_max_amount_input, 0, 100, initial(host.vore_selected.autotransfer_max_amount)) - . = TRUE - if("b_autotransfer_enabled") - host.vore_selected.autotransfer_enabled = !host.vore_selected.autotransfer_enabled - . = TRUE - if("b_fullscreen") - host.vore_selected.belly_fullscreen = params["val"] - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_disable_hud") - host.vore_selected.disable_hud = !host.vore_selected.disable_hud - . = TRUE - if("b_colorization_enabled") //ALLOWS COLORIZATION. - host.vore_selected.colorization_enabled = !host.vore_selected.colorization_enabled - host.vore_selected.belly_fullscreen = "dark" //This prevents you from selecting a belly that is not meant to be colored and then turning colorization on. - . = TRUE - if("b_preview_belly") - host.vore_selected.vore_preview(host) //Gives them the stomach overlay. It fades away after ~2 seconds as human/life.dm removes the overlay if not in a gut. - . = TRUE - if("b_clear_preview") - host.vore_selected.clear_preview(host) //Clears the stomach overlay. This is a failsafe but shouldn't occur. - . = TRUE - if("b_fullscreen_color") - var/newcolor = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color) - if(newcolor) - host.vore_selected.belly_fullscreen_color = newcolor - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_fullscreen_color2") - var/newcolor2 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color2) - if(newcolor2) - host.vore_selected.belly_fullscreen_color2 = newcolor2 - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_fullscreen_color3") - var/newcolor3 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color3) - if(newcolor3) - host.vore_selected.belly_fullscreen_color3 = newcolor3 - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_fullscreen_color4") - var/newcolor4 = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.belly_fullscreen_color4) - if(newcolor4) - host.vore_selected.belly_fullscreen_color4 = newcolor4 - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_fullscreen_alpha") - var/newalpha = tgui_input_number(user, "Set alpha transparency between 0-255", "Vore Alpha",host.vore_selected.belly_fullscreen_alpha,255,0,0,1) - if(newalpha) - host.vore_selected.belly_fullscreen_alpha = newalpha - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_save_digest_mode") - host.vore_selected.save_digest_mode = !host.vore_selected.save_digest_mode - . = TRUE - if("b_del") - var/alert = tgui_alert(user, "Are you sure you want to delete your [lowertext(host.vore_selected.name)]?","Confirmation",list("Cancel","Delete")) - if(alert != "Delete") - return FALSE - - var/failure_msg = "" - - var/dest_for //Check to see if it's the destination of another vore organ. - for(var/obj/belly/B as anything in host.vore_organs) - if(B.transferlocation == host.vore_selected) - dest_for = B.name - failure_msg += "This is the destiantion for at least '[dest_for]' belly transfers. Remove it as the destination from any bellies before deleting it. " - break - if(B.transferlocation_secondary == host.vore_selected) - dest_for = B.name - failure_msg += "This is the destiantion for at least '[dest_for]' secondary belly transfers. Remove it as the destination from any bellies before deleting it. " - break - - if(host.vore_selected.contents.len) - failure_msg += "You cannot delete bellies with contents! " //These end with spaces, to be nice looking. Make sure you do the same. - if(host.vore_selected.immutable) - failure_msg += "This belly is marked as undeletable. " - if(host.vore_organs.len == 1) - failure_msg += "You must have at least one belly. " - - if(failure_msg) - tgui_alert_async(user,failure_msg,"Error!") - return FALSE - - if(host.soulgem?.linked_belly == host.vore_selected) - host.soulgem.linked_belly = null - - qdel(host.vore_selected) - host.vore_selected = host.vore_organs[1] - . = TRUE - if("b_private_struggle") - host.vore_selected.private_struggle = !host.vore_selected.private_struggle - . = TRUE - if("b_vorespawn_blacklist") - host.vore_selected.vorespawn_blacklist = !host.vore_selected.vorespawn_blacklist - . = TRUE - if("b_vorespawn_whitelist") - var/new_vorespawn_whitelist = sanitize(tgui_input_text(user,"Input ckeys allowed to vorespawn on separate lines. Cancel will clear the list.","Allowed Players",jointext(host.vore_selected.vorespawn_whitelist,"\n"), multiline = TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN,0,0,0) - if(new_vorespawn_whitelist) - host.vore_selected.vorespawn_whitelist = splittext(lowertext(new_vorespawn_whitelist),"\n") - else - host.vore_selected.vorespawn_whitelist = list() - . = TRUE - if("b_vorespawn_absorbed") - var/current_number = global_flag_check(host.vore_selected.vorespawn_absorbed, VS_FLAG_ABSORB_YES) + global_flag_check(host.vore_selected.vorespawn_absorbed, VS_FLAG_ABSORB_PREY) - switch(current_number) - if(0) - host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_YES - if(1) - host.vore_selected.vorespawn_absorbed |= VS_FLAG_ABSORB_PREY - if(2) - host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_YES) - host.vore_selected.vorespawn_absorbed &= ~(VS_FLAG_ABSORB_PREY) - unsaved_changes = TRUE - return TRUE - if("b_belly_sprite_to_affect") - var/belly_choice = tgui_input_list(user, "Which belly sprite do you want your [lowertext(host.vore_selected.name)] to affect?","Select Region", host.vore_icon_bellies) - if(!belly_choice) //They cancelled, no changes - return FALSE - else - host.vore_selected.belly_sprite_to_affect = belly_choice - host.handle_belly_update() - . = TRUE - if("b_affects_vore_sprites") - host.vore_selected.affects_vore_sprites = !host.vore_selected.affects_vore_sprites - host.handle_belly_update() - . = TRUE - if("b_count_absorbed_prey_for_sprites") - host.vore_selected.count_absorbed_prey_for_sprite = !host.vore_selected.count_absorbed_prey_for_sprite - host.handle_belly_update() - . = TRUE - if("b_absorbed_multiplier") - var/absorbed_multiplier_input = tgui_input_number(user, "Set the impact absorbed prey's size have on your vore sprite. 1 means no scaling, 0.5 means absorbed prey count half as much, 2 means absorbed prey count double. (Range from 0.1 - 3)", "Absorbed Multiplier", host.vore_selected.absorbed_multiplier, 3, 0.1, round_value=FALSE) - if(!isnull(absorbed_multiplier_input)) - host.vore_selected.absorbed_multiplier = CLAMP(absorbed_multiplier_input, 0.1, 3) - host.handle_belly_update() - . = TRUE - if("b_count_items_for_sprites") - host.vore_selected.count_items_for_sprite = !host.vore_selected.count_items_for_sprite - host.handle_belly_update() - . = TRUE - if("b_item_multiplier") - var/item_multiplier_input = tgui_input_number(user, "Set the impact items will have on your vore sprite. 1 means a belly with 8 normal-sized items will count as 1 normal sized prey-thing's worth, 0.5 means items count half as much, 2 means items count double. (Range from 0.1 - 10)", "Item Multiplier", host.vore_selected.item_multiplier, 10, 0.1, round_value=FALSE) - if(!isnull(item_multiplier_input)) - host.vore_selected.item_multiplier = CLAMP(item_multiplier_input, 0.1, 10) - host.handle_belly_update() - . = TRUE - if("b_health_impacts_size") - host.vore_selected.health_impacts_size = !host.vore_selected.health_impacts_size - host.handle_belly_update() - . = TRUE - if("b_resist_animation") - host.vore_selected.resist_triggers_animation = !host.vore_selected.resist_triggers_animation - . = TRUE - if("b_size_factor_sprites") - var/size_factor_input = tgui_input_number(user, "Set the impact all belly content's collective size has on your vore sprite. 1 means no scaling, 0.5 means content counts half as much, 2 means contents count double. (Range from 0.1 - 3)", "Size Factor", host.vore_selected.size_factor_for_sprite, 3, 0.1, round_value=FALSE) - if(!isnull(size_factor_input)) - host.vore_selected.size_factor_for_sprite = CLAMP(size_factor_input, 0.1, 3) - host.handle_belly_update() - . = TRUE - if("b_vore_sprite_flags") - var/list/menu_list = host.vore_selected.vore_sprite_flag_list.Copy() - var/toggle_vs_flag = tgui_input_list(user, "Toggle Vore Sprite Modes", "Mode Choice", menu_list) - if(!toggle_vs_flag) - return FALSE - host.vore_selected.vore_sprite_flags ^= host.vore_selected.vore_sprite_flag_list[toggle_vs_flag] - . = TRUE - if("b_count_liquid_for_sprites") - host.vore_selected.count_liquid_for_sprite = !host.vore_selected.count_liquid_for_sprite - host.handle_belly_update() - . = TRUE - if("b_liquid_multiplier") - var/liquid_multiplier_input = tgui_input_number(user, "Set the impact amount of liquid reagents will have on your vore sprite. 1 means a belly with 100 reagents of fluid will count as 1 normal sized prey-thing's worth, 0.5 means liquid counts half as much, 2 means liquid counts double. (Range from 0.1 - 10)", "Liquid Multiplier", host.vore_selected.liquid_multiplier, 10, 0.1, round_value=FALSE) - if(!isnull(liquid_multiplier_input)) - host.vore_selected.liquid_multiplier = CLAMP(liquid_multiplier_input, 0.1, 10) - host.handle_belly_update() - . = TRUE - if("b_undergarment_choice") - var/datum/category_group/underwear/undergarment_choice = tgui_input_list(user, "Which undergarment do you want to enable when your [lowertext(host.vore_selected.name)] is filled?","Select Undergarment Class", global_underwear.categories) - if(!undergarment_choice) //They cancelled, no changes - return FALSE - else - host.vore_selected.undergarment_chosen = undergarment_choice.name - host.handle_belly_update() - . = TRUE - if("b_undergarment_if_none") - var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[host.vore_selected.undergarment_chosen] - var/datum/category_item/underwear/selected_underwear = tgui_input_list(user, "If no undergarment is equipped, which undergarment style do you want to use?","Select Underwear Style",UWC.items,host.vore_selected.undergarment_if_none) - if(!selected_underwear) //They cancelled, no changes - return FALSE - else - host.vore_selected.undergarment_if_none = selected_underwear - host.handle_belly_update() - host.updateVRPanel() - if("b_undergarment_color") - var/newcolor = tgui_color_picker(user, "Choose a color.", "", host.vore_selected.undergarment_color) - if(newcolor) - host.vore_selected.undergarment_color = newcolor - host.handle_belly_update() - . = TRUE - if("b_tail_to_change_to") - var/tail_choice = tgui_input_list(user, "Which tail sprite do you want to use when your [lowertext(host.vore_selected.name)] is filled?","Select Sprite", global.tail_styles_list) - if(!tail_choice) //They cancelled, no changes - return FALSE - else - host.vore_selected.tail_to_change_to = tail_choice - . = TRUE - if("b_tail_color") - var/newcolor = tgui_color_picker(user, "Choose tail color.", "", host.vore_selected.tail_colouration) - if(newcolor) - host.vore_selected.tail_colouration = newcolor - . = TRUE - if("b_tail_color2") - var/newcolor = tgui_color_picker(user, "Choose tail secondary color.", "", host.vore_selected.tail_extra_overlay) - if(newcolor) - host.vore_selected.tail_extra_overlay = newcolor - . = TRUE - if("b_tail_color3") - var/newcolor = tgui_color_picker(user, "Choose tail tertiary color.", "", host.vore_selected.tail_extra_overlay2) - if(newcolor) - host.vore_selected.tail_extra_overlay2 = newcolor - . = TRUE - if("b_trasheater") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' AND '%item will be replaced with the item's name. '%belly' will be replaced with your belly's name. '%count' will be replaced with the number of anything in your belly. '%countprey' will be replaced with the number of living prey in your belly." - switch(params["msgtype"]) - if("in") - var/new_message = sanitize(tgui_input_text(user,"This is sent upon eating anything with the trash eater perk. Write them in 3rd person ('%pred demonstrates their voracious capabilities by swallowing %item whole!') Try to keep it brief!"+help,"Trash Eater Insert",host.vore_selected.get_messages(BELLY_TRASH_EATER_IN), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_TRASH_EATER_IN, limit = MAX_MESSAGE_LEN / 4) - . = TRUE - if("out") - var/new_message = sanitize(tgui_input_text(user,"This is sent upon expeling any item in your belly. Write them in 3rd person ('%pred expels %item from their %belly!') Try to keep it brief!"+help,"Item Expel",host.vore_selected.get_messages(BELLY_TRASH_EATER_OUT), MAX_MESSAGE_LEN * 1.5, TRUE, prevent_enter = TRUE),MAX_MESSAGE_LEN * 1.5,0,0,0) - if(new_message) - host.vore_selected.set_messages(new_message,BELLY_TRASH_EATER_OUT, limit = MAX_MESSAGE_LEN / 4) - . = TRUE - - if(.) - unsaved_changes = TRUE - -// liquid belly procs -/datum/vore_look/proc/liq_set_attr(mob/user, params) - if(!host.vore_selected) - tgui_alert(user, "No belly selected to modify.") - return FALSE - - var/attr = params["liq_attribute"] - switch(attr) - if("b_show_liq") - if(!host.vore_selected.show_liquids) - host.vore_selected.show_liquids = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid options.")) - else - host.vore_selected.show_liquids = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid options.")) - . = TRUE - if("b_liq_reagent_gen") - if(!host.vore_selected.reagentbellymode) //liquid container adjustments and interactions. - host.vore_selected.reagentbellymode = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has interactions which can produce liquids.")) - else //Doesnt produce liquids - host.vore_selected.reagentbellymode = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] wont produce liquids, liquids already in your [lowertext(host.vore_selected.name)] must be emptied out or removed with purge.")) - . = TRUE - if("b_liq_reagent_type") - var/list/menu_list = host.vore_selected.reagent_choices.Copy() //Useful if we want to make certain races, synths, borgs, and other things result in additional reagents to produce - Jack - var/new_reagent = tgui_input_list(user, "Current reagent: [host.vore_selected.reagent_chosen]", "Choose Reagent", menu_list) - if(!new_reagent) - return FALSE - - host.vore_selected.reagent_chosen = new_reagent - host.vore_selected.ReagentSwitch() // For changing variables when a new reagent is chosen - . = TRUE - if("b_liq_reagent_name") - var/new_name = html_encode(tgui_input_text(user,"New name for liquid shown when transfering and dumping on floor (The actual liquid's name is still the same):","New Name",host.vore_selected.reagent_name)) - - if(length(new_name) > BELLIES_NAME_MAX || length(new_name) < BELLIES_NAME_MIN) - tgui_alert(user, "Entered name length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") - return FALSE - - host.vore_selected.reagent_name = new_name - . = TRUE - if("b_liq_reagent_transfer_verb") - var/new_verb = html_encode(tgui_input_text(user,"New verb when liquid is transfered from this belly:","New Verb", host.vore_selected.reagent_transfer_verb)) - - if(length(new_verb) > BELLIES_NAME_MAX || length(new_verb) < BELLIES_NAME_MIN) - tgui_alert(user, "Entered verb length invalid (must be longer than [BELLIES_NAME_MIN], no longer than [BELLIES_NAME_MAX]).","Error") - return FALSE - - host.vore_selected.reagent_transfer_verb = new_verb - . = TRUE - if("b_liq_reagent_nutri_rate") - host.vore_selected.gen_time_display = tgui_input_list(user, "Choose the time it takes to fill the belly from empty state using nutrition.", "Set Liquid Production Time.",list("10 minutes","30 minutes","1 hour","3 hours","6 hours","12 hours","24 hours")) - switch(host.vore_selected.gen_time_display) - if("10 minutes") - host.vore_selected.gen_time = 0 - if("30 minutes") - host.vore_selected.gen_time = 2 - if("1 hour") - host.vore_selected.gen_time = 5 - if("3 hours") - host.vore_selected.gen_time = 17 - if("6 hours") - host.vore_selected.gen_time = 35 - if("12 hours") - host.vore_selected.gen_time = 71 - if("24 hours") - host.vore_selected.gen_time = 143 - if(null) - return FALSE - . = TRUE - if("b_liq_reagent_capacity") - var/new_custom_vol = tgui_input_number(user, "Choose the amount of liquid the belly can contain at most. Ranges from 10 to 300.", "Set Custom Belly Capacity.", host.vore_selected.custom_max_volume, 300, 10) - if(new_custom_vol == null) - return FALSE - var/new_new_custom_vol = CLAMP(new_custom_vol, 10, 300) - host.vore_selected.custom_max_volume = new_new_custom_vol - . = TRUE - if("b_liq_sloshing") - if(!host.vore_selected.vorefootsteps_sounds) - host.vore_selected.vorefootsteps_sounds = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] can now make sounds when you walk around depending on how full you are.")) - else - host.vore_selected.vorefootsteps_sounds = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] wont make any liquid sounds no matter how full it is.")) - . = TRUE - if("b_liq_reagent_addons") - var/list/menu_list = host.vore_selected.reagent_mode_flag_list.Copy() - var/reagent_toggle_addon = tgui_input_list(user, "Toggle your addons", "Toggle Addon", menu_list) - if(!reagent_toggle_addon) - return FALSE - host.vore_selected.reagent_mode_flags ^= host.vore_selected.reagent_mode_flag_list[reagent_toggle_addon] - . = TRUE - if("b_liquid_overlay") - if(!host.vore_selected.liquid_overlay) - host.vore_selected.liquid_overlay = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid overlay enabled.")) - else - host.vore_selected.liquid_overlay = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid overlay enabled.")) - . = TRUE - if("b_max_liquid_level") - var/new_max_liquid_level = tgui_input_number(user, "Set custom maximum liquid level. 0-100%", "Set Custom Max Level.", host.vore_selected.max_liquid_level, 100) - if(new_max_liquid_level == null) - return FALSE - var/new_new_max_liquid_level = CLAMP(new_max_liquid_level, 0, 100) - host.vore_selected.max_liquid_level = new_new_max_liquid_level - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_custom_reagentcolor") - var/newcolor = tgui_color_picker(user, "Choose custom color for liquid overlay. Cancel for normal reagent color.", "", host.vore_selected.custom_reagentcolor) - if(newcolor) - host.vore_selected.custom_reagentcolor = newcolor - else - host.vore_selected.custom_reagentcolor = null - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_custom_reagentalpha") - var/newalpha = tgui_input_number(user, "Set alpha transparency between 0-255. Leave blank to use capacity based alpha.", "Custom Liquid Alpha",255,255,0,0,1) - if(newalpha != null) - host.vore_selected.custom_reagentalpha = newalpha - else - host.vore_selected.custom_reagentalpha = null - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_reagent_touches") - if(!host.vore_selected.reagent_touches) - host.vore_selected.reagent_touches = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] will now apply reagents to creatures when digesting.")) - else - host.vore_selected.reagent_touches = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] will no longer apply reagents to creatures when digesting.")) - . = TRUE - if("b_mush_overlay") - if(!host.vore_selected.mush_overlay) - host.vore_selected.mush_overlay = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has fullness overlay enabled.")) - else - host.vore_selected.mush_overlay = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has fullness overlay enabled.")) - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_mush_color") - var/newcolor = tgui_color_picker(user, "Choose custom color for mush overlay.", "", host.vore_selected.mush_color) - if(newcolor) - host.vore_selected.mush_color = newcolor - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_mush_alpha") - var/newalpha = tgui_input_number(user, "Set alpha transparency between 0-255", "Mush Alpha",255,255) - if(newalpha != null) - host.vore_selected.mush_alpha = newalpha - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_max_mush") - var/new_max_mush = tgui_input_number(user, "Choose the amount of nutrition required for full mush overlay. Ranges from 0 to 6000. Default 500.", "Set Fullness Overlay Scaling.", host.vore_selected.max_mush, 6000) - if(new_max_mush == null) - return FALSE - var/new_new_max_mush = CLAMP(new_max_mush, 0, 6000) - host.vore_selected.max_mush = new_new_max_mush - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_min_mush") - var/new_min_mush = tgui_input_number(user, "Set custom minimum mush level. 0-100%", "Set Custom Minimum.", host.vore_selected.min_mush, 100) - if(new_min_mush == null) - return FALSE - var/new_new_min_mush = CLAMP(new_min_mush, 0, 100) - host.vore_selected.min_mush = new_new_min_mush - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_item_mush_val") - var/new_item_mush_val = tgui_input_number(user, "Set how much solid belly contents affect mush level. 0-1000 fullness per item.", "Set Item Mush Value.", host.vore_selected.item_mush_val, 1000) - if(new_item_mush_val == null) - return FALSE - var/new_new_item_mush_val = CLAMP(new_item_mush_val, 0, 1000) - host.vore_selected.item_mush_val = new_new_item_mush_val - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_metabolism_overlay") - if(!host.vore_selected.metabolism_overlay) - host.vore_selected.metabolism_overlay = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has ingested metabolism overlay enabled.")) - else - host.vore_selected.metabolism_overlay = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has ingested metabolism overlay enabled.")) - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_metabolism_mush_ratio") - var/new_metabolism_mush_ratio = tgui_input_number(user, "How much should ingested reagents affect fullness overlay compared to nutrition? Nutrition units per reagent unit. Default 15.", "Set Metabolism Mush Ratio.", host.vore_selected.metabolism_mush_ratio, 500) - if(new_metabolism_mush_ratio == null) - return FALSE - var/new_new_metabolism_mush_ratio = CLAMP(new_metabolism_mush_ratio, 0, 500) - host.vore_selected.metabolism_mush_ratio = new_new_metabolism_mush_ratio - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_max_ingested") - var/new_max_ingested = tgui_input_number(user, "Choose the amount of reagents within ingested metabolism required for full mush overlay when not using mush overlay option. Ranges from 0 to 6000. Default 500.", "Set Metabolism Overlay Scaling.", host.vore_selected.max_ingested, 6000) - if(new_max_ingested == null) - return FALSE - var/new_new_max_ingested = CLAMP(new_max_ingested, 0, 6000) - host.vore_selected.max_ingested = new_new_max_ingested - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_custom_ingested_color") - var/newcolor = tgui_color_picker(user, "Choose custom color for ingested metabolism overlay. Cancel for reagent-based dynamic blend.", "", host.vore_selected.custom_ingested_color) - if(newcolor) - host.vore_selected.custom_ingested_color = newcolor - else - host.vore_selected.custom_ingested_color = null - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_custom_ingested_alpha") - var/newalpha = tgui_input_number(user, "Set alpha transparency between 0-255 when not using mush overlay option.", "Custom Ingested Alpha",255,255) - if(newalpha != null) - host.vore_selected.custom_ingested_alpha = newalpha - host.vore_selected.update_internal_overlay() - . = TRUE - if("b_liq_purge") - var/alert = tgui_alert(user, "Are you sure you want to delete the liquids in your [lowertext(host.vore_selected.name)]?","Confirmation",list("Delete","Cancel")) - if(alert != "Delete") - return FALSE - else - host.vore_selected.reagents.clear_reagents() - . = TRUE - if(.) - unsaved_changes = TRUE - -/datum/vore_look/proc/liq_set_msg(mob/user, params) - if(!host.vore_selected) - tgui_alert(user, "No belly selected to modify.") - return FALSE - - var/attr = params["liq_messages"] - switch(attr) - if("b_show_liq_fullness") - if(!host.vore_selected.show_fullness_messages) - host.vore_selected.show_fullness_messages = 1 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] now has liquid examination options.")) - else - host.vore_selected.show_fullness_messages = 0 - to_chat(user,span_warning("Your [lowertext(host.vore_selected.name)] no longer has liquid examination options.")) - . = TRUE - if("b_liq_msg_toggle1") - host.vore_selected.liquid_fullness1_messages = !host.vore_selected.liquid_fullness1_messages - . = TRUE - if("b_liq_msg_toggle2") - host.vore_selected.liquid_fullness2_messages = !host.vore_selected.liquid_fullness2_messages - . = TRUE - if("b_liq_msg_toggle3") - host.vore_selected.liquid_fullness3_messages = !host.vore_selected.liquid_fullness3_messages - . = TRUE - if("b_liq_msg_toggle4") - host.vore_selected.liquid_fullness4_messages = !host.vore_selected.liquid_fullness4_messages - . = TRUE - if("b_liq_msg_toggle5") - host.vore_selected.liquid_fullness5_messages = !host.vore_selected.liquid_fullness5_messages - . = TRUE - if("b_liq_msg1") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." - - var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 0 to 20% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (0 - 20%)",host.vore_selected.get_reagent_messages("full1")) - if(new_message) - host.vore_selected.set_reagent_messages(new_message,"full1") - . = TRUE - if("b_liq_msg2") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." - - var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 20 to 40% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (20 - 40%)",host.vore_selected.get_reagent_messages("full2")) - if(new_message) - host.vore_selected.set_reagent_messages(new_message,"full2") - . = TRUE - if("b_liq_msg3") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." - - var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 40 to 60% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (40 - 60%)",host.vore_selected.get_reagent_messages("full3")) - if(new_message) - host.vore_selected.set_reagent_messages(new_message,"full3") - . = TRUE - if("b_liq_msg4") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." - - var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 60 to 80% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (60 - 80%)",host.vore_selected.get_reagent_messages("full4")) - if(new_message) - host.vore_selected.set_reagent_messages(new_message,"full4") - . = TRUE - if("b_liq_msg5") - tgui_alert(user,"Setting abusive or deceptive messages will result in a ban. Consider this your warning. Max 150 characters per message, max 10 messages per topic.","Really, don't.") - var/help = " Press enter twice to separate messages. '%pred' will be replaced with your name. '%prey' will be replaced with the prey's name. '%belly' will be replaced with your belly's name." - - var/new_message = tgui_input_text(user,"These are sent to people who examine you when this belly is 80 to 100% full. Write them in 3rd person ('Their %belly is bulging')."+help,"Liquid Examine Message (80 - 100%)",host.vore_selected.get_reagent_messages("full5")) - if(new_message) - host.vore_selected.set_reagent_messages(new_message,"full5") - . = TRUE - if(.) - unsaved_changes = TRUE - -#undef VORE_RESIZE_COST #undef STATION_PREF_NAME +#undef VORE_BELLY_TAB +#undef SOULCATCHER_TAB +#undef PREFERENCE_TAB +#undef GENERAL_TAB diff --git a/code/modules/vore/mob_tf.dm b/code/modules/vore/mob_tf.dm index df75aa5f33..f5a127d312 100644 --- a/code/modules/vore/mob_tf.dm +++ b/code/modules/vore/mob_tf.dm @@ -154,7 +154,6 @@ new_mob.ooc_notes_dislikes = ooc_notes_dislikes new_mob.appendage_color = appendage_color new_mob.appendage_alt_setting = appendage_alt_setting - new_mob.text_warnings = text_warnings VORE_PREF_TRANSFER(new_mob, src) diff --git a/tgui/packages/tgui-bench/package.json b/tgui/packages/tgui-bench/package.json index 4bdca3c44f..674ba315bb 100644 --- a/tgui/packages/tgui-bench/package.json +++ b/tgui/packages/tgui-bench/package.json @@ -11,7 +11,7 @@ "react": "^19.1.0", "react-dom": "^19.1.0", "tgui": "workspace:*", - "tgui-core": "^3.2.0" + "tgui-core": "^4.0.1" }, "devDependencies": { "@types/react": "^19.1.0", diff --git a/tgui/packages/tgui-panel/package.json b/tgui/packages/tgui-panel/package.json index 7850f7e804..15b171b3d7 100644 --- a/tgui/packages/tgui-panel/package.json +++ b/tgui/packages/tgui-panel/package.json @@ -8,7 +8,7 @@ "react": "^19.1.0", "react-dom": "^19.1.0", "tgui": "workspace:*", - "tgui-core": "^3.2.0", + "tgui-core": "^4.0.1", "tgui-dev-server": "workspace:*" }, "devDependencies": { diff --git a/tgui/packages/tgui-say/package.json b/tgui/packages/tgui-say/package.json index 6c3167db63..bb1cb416e4 100644 --- a/tgui/packages/tgui-say/package.json +++ b/tgui/packages/tgui-say/package.json @@ -7,7 +7,7 @@ "react": "^19.1.0", "react-dom": "^19.1.0", "tgui": "workspace:*", - "tgui-core": "^3.2.0" + "tgui-core": "^4.0.1" }, "devDependencies": { "@types/react": "^19.1.0", diff --git a/tgui/packages/tgui/interfaces/AlertModal.tsx b/tgui/packages/tgui/interfaces/AlertModal.tsx index dc7f549a7c..ef1b7c7dff 100644 --- a/tgui/packages/tgui/interfaces/AlertModal.tsx +++ b/tgui/packages/tgui/interfaces/AlertModal.tsx @@ -102,7 +102,7 @@ export function AlertModal(props) {
- + {message} diff --git a/tgui/packages/tgui/interfaces/AlgaeFarm.tsx b/tgui/packages/tgui/interfaces/AlgaeFarm.tsx index 153600f813..7fe1626bda 100644 --- a/tgui/packages/tgui/interfaces/AlgaeFarm.tsx +++ b/tgui/packages/tgui/interfaces/AlgaeFarm.tsx @@ -52,7 +52,7 @@ export const AlgaeFarm = (props) => { {errorText && ( - + {errorText} diff --git a/tgui/packages/tgui/interfaces/BotanyEditor.tsx b/tgui/packages/tgui/interfaces/BotanyEditor.tsx index dc9273e712..dd0783f25b 100644 --- a/tgui/packages/tgui/interfaces/BotanyEditor.tsx +++ b/tgui/packages/tgui/interfaces/BotanyEditor.tsx @@ -50,7 +50,7 @@ export const BotanyEditor = (props) => { Eject Loaded Disk - )) || No disk loaded.} + )) || No disk loaded.}
{(loaded && ( @@ -65,7 +65,7 @@ export const BotanyEditor = (props) => { Eject Target - )) || No target seed packet loaded.} + )) || No target seed packet loaded.}
diff --git a/tgui/packages/tgui/interfaces/BotanyIsolator.tsx b/tgui/packages/tgui/interfaces/BotanyIsolator.tsx index c70522d76c..ec0bb40233 100644 --- a/tgui/packages/tgui/interfaces/BotanyIsolator.tsx +++ b/tgui/packages/tgui/interfaces/BotanyIsolator.tsx @@ -77,24 +77,16 @@ export const BotanyIsolator = (props) => { Clear Genetic Buffer - )) || ( - - No disk inserted. - - )} + )) || No disk inserted.} )) || ( - No Data Buffered. + No Data Buffered. {(disk && ( - )) || ( - - No disk inserted. - - )} + )) || No disk inserted.} )} @@ -113,7 +105,7 @@ export const BotanyIsolator = (props) => { Eject Packet - )) || No packet loaded.} + )) || No packet loaded.} diff --git a/tgui/packages/tgui/interfaces/LateChoices.tsx b/tgui/packages/tgui/interfaces/LateChoices.tsx index 10a4ba8e73..1a799d1916 100644 --- a/tgui/packages/tgui/interfaces/LateChoices.tsx +++ b/tgui/packages/tgui/interfaces/LateChoices.tsx @@ -125,7 +125,7 @@ const Evacuation = (props: { evac: Evac }) => { return null; case Evac.CrewTransfer: return ( - + The vessel is currently undergoing crew transfer procedures. ); diff --git a/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx b/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx index d85086b176..4771d6af05 100644 --- a/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx +++ b/tgui/packages/tgui/interfaces/ModifyRobot/ModifyRobotNoModule.tsx @@ -17,7 +17,7 @@ export const ModifyRobotNoModule = (props: { target: Target }) => { return ( <> - + Target has no active module. Limited options available. diff --git a/tgui/packages/tgui/interfaces/ModifyRobot/components.tsx b/tgui/packages/tgui/interfaces/ModifyRobot/components.tsx index 6fcdbc38d4..f6cebeb3d9 100644 --- a/tgui/packages/tgui/interfaces/ModifyRobot/components.tsx +++ b/tgui/packages/tgui/interfaces/ModifyRobot/components.tsx @@ -4,7 +4,7 @@ export const NoSpriteWarning = (props: { name: string }) => { const { name } = props; return ( - + Warning, {name} has not yet chosen a sprite. Functionality might be limited. diff --git a/tgui/packages/tgui/interfaces/PathogenicIsolator.tsx b/tgui/packages/tgui/interfaces/PathogenicIsolator.tsx index 5bb64c9741..acd1ddab35 100644 --- a/tgui/packages/tgui/interfaces/PathogenicIsolator.tsx +++ b/tgui/packages/tgui/interfaces/PathogenicIsolator.tsx @@ -127,7 +127,7 @@ export const PathogenicIsolator = (props) => { {(isolating && ( - The Isolator is currently isolating... + The Isolator is currently isolating... )) || ''} diff --git a/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WIkiDonationbanner.tsx b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WIkiDonationbanner.tsx index cbeb236f91..58b6ddf9ae 100644 --- a/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WIkiDonationbanner.tsx +++ b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WIkiDonationbanner.tsx @@ -46,7 +46,7 @@ export function WikiDonationBanner(props: { if (progress < 0.66) { return ( - + { {!!errorText && ( - + {errorText} diff --git a/tgui/packages/tgui/interfaces/TelecommsLogBrowser.tsx b/tgui/packages/tgui/interfaces/TelecommsLogBrowser.tsx index d485b7208e..b03de83ec2 100644 --- a/tgui/packages/tgui/interfaces/TelecommsLogBrowser.tsx +++ b/tgui/packages/tgui/interfaces/TelecommsLogBrowser.tsx @@ -62,7 +62,7 @@ export const TelecommsLogBrowser = (props) => { )) || (temp && temp.color !== 'bad' && ( - + {temp.text} diff --git a/tgui/packages/tgui/interfaces/TelecommsMachineBrowser.tsx b/tgui/packages/tgui/interfaces/TelecommsMachineBrowser.tsx index c5c8784d22..40f7956734 100644 --- a/tgui/packages/tgui/interfaces/TelecommsMachineBrowser.tsx +++ b/tgui/packages/tgui/interfaces/TelecommsMachineBrowser.tsx @@ -50,7 +50,7 @@ export const TelecommsMachineBrowser = (props) => { )) || (temp && temp.color !== 'bad' && ( - + {temp.text} diff --git a/tgui/packages/tgui/interfaces/VorePanel/FeatureColorInput.tsx b/tgui/packages/tgui/interfaces/VorePanel/FeatureColorInput.tsx deleted file mode 100644 index 0a70211431..0000000000 --- a/tgui/packages/tgui/interfaces/VorePanel/FeatureColorInput.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { useBackend } from 'tgui/backend'; -import { Box, Button, Stack } from 'tgui-core/components'; -import type { BooleanLike } from 'tgui-core/react'; - -export const FeatureColorInput = (props: { - action_name: string; - value_of: BooleanLike | string; - back_color: string; - name_of: string; -}) => { - const { act } = useBackend(); - const { action_name, value_of, back_color, name_of } = props; - return ( - <> - - - - - - - - ); -}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/LiquidColorInput.tsx b/tgui/packages/tgui/interfaces/VorePanel/LiquidColorInput.tsx deleted file mode 100644 index 45be4fa947..0000000000 --- a/tgui/packages/tgui/interfaces/VorePanel/LiquidColorInput.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import { useBackend } from 'tgui/backend'; -import { Box, Button, Stack } from 'tgui-core/components'; -import type { BooleanLike } from 'tgui-core/react'; - -export const LiquidColorInput = (props: { - action_name: string; - value_of: BooleanLike | string; - back_color: string; - name_of: string; -}) => { - const { act } = useBackend(); - const { action_name, value_of, back_color, name_of } = props; - return ( - - ); -}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VoreAbilities.tsx b/tgui/packages/tgui/interfaces/VorePanel/VoreAbilities.tsx deleted file mode 100644 index 6b122b9665..0000000000 --- a/tgui/packages/tgui/interfaces/VorePanel/VoreAbilities.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import { useBackend } from 'tgui/backend'; -import { LabeledList, Section, Slider, Stack } from 'tgui-core/components'; -import { toFixed } from 'tgui-core/math'; - -import type { abilities } from './types'; - -export const VoreAbilities = (props: { abilities: abilities }) => { - const { act } = useBackend(); - - const { abilities } = props; - - const { nutrition, current_size, minimum_size, maximum_size, resize_cost } = - abilities; - - function is_enabled(nutri: number, cost: number): boolean { - return nutri >= cost; - } - - return ( -
- - - - - toFixed(value, 2) + '%'} - value={current_size * 100} - minValue={minimum_size * 100} - maxValue={maximum_size * 100} - onChange={(e, value: number) => - act('adjust_own_size', { - new_mob_size: value / 100, - }) - } - /> - -   Cost:  - {resize_cost} - - - -
- ); -}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VoreContentsPanel.tsx b/tgui/packages/tgui/interfaces/VorePanel/VoreContentsPanel.tsx deleted file mode 100644 index ff2c4032ab..0000000000 --- a/tgui/packages/tgui/interfaces/VorePanel/VoreContentsPanel.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import { useBackend } from 'tgui/backend'; -import { Button, Image, LabeledList, Stack } from 'tgui-core/components'; -import type { BooleanLike } from 'tgui-core/react'; - -import { stats } from './constants'; -import type { contentData } from './types'; - -export const VoreContentsPanel = (props: { - contents: contentData[]; - belly?: string; - outside?: BooleanLike; - show_pictures: BooleanLike; - icon_overflow: BooleanLike; -}) => { - const { act } = useBackend(); - - const { - contents, - belly, - outside = false, - show_pictures, - icon_overflow, - } = props; - - return ( - <> - {outside ? ( - - ) : ( - '' - )} - {(show_pictures && !icon_overflow && ( - - {contents.map((thing) => ( - - - {thing.name} - - ))} - - )) || ( - - {contents.map((thing, i) => ( - - - - ))} - - )} - - ); -}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelCommonElements.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelCommonElements.tsx new file mode 100644 index 0000000000..f9ab4f9e8d --- /dev/null +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelCommonElements.tsx @@ -0,0 +1,49 @@ +import { Box, Button } from 'tgui-core/components'; + +export const VorePanelColorBox = (props: { + back_color: string; + pixelSize?: number; + alpha?: number; +}) => { + const { back_color, pixelSize = 20, alpha = 255 } = props; + + const parentSize = pixelSize + 'px'; + const childSize = pixelSize - 4 + 'px'; + + return ( + + + + ); +}; + +export const VorePanelEditToggle = (props: { + editMode: boolean; + toggleEditMode: React.Dispatch>; +}) => { + const { editMode, toggleEditMode } = props; + + return ( + + ) : ( + + {content ? content : active ? 'Enabled' : 'Disabled'} + + ); +}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditText.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditText.tsx new file mode 100644 index 0000000000..7f3f577a55 --- /dev/null +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditText.tsx @@ -0,0 +1,72 @@ +import type { ComponentProps } from 'react'; +import { useBackend } from 'tgui/backend'; +import { + Box, + type Floating, + Input, + Stack, + Tooltip, +} from 'tgui-core/components'; + +export const VorePanelEditText = (props: { + /** Switch between Element editing and display */ + editMode: boolean; + /** Our backend action on text area blur */ + action: string; + /** Our secondary backend action on text area blur */ + subAction?: string; + /** The maximum length of each message */ + limit: number; + /** Minimum required text to trigger an change action to byond */ + min?: number; + /** The current displayed message */ + entry: string; + /** The color of the displayed text */ + color?: string; + /** Our displayed tooltip displayed the text */ + tooltip?: string; + /** The position of the tooltip if static */ + tooltipPosition?: ComponentProps['placement']; +}) => { + const { act } = useBackend(); + + const { + entry, + min, + editMode, + limit, + action, + subAction = '', + color, + tooltip, + tooltipPosition, + } = props; + + function doAct(value: string) { + if (entry === value) return; + if (min && value.length < min) return; + act(action, { attribute: subAction, val: value }); + } + + return editMode ? ( + + + doAct(value)} + /> + + {tooltip && ( + + + ? + + + )} + + ) : ( + {entry} + ); +}; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelTextArea.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelTextArea.tsx new file mode 100644 index 0000000000..fc6ec7b93c --- /dev/null +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelTextArea.tsx @@ -0,0 +1,247 @@ +import { type ReactNode, useEffect, useRef, useState } from 'react'; +import { useBackend } from 'tgui/backend'; +import { + Box, + Divider, + Floating, + Icon, + Stack, + TextArea, +} from 'tgui-core/components'; + +import { SYNTAX_COLOR, SYNTAX_REGEX } from '../constants'; +import { calcLineHeight } from '../functions'; + +const DescriptionSyntaxHighlighting = (props: { desc: string }) => { + const { desc } = props; + const [htmlDesc, setHtmlDesc] = useState([]); + + useEffect(() => { + if (!desc || desc.length === 0) { + setHtmlDesc([]); + return; + } + + const elements: ReactNode[] = []; + + const regexCopy = new RegExp(SYNTAX_REGEX); + + let lastIndex = 0; + let result; + while ((result = regexCopy.exec(desc)) !== null) { + elements.push(<>{desc.substring(lastIndex, result.index)}); + elements.push( + + {result[0]} + , + ); + lastIndex = result.index + result[0].length; + } + + elements.push(<>{desc.substring(lastIndex)}); + + setHtmlDesc(elements); + }, [desc]); + + return {htmlDesc}; +}; + +const CountedTextElement = (props: { + limit: number; + entry: string; + action: Function; + index?: number; +}) => { + const { entry, limit, action, index } = props; + + const ref = useRef(null); + + const currentCount = ref.current?.value.length || 0; + return ( + <> + +