diff --git a/modular_ss220/bureaucracy/code/photocopier.dm b/modular_ss220/bureaucracy/code/photocopier.dm index 2b6c20444acb..3932a86fc618 100644 --- a/modular_ss220/bureaucracy/code/photocopier.dm +++ b/modular_ss220/bureaucracy/code/photocopier.dm @@ -54,6 +54,8 @@ if("choose_category") category = params["category"] . = TRUE + if("copies") + copies = clamp(text2num(params["new"]), 0, maxcopies) /obj/machinery/photocopier/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) @@ -68,7 +70,8 @@ var/list/data = list() data["isAI"] = issilicon(user) - data["copynumber"] = copies + data["copies"] = copies + data["maxcopies"] = maxcopies data["toner"] = toner data["copyitem"] = (copyitem ? copyitem.name : null) data["folder"] = (folder ? folder.name : null) diff --git a/tgui/packages/tgui/interfaces/Photocopier220.js b/tgui/packages/tgui/interfaces/Photocopier220.js index 8312e2ee3ac2..3dff85579b63 100644 --- a/tgui/packages/tgui/interfaces/Photocopier220.js +++ b/tgui/packages/tgui/interfaces/Photocopier220.js @@ -1,5 +1,5 @@ import { useBackend, useLocalState } from '../backend'; -import { Button, Section, Flex, Input } from '../components'; +import { Button, Section, Flex, Input, Slider, ProgressBar } from '../components'; import { Window } from '../layouts'; import { filter, sortBy } from 'common/collections'; import { FlexItem } from '../components/Flex'; @@ -22,6 +22,8 @@ const selectForms = (forms, searchText = '') => { export const Photocopier220 = (props, context) => { const { act, data } = useBackend(context); + const { copies, maxcopies } = data; + const [searchText, setSearchText] = useLocalState(context, 'searchText', ''); const forms = selectForms( @@ -34,6 +36,7 @@ export const Photocopier220 = (props, context) => { categories.push(form.category); } } + const [number, setNumber] = useLocalState(context, 'number', 0); let category; if (data.category === '') { @@ -46,22 +49,22 @@ export const Photocopier220 = (props, context) => { - +
- + Заряд тонера: - 0 ? 'good' : 'bad'} - bold - > - {data.toner} + + - +
- +
- + Форма: @@ -165,8 +158,9 @@ export const Photocopier220 = (props, context) => { - +
- -
+ +
setSearchText(value)} /> - + {category.map((form) => (