diff --git a/code/game/objects/structures/detectiveboard.dm b/code/game/objects/structures/detectiveboard.dm index 27c11cda5a0..d06a23a66dd 100644 --- a/code/game/objects/structures/detectiveboard.dm +++ b/code/game/objects/structures/detectiveboard.dm @@ -52,12 +52,10 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/detectiveboard, 32) attaching_evidence = TRUE var/name = tgui_input_text(user, "Please enter the evidence name", "Detective's Board", max_length = MAX_NAME_LEN) if(!name) - attaching_evidence = FALSE - return + name = item.name var/desc = tgui_input_text(user, "Please enter the evidence description", "Detective's Board", max_length = MAX_DESC_LEN) if(!desc) - attaching_evidence = FALSE - return + desc = item.desc if(!user.transferItemToLoc(item, src)) attaching_evidence = FALSE diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx index 7cfb7063d54..ae7c30652b6 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx @@ -38,6 +38,8 @@ export function Evidence(props: EvidenceProps) { null, ); + const randomRotation = Math.random() * 2 - 1; + function handleMouseDown(args) { if (canDrag) { setDragging(true); @@ -74,9 +76,6 @@ export function Evidence(props: EvidenceProps) { }; }, [dragging]); - function getPinPositionByPosition(evidence: Position) { - return { x: evidence.x + 15, y: evidence.y + 45 }; - } useEffect(() => { if (!dragging) { return; @@ -85,13 +84,16 @@ export function Evidence(props: EvidenceProps) { const onMouseMove = (args: MouseEvent) => { if (canDrag) { if (lastMousePosition) { + const newX = dragPosition.x - (lastMousePosition.x - args.screenX); + const newY = dragPosition.y - (lastMousePosition.y - args.screenY); + setDragPosition({ - x: dragPosition.x - (lastMousePosition.x - args.screenX), - y: dragPosition.y - (lastMousePosition.y - args.screenY), + x: newX, + y: newY, }); props.onMoving(evidence, { - x: dragPosition.x - (lastMousePosition.x - args.screenX), - y: dragPosition.y - (lastMousePosition.y - args.screenY), + x: newX, + y: newY, }); } @@ -107,10 +109,15 @@ export function Evidence(props: EvidenceProps) { return ( diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/Pin.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/Pin.tsx index 2947476d108..5e410982623 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/Pin.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/Pin.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from 'react'; import { Box, Stack } from 'tgui-core/components'; +import { classes } from 'tgui-core/react'; import { DataEvidence } from './DataTypes'; @@ -48,7 +49,10 @@ export function Pin(props: PinProps) { onMouseUp(evidence, args)} diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/index.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/index.tsx index 81518b97bd0..0ab3de9de7b 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/index.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/index.tsx @@ -291,20 +291,20 @@ export function DetectiveBoard(props) { connections={retrieveConnections( movingEvidenceConnections, )} - zLayer={99} + zLayer={1} /> )} {connection && ( )} {item?.evidences?.map((evidence, index) => (