From ef4c841607b07a8363bf2bc321e8dbabaa978c2f Mon Sep 17 00:00:00 2001 From: ShadowLarkens Date: Sat, 26 Apr 2025 10:22:58 -0700 Subject: [PATCH] Printer (#17590) * Port all of /tg/'s fonts and switch maptext to Grand9K * Allow TGUI to use the new fonts * Remove SpessFont to be safe * Redo photocopier UI to be in the style of a VFD --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- tgui/packages/tgui/interfaces/Photocopier.tsx | 202 +++++++++++------- 1 file changed, 124 insertions(+), 78 deletions(-) diff --git a/tgui/packages/tgui/interfaces/Photocopier.tsx b/tgui/packages/tgui/interfaces/Photocopier.tsx index d1d0873f8f8..c97d41e2d57 100644 --- a/tgui/packages/tgui/interfaces/Photocopier.tsx +++ b/tgui/packages/tgui/interfaces/Photocopier.tsx @@ -1,10 +1,9 @@ import { useBackend } from 'tgui/backend'; import { Window } from 'tgui/layouts'; import { + AnimatedNumber, Box, Button, - NumberInput, - ProgressBar, Section, Stack, } from 'tgui-core/components'; @@ -22,27 +21,77 @@ type Data = { }; export const Photocopier = (props) => { - const { data } = useBackend(); - const { isAI, has_toner, has_item } = data; + const { act, data } = useBackend(); + const { has_item, num_copies, can_AI_print, isAI } = data; return ( - + - {has_toner ? ( - - ) : ( -
- No inserted toner cartridge. -
- )} - {has_item ? ( - - ) : ( -
- No inserted item. -
- )} - {!!isAI && } + {/* VFD */} + + + + + + + TONER LEVEL: + + + + + + + + COPIES: + {num_copies} + + + + {has_item ? 'SCANNER READY' : 'NO ITEM LOADED'} + + {isAI ? ( + + + AI: + + + + + + ) : null} + + + + + + + {has_item ? ( + + + + ) : null} +
); @@ -50,75 +99,72 @@ export const Photocopier = (props) => { const Toner = (props) => { const { data } = useBackend(); - const { max_toner, current_toner } = data; + const { max_toner, current_toner, has_toner } = data; + + if (!has_toner) { + return ERR; + } const average_toner: number = max_toner * 0.66; const bad_toner: number = max_toner * 0.33; + let color; + if (current_toner < bad_toner) { + color = 'bad'; + } else if (current_toner < average_toner) { + color = 'average'; + } else { + color = 'good'; + } + return ( -
- -
+ + f + '%'} /> + ); }; -const Options = (props) => { +const Buttons = (props) => { const { act, data } = useBackend(); const { num_copies } = data; - return ( -
- - - Make copies: - - - - act('set_copies', { - num_copies: value, - }) - } - /> - - - - - - -
+ + +