From bd32d1c584a34b2f7b82694c5c53915b67ab75b6 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Fri, 21 Nov 2025 01:07:33 +0100 Subject: [PATCH] adjust resize ability to use a state (#18811) * ajust resize ability to use a state * na not this --- code/modules/mining/fulton.dm | 1 - code/modules/vore/eating/vorepanel_vr.dm | 10 +++-- .../VorePanelMainTabs/VoreAbilities.tsx | 39 ++++++++++++++----- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index e01a8fda704..4ca3aefa8eb 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -142,7 +142,6 @@ icon_state = "subspace_amplifier" /obj/item/fulton_core/attack_self(mob/user) - var/turf/T = get_turf(user) if(do_after(user, 1.5 SECONDS, target = user) && !QDELETED(src)) new /obj/structure/extraction_point(get_turf(user)) qdel(src) diff --git a/code/modules/vore/eating/vorepanel_vr.dm b/code/modules/vore/eating/vorepanel_vr.dm index 875d0d76806..8bd72ab4d35 100644 --- a/code/modules/vore/eating/vorepanel_vr.dm +++ b/code/modules/vore/eating/vorepanel_vr.dm @@ -737,10 +737,12 @@ var/new_size = text2num(params["new_mob_size"]) new_size = clamp(new_size, RESIZE_MINIMUM_DORMS, RESIZE_MAXIMUM_DORMS) if(istype(host, /mob/living)) - var/mob/living/H = host - if(H.nutrition >= VORE_RESIZE_COST) - H.adjust_nutrition(-VORE_RESIZE_COST) - H.resize(new_size, uncapped = host.has_large_resize_bounds(), ignore_prefs = TRUE) + var/mob/living/living_host = host + if(new_size == living_host.size_multiplier) + return FALSE + if(living_host.nutrition >= VORE_RESIZE_COST) + living_host.adjust_nutrition(-VORE_RESIZE_COST) + living_host.resize(new_size, uncapped = living_host.has_large_resize_bounds(), ignore_prefs = TRUE) return TRUE //Soulcatcher functions if("soulcatcher_release_all") diff --git a/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreAbilities.tsx b/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreAbilities.tsx index 9ee4f1da5f3..9e667e4a155 100644 --- a/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreAbilities.tsx +++ b/tgui/packages/tgui/interfaces/VorePanel/VorePanelMainTabs/VoreAbilities.tsx @@ -1,6 +1,12 @@ +import { useState } from 'react'; import { useBackend } from 'tgui/backend'; -import { LabeledList, Section, Slider, Stack } from 'tgui-core/components'; - +import { + Button, + LabeledList, + Section, + Slider, + Stack, +} from 'tgui-core/components'; import { abilitiy_usable } from '../functions'; import type { abilities, abilitySizeChange } from '../types'; @@ -28,6 +34,10 @@ const SizeChange = (props: { const { resize_cost, current_size, minimum_size, maximum_size } = sizeChange; + const roundedSize = Math.round(current_size * 10000) / 100; + + const [targetSize, setTargetSize] = useState(roundedSize); + return ( @@ -47,17 +57,28 @@ const SizeChange = (props: { : { black: [0, 600] } } format={(value: number) => `${value.toFixed(2)}%`} - value={Math.round(current_size * 10000) / 100} + value={targetSize} minValue={minimum_size * 100} maxValue={maximum_size * 100} - onChange={(e, value: number) => - act('adjust_own_size', { - new_mob_size: value / 100, - }) - } + onChange={(e, value: number) => setTargetSize(value)} /> -   Cost:  + + + + Cost: {resize_cost}