Allows silicons to print saved pictures on photocopiers again. (#22461)

* Allows silicons to print saved images again

* Changes addressed

* Update tgui/packages/tgui/interfaces/Photocopier.js

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

---------

Co-authored-by: Adrer <adrermail@gmail.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
This commit is contained in:
Adrer
2023-09-19 20:37:37 +02:00
committed by GitHub
parent 45b8010edf
commit 5ba2b97fe4
3 changed files with 17 additions and 2 deletions
+4 -1
View File
@@ -376,6 +376,7 @@
data["folder"] = (folder ? folder.name : null)
data["mob"] = (copymob ? copymob.name : null)
data["files"] = list()
data["issilicon"] = issilicon(user)
if(LAZYLEN(saved_documents))
for(var/obj/item/O in saved_documents)
var/list/document_data = list(
@@ -409,6 +410,8 @@
. = TRUE
if("scandocument")
scan_document()
if("ai_pic")
ai_pic()
if("filecopy")
file_copy(params["uid"])
if("deletefile")
@@ -416,7 +419,7 @@
. = TRUE
update_icon()
/obj/machinery/photocopier/proc/aipic()
/obj/machinery/photocopier/proc/ai_pic()
if(!issilicon(usr))
return
if(stat & (BROKEN|NOPOWER))
@@ -77,6 +77,7 @@ export const Photocopier = (props, context) => {
const Actions = (props, context) => {
const { act, data } = useBackend(context);
const { issilicon } = data;
return (
<Fragment>
<Button
@@ -95,6 +96,17 @@ const Actions = (props, context) => {
content="Scan"
onClick={() => act('scandocument')}
/>
{!!issilicon && (
<Button
fluid
icon="image"
color="green"
float="center"
textAlign="center"
content="Print from database"
onClick={() => act('ai_pic')}
/>
)}
</Fragment>
);
};
File diff suppressed because one or more lines are too long