little canvas fix. (#12328)

This commit is contained in:
Ghom
2020-05-21 19:07:28 +02:00
committed by GitHub
parent e792600115
commit 3430f0130d
3 changed files with 21 additions and 11 deletions
+12 -8
View File
@@ -58,18 +58,22 @@
/obj/item/wallframe/proc/after_attach(var/obj/O)
transfer_fingerprints_to(O)
/obj/item/wallframe/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/screwdriver))
// For camera-building borgs
var/turf/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
T.attackby(src, user, params)
/obj/item/wallframe/screwdriver_act(mob/user, obj/item/I)
. = ..()
if(.)
return
// For camera-building borgs
var/turf/T = get_step(get_turf(user), user.dir)
if(iswallturf(T))
T.attackby(src, user)
/obj/item/wallframe/wrench_act(mob/user, obj/item/I)
if(!custom_materials)
return
var/metal_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]/MINERAL_MATERIAL_AMOUNT)
var/glass_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)]/MINERAL_MATERIAL_AMOUNT)
if(istype(W, /obj/item/wrench) && (metal_amt || glass_amt))
if(metal_amt || glass_amt)
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
if(metal_amt)
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)
+8 -2
View File
@@ -1,6 +1,6 @@
import { Fragment } from 'inferno';
import { useBackend } from '../backend';
import { Box } from '../components';
import { Box, Button } from '../components';
import { Component, createRef } from 'inferno';
import { pureComponentHooks } from 'common/react';
@@ -85,6 +85,12 @@ export const Canvas = props => {
<PaintCanvas
value={data.grid}
onCanvasClick={(x, y) => act("paint", { x, y })} />
<Box>{data.name}</Box>
<Box>
{!data.finalized
&& <Button.Confirm
onClick={() => act("finalize")}
content="Finalize" />}
{data.name}
</Box>
</Box>);
};
File diff suppressed because one or more lines are too long