diff --git a/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm index 0408e115abf..712d50eafc7 100644 --- a/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm +++ b/code/modules/vore/eating/panel_databackend/vorepanel_vore_subdata.dm @@ -686,7 +686,14 @@ return autotransfer_data /datum/vore_look/proc/compile_liquid_interact_data(obj/belly/selected) - var/list/liq_interacts = list() + var/list/liquid_composition = list() + for(var/datum/reagent/reagent in selected.reagents.reagent_list) + UNTYPED_LIST_ADD(liquid_composition, list("name" = reagent.name, "volume" = reagent.volume)) + + var/list/liq_interacts = list( + "current_reagents" = liquid_composition, + "total_volume" = selected.reagents.total_volume + ) if(selected.show_liquids) var/list/liquid_addon_list = list() for(var/flag_name in selected.reagent_mode_flag_list) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 224b7cb7036..8fbbd619f8b 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -115,6 +115,8 @@ "%hot" = GLOB.vore_words_hot, "%snake" = GLOB.vore_words_snake, ) + data["min_belly_name"] = BELLIES_NAME_MIN + data["max_belly_name"] = BELLIES_NAME_MAX return data @@ -245,7 +247,7 @@ if(host.vore_organs.len >= BELLIES_MAX) return FALSE - var/new_name = html_encode(tgui_input_text(ui.user,"New belly's name:","New Belly")) + var/new_name = sanitize(params["val"], BELLIES_NAME_MAX, FALSE, TRUE, FALSE) if(!new_name) return FALSE diff --git a/tgui/packages/tgui-bench/package.json b/tgui/packages/tgui-bench/package.json index 172befcaeeb..9bce3a31533 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": "^4.0.3" + "tgui-core": "^4.3.1" }, "devDependencies": { "@types/react": "^19.1.0", diff --git a/tgui/packages/tgui-panel/package.json b/tgui/packages/tgui-panel/package.json index 55e41a34e6a..afbe1ad2603 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": "^4.0.3", + "tgui-core": "^4.3.1", "tgui-dev-server": "workspace:*" }, "devDependencies": { diff --git a/tgui/packages/tgui-say/package.json b/tgui/packages/tgui-say/package.json index ac308cbba5a..020f7e27fc9 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": "^4.0.3" + "tgui-core": "^4.3.1" }, "devDependencies": { "@types/react": "^19.1.0", diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditColor.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditColor.tsx index 4b10510f53b..6a0eabb9754 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditColor.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditColor.tsx @@ -9,15 +9,15 @@ import { VorePanelEditNumber } from './VorePanelEditNumber'; export const VorePanelEditColor = (props: { /** Switch between Element editing and display */ editMode: boolean; - /** Our backend action on text area blur */ + /** Our backend action on click */ action: string; - /** Our secondary backend action on text area blur */ + /** Our secondary backend action on click */ subAction?: string; /** Our color value sent to byond */ value_of: BooleanLike | string; /** The displayed color of the color box */ back_color: string; - /** A number representing the alpha value for alpha inouts */ + /** A number representing the alpha value for alpha inputs */ alpha?: number; /** Optional label to show before the color box */ name_of?: string; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditDropdown.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditDropdown.tsx index 1d78dda1cef..3445521cfed 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditDropdown.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditDropdown.tsx @@ -14,11 +14,11 @@ import type { DropdownEntry } from '../types'; export const VorePanelEditDropdown = (props: { /** Switch between Element editing and display */ editMode: boolean; - /** Our backend action on text area blur */ + /** Our backend action on selection */ action: string; - /** Our secondary backend action on text area blur */ + /** Our secondary backend action on selection */ subAction?: string; - /** Our dropdown inouts and actions */ + /** Our dropdown inputs and actions */ options: (string | DropdownEntry)[]; /** The currently shown selection */ entry: string; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditNumber.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditNumber.tsx index f07bc61d3f7..4fdfb2a7287 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditNumber.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditNumber.tsx @@ -12,9 +12,9 @@ import { round, toFixed } from 'tgui-core/math'; export const VorePanelEditNumber = (props: { /** Switch between Element editing and display */ editMode: boolean; - /** Our backend action on text area blur */ + /** Our backend action on number change */ action: string; - /** Our secondary backend action on text area blur */ + /** Our secondary backend action on number change */ subAction?: string; /** The current displayed number */ value: number; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditSwitch.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditSwitch.tsx index 54de874ef61..bbdcf98fb7f 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditSwitch.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelElements/VorePanelEditSwitch.tsx @@ -5,9 +5,9 @@ import { Box, Button, type Floating } from 'tgui-core/components'; export const VorePanelEditSwitch = (props: { /** Switch between Element editing and display */ editMode: boolean; - /** Our backend action on text area blur */ + /** Our backend action on click*/ action: string; - /** Our secondary backend action on text area blur */ + /** Our secondary backend action on click */ subAction?: string; /** Is the button currently active / selected */ active?: boolean; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreBellySelectionAndCustomization.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreBellySelectionAndCustomization.tsx index 7f460e637a5..37539ce6dc9 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreBellySelectionAndCustomization.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreBellySelectionAndCustomization.tsx @@ -29,6 +29,8 @@ export const VoreBellySelectionAndCustomization = (props: { toggleEditMode: React.Dispatch>; editMode: boolean; persist_edit_mode: BooleanLike; + minBellyName: number; + maxBellyName: number; }) => { const { act } = useBackend(); @@ -43,9 +45,13 @@ export const VoreBellySelectionAndCustomization = (props: { toggleEditMode, editMode, persist_edit_mode, + minBellyName, + maxBellyName, } = props; const [showSearch, setShowSearch] = useState(false); + const [createNewBelly, setCreateNewBelly] = useState(false); + const [currentNewName, setCurrentNewName] = useState(''); const [searchedBellies, setSearchedBellies] = useState(''); const bellySearch = createSearch( @@ -59,6 +65,16 @@ export const VoreBellySelectionAndCustomization = (props: { return { displayText: belly.name, value: belly.ref }; }); + function applyNewBelly(newName: string) { + act('newbelly', { val: newName }); + clearBellyNameInput(); + } + + function clearBellyNameInput() { + setCreateNewBelly(false); + setCurrentNewName(''); + } + return ( @@ -75,9 +91,29 @@ export const VoreBellySelectionAndCustomization = (props: { } > - act('newbelly')}> - New - + setCreateNewBelly(true)}> + {createNewBelly ? ( + { + applyNewBelly(value); + }} + onChange={(value) => setCurrentNewName(value)} + onEscape={() => clearBellyNameInput()} + onBlur={() => clearBellyNameInput()} + /> + ) : ( + <> + New + + + )} act('exportpanel')}> Export diff --git a/tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreSelectedBellyLiquidOptions.tsx b/tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreSelectedBellyLiquidOptions.tsx index 195ae6ebf6d..ed1d3b80449 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreSelectedBellyLiquidOptions.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VoreSelectedBellyTabs/VoreSelectedBellyLiquidOptions.tsx @@ -1,7 +1,7 @@ import { useBackend } from 'tgui/backend'; -import { Button, LabeledList, Section, Stack } from 'tgui-core/components'; +import { Box, Button, LabeledList, Section, Stack } from 'tgui-core/components'; -import { liquidToTooltip } from '../constants'; +import { liquidToTooltip, reagentToColor } from '../constants'; import type { bellyLiquidData } from '../types'; import { VorePanelEditCheckboxes } from '../VorePanelElements/VorePanelEditCheckboxes'; import { VorePanelEditSwitch } from '../VorePanelElements/VorePanelEditSwitch'; @@ -18,71 +18,94 @@ export const VoreSelectedBellyLiquidOptions = (props: { const { show_liq, liq_interacts } = bellyLiquidData; return ( -
- - - act('liq_set_attribute', { liq_attribute: 'b_liq_purge' }) - } - > - Purge Liquids - - - - - - - } - > - {!!show_liq && ( - - - - - - - - - - - - + + +
+ + + act('liq_set_attribute', { attribute: 'b_liq_purge' }) + } + > + Purge Liquids + - - + - - - )} -
+ } + > + {!!show_liq && ( + + + + + + + + + + + + + + + + + + + + )} +
+
+ +
+ + {liq_interacts.current_reagents + .sort((a, b) => a.volume - b.volume) + .map((reagent) => ( + + + {reagent.volume} u + + + ))} + {!!liq_interacts.current_reagents.length && } + + {liq_interacts.total_volume} u + + +
+
+
); }; diff --git a/tgui/packages/tgui/interfaces/VorePanel/VoreUserPreferencesTabs/VoreUserPreferencesMechanical.tsx b/tgui/packages/tgui/interfaces/VorePanel/VoreUserPreferencesTabs/VoreUserPreferencesMechanical.tsx index 01538581ae7..27905e89212 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VoreUserPreferencesTabs/VoreUserPreferencesMechanical.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VoreUserPreferencesTabs/VoreUserPreferencesMechanical.tsx @@ -109,7 +109,7 @@ export const VoreUserPreferencesMechanical = (props: { tooltipPosition="left" /> - + - + { unsaved_changes, vore_words, general_pref_data, + min_belly_name, + max_belly_name, } = data; const [editMode, setEditMode] = useState(!!persist_edit_mode); @@ -187,6 +189,8 @@ export const VorePanel = () => { toggleEditMode={setEditMode} editMode={editMode} persist_edit_mode={persist_edit_mode} + minBellyName={min_belly_name} + maxBellyName={max_belly_name} /> ); tabs[1] = our_bellies && soulcatcher && abilities && ( diff --git a/tgui/packages/tgui/interfaces/VorePanel/types.ts b/tgui/packages/tgui/interfaces/VorePanel/types.ts index ec0c820fc51..5544770d575 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/types.ts +++ b/tgui/packages/tgui/interfaces/VorePanel/types.ts @@ -10,6 +10,8 @@ export type Data = { persist_edit_mode: BooleanLike; host_mobtype: hostMob | null; our_bellies?: bellyData[] | null; + min_belly_name: number; + max_belly_name: number; selected?: selectedData | null; prefs?: prefData | null; soulcatcher?: soulcatcherData | null; @@ -251,6 +253,8 @@ export type autoTransferOption = { autotransfer_blacklist_items: checkBoxEntry[]; }; +type bellyReagent = { name: string; volume: number }; + export type liqInteractData = { liq_reagent_gen: BooleanLike; liq_reagent_type: string; @@ -279,6 +283,8 @@ export type liqInteractData = { max_ingested: number; custom_ingested_color: string; custom_ingested_alpha: number; + total_volume: number; + current_reagents: bellyReagent[]; }; export type prefData = { diff --git a/tgui/packages/tgui/package.json b/tgui/packages/tgui/package.json index 30447e4e417..a9c061be71a 100644 --- a/tgui/packages/tgui/package.json +++ b/tgui/packages/tgui/package.json @@ -12,7 +12,7 @@ "marked": "^4.3.0", "react": "^19.1.0", "react-dom": "^19.1.0", - "tgui-core": "^4.0.3", + "tgui-core": "^4.3.1", "tgui-dev-server": "workspace:*" }, "devDependencies": { diff --git a/tgui/yarn.lock b/tgui/yarn.lock index 992faa3c054..72808be218f 100644 --- a/tgui/yarn.lock +++ b/tgui/yarn.lock @@ -413,6 +413,32 @@ __metadata: languageName: node linkType: hard +"@floating-ui/react-dom@npm:^2.1.3": + version: 2.1.3 + resolution: "@floating-ui/react-dom@npm:2.1.3" + dependencies: + "@floating-ui/dom": "npm:^1.0.0" + peerDependencies: + react: ">=16.8.0" + react-dom: ">=16.8.0" + checksum: 10c0/e88750ea2fb352264d52d502d3979f94155ce2c8ab9a50862810d0cfc8c8e49cb6bbde466d668736cb38624d089360ef97451397b647408a0eb2c1870234c19a + languageName: node + linkType: hard + +"@floating-ui/react@npm:^0.27.12": + version: 0.27.12 + resolution: "@floating-ui/react@npm:0.27.12" + dependencies: + "@floating-ui/react-dom": "npm:^2.1.3" + "@floating-ui/utils": "npm:^0.2.9" + tabbable: "npm:^6.0.0" + peerDependencies: + react: ">=17.0.0" + react-dom: ">=17.0.0" + checksum: 10c0/da453965074bd4ded8e3de97ceb2c0833df8df2ecd9eff5ae4d336413443ea5abde5c9e37b092956901b97e7b47f9138d51d4896fa82da68e77eb0090289bf64 + languageName: node + linkType: hard + "@floating-ui/react@npm:^0.27.5": version: 0.27.7 resolution: "@floating-ui/react@npm:0.27.7" @@ -427,20 +453,6 @@ __metadata: languageName: node linkType: hard -"@floating-ui/react@npm:^0.27.8": - version: 0.27.8 - resolution: "@floating-ui/react@npm:0.27.8" - dependencies: - "@floating-ui/react-dom": "npm:^2.1.2" - "@floating-ui/utils": "npm:^0.2.9" - tabbable: "npm:^6.0.0" - peerDependencies: - react: ">=17.0.0" - react-dom: ">=17.0.0" - checksum: 10c0/901317ca85ed0b80231edc1ded1f67e685cd736ed52949b3b7ce2fa4bb52635a5676b035996e6d98f675f60891869b312beb1a2572001758d0ee2cce0efb1a77 - languageName: node - linkType: hard - "@floating-ui/utils@npm:^0.2.9": version: 0.2.9 resolution: "@floating-ui/utils@npm:0.2.9" @@ -7911,20 +7923,20 @@ __metadata: react: "npm:^19.1.0" react-dom: "npm:^19.1.0" tgui: "workspace:*" - tgui-core: "npm:^4.0.3" + tgui-core: "npm:^4.3.1" languageName: unknown linkType: soft -"tgui-core@npm:^4.0.3": - version: 4.0.3 - resolution: "tgui-core@npm:4.0.3" +"tgui-core@npm:^4.3.1": + version: 4.3.1 + resolution: "tgui-core@npm:4.3.1" dependencies: - "@floating-ui/react": "npm:^0.27.8" + "@floating-ui/react": "npm:^0.27.12" "@nozbe/microfuzz": "npm:^1.0.0" peerDependencies: react: ^19.1.0 react-dom: ^19.1.0 - checksum: 10c0/01b5a4144931bf89113b0c263db86020fbf46398eb4c982a26781a9565f41fb204e07dd9c57e9bd2f4bd6ada9029d9618560dab47b3ecfaf91ecb76295a9248f + checksum: 10c0/c5eff791c5a9580e349f65c884e24c42b091459b6eefd3707a51862d0b54969c9ac1cecfd556bbab4566dfd6ad3b1e43d2951e2114922b0668f639c6322cb087 languageName: node linkType: hard @@ -7952,7 +7964,7 @@ __metadata: react: "npm:^19.1.0" react-dom: "npm:^19.1.0" tgui: "workspace:*" - tgui-core: "npm:^4.0.3" + tgui-core: "npm:^4.3.1" tgui-dev-server: "workspace:*" languageName: unknown linkType: soft @@ -7967,7 +7979,7 @@ __metadata: react: "npm:^19.1.0" react-dom: "npm:^19.1.0" tgui: "workspace:*" - tgui-core: "npm:^4.0.3" + tgui-core: "npm:^4.3.1" vitest: "npm:^3.1.1" languageName: unknown linkType: soft @@ -8026,7 +8038,7 @@ __metadata: marked: "npm:^4.3.0" react: "npm:^19.1.0" react-dom: "npm:^19.1.0" - tgui-core: "npm:^4.0.3" + tgui-core: "npm:^4.3.1" tgui-dev-server: "workspace:*" vitest: "npm:^3.1.1" languageName: unknown