diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index b67c15f12cf..982272eeb97 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -262,7 +262,7 @@ /obj/item/stack/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) if(!ui) - ui = new(user, src, "Stack", name) + ui = new(user, src, "StackCrafting", name) ui.open() /obj/item/stack/ui_data(mob/user) diff --git a/tgui/packages/tgui/interfaces/Stack.js b/tgui/packages/tgui/interfaces/Stack.js deleted file mode 100644 index 3cfef42aabe..00000000000 --- a/tgui/packages/tgui/interfaces/Stack.js +++ /dev/null @@ -1,181 +0,0 @@ -import { createSearch } from 'common/string'; -import { sortBy } from 'common/collections'; -import { useBackend, useLocalState } from '../backend'; -import { Box, Button, Input, NoticeBox, Section, Collapsible, Table } from '../components'; -import { Window } from '../layouts'; - -export const Stack = (props, context) => { - const { act, data } = useBackend(context); - - const { amount, recipes = [] } = data; - - const [searchText, setSearchText] = useLocalState(context, 'searchText', ''); - - const testSearch = createSearch(searchText, (item) => { - return item; - }); - - const items = - (searchText.length > 0 && - Object.keys(recipes) - .filter(testSearch) - .reduce((obj, key) => { - obj[key] = recipes[key]; - return obj; - }, {})) || - recipes; - - const height = Math.max(94 + Object.keys(recipes).length * 26, 250); - - return ( - - -
- Search - setSearchText(value)} - mx={1} - /> - - }> - {(items.length === 0 && No recipes found.) || ( - - )} -
-
-
- ); -}; - -const RecipeList = (props, context) => { - const { act, data } = useBackend(context); - - const { recipes } = props; - - const sortedKeys = sortBy((key) => key.toLowerCase())(Object.keys(recipes)); - - return sortedKeys.map((title) => { - const recipe = recipes[title]; - if (recipe.ref === undefined) { - return ( - - - - - - ); - } else { - return ; - } - }); -}; - -const buildMultiplier = (recipe, amount) => { - if (recipe.req_amount > amount) { - return 0; - } - - return Math.floor(amount / recipe.req_amount); -}; - -const Multipliers = (props, context) => { - const { act, data } = useBackend(context); - - const { recipe, maxMultiplier } = props; - - const maxM = Math.min( - maxMultiplier, - Math.floor(recipe.max_res_amount / recipe.res_amount) - ); - - const multipliers = [5, 10, 25]; - - let finalResult = []; - - for (const multiplier of multipliers) { - if (maxM >= multiplier) { - finalResult.push( -