[TWEAK] Bio-Chip Pad Renaming Tracker Bio-Cips (#25617)

* Allows the biochip pad to change the GPS tag on the tracker implant. No more standard 'TRACK0' on everything.

Updates the UI for the biochip pad.
Adds the biochip pad to the protolathe under the medical tab

* Prettier!!! :)

* Moves the "tag" property below the general blurbs.

* Update code/game/objects/items/weapons/bio_chips/bio_chip_pad.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Spaghetti-bit <60483458+Spaghetti-bit@users.noreply.github.com>

* Merge Conflict Fix (1/2)

* MC (1.5/2)

* Merge Conflict Resolution (Hopefully)

---------

Signed-off-by: Spaghetti-bit <60483458+Spaghetti-bit@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
Spaghetti-bit
2024-06-25 21:29:45 +00:00
committed by GitHub
co-authored by Luc
parent 6b70c59c96
commit 457f9ff04f
5 changed files with 111 additions and 54 deletions
@@ -90,6 +90,18 @@
"function" = implant_data.function,
"image" = "[icon2base64(icon(initial(case.imp.icon), initial(case.imp.icon_state), SOUTH, 1))]",
)
if(istype(case.imp, /obj/item/bio_chip/tracking))
var/obj/item/bio_chip/tracking/T = case.imp
data["gps"] = T
data["tag"] = T.gpstag
else
data["gps"] = null
data["tag"] = null
else
// Sanity check in the case that a pad is used for multiple types of implants.
data["gps"] = null
data["tag"] = null
return data
/obj/item/bio_chip_pad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
@@ -99,3 +111,10 @@
switch(action)
if("eject_case")
eject_case(ui.user)
if("tag")
var/obj/item/bio_chip/tracking/T = case.imp
var/newtag = params["newtag"] || ""
newtag = uppertext(paranoid_sanitize(copytext_char(newtag, 1, 5)))
if(!length(newtag) || T.gpstag == newtag)
return
T.gpstag = newtag
@@ -7,6 +7,7 @@
implant_state = "implant-nanotrasen"
var/warn_cooldown = 0
var/obj/item/gps/internal_gps
var/gpstag = "TRACK0"
var/internal_gps_path = /obj/item/gps/internal/tracking_implant
/obj/item/bio_chip/tracking/Initialize(mapload)
@@ -23,6 +24,8 @@
if(!.)
return
internal_gps = new internal_gps_path(src)
if(gpstag)
internal_gps.gpstag = gpstag
/obj/item/bio_chip/tracking/removed(mob/target)
. = ..()
@@ -30,7 +33,6 @@
QDEL_NULL(internal_gps)
/obj/item/gps/internal/tracking_implant
gpstag = "TRACK0"
local = FALSE
/obj/item/bio_chip_implanter/tracking
@@ -660,6 +660,16 @@
////////////Regular Implants/////////////
/////////////////////////////////////////
/datum/design/bio_chip_pad
name = "Bio-chip Pad"
desc = "Used to modify bio-chips."
id = "biochip_pad"
req_tech = list("materials" = 3, "biotech" = 4, "programming" = 3)
build_type = PROTOLATHE
materials = list(MAT_METAL = 2000, MAT_GLASS = 1000)
build_path = /obj/item/bio_chip_pad
category = list("Medical")
/datum/design/bio_chip_implanter
name = "Bio-chip Implanter"
desc = "A sterile automatic bio-chip injector."
+38 -12
View File
@@ -1,15 +1,29 @@
import { useBackend } from '../backend';
import { Button, Section, Box, LabeledList } from '../components';
import { useBackend, useLocalState } from '../backend';
import { Button, Section, Box, LabeledList, Input, Icon } from '../components';
import { Window } from '../layouts';
export const BioChipPad = (props, context) => {
const { act, data } = useBackend(context);
const { implant, contains_case } = data;
const { implant, contains_case, gps, tag } = data;
const [newTag, setNewTag] = useLocalState(context, 'newTag', tag);
return (
<Window width={410} height={400}>
<Window width={410} height={325}>
<Window.Content>
<Section title="Bio-chip Mini-Computer">
<Section
fill
title="Bio-chip Mini-Computer"
buttons={
<Box>
<Button
content="Eject Case"
icon="eject"
disabled={!contains_case}
onClick={() => act('eject_case')}
/>
</Box>
}
>
{implant && contains_case ? (
<>
<Box bold mb={2}>
@@ -32,6 +46,25 @@ export const BioChipPad = (props, context) => {
<LabeledList.Item label="Function">
{implant.function}
</LabeledList.Item>
{!!gps && (
<LabeledList.Item label="Tag">
<Input
width="5.5rem"
value={tag}
onEnter={() => act('tag', { newtag: newTag })}
onInput={(e, value) => setNewTag(value)}
/>
<Button
disabled={tag === newTag}
width="20px"
mb="0"
ml="0.25rem"
onClick={() => act('tag', { newtag: newTag })}
>
<Icon name="pen" />
</Button>
</LabeledList.Item>
)}
</LabeledList>
</>
) : contains_case ? (
@@ -39,13 +72,6 @@ export const BioChipPad = (props, context) => {
) : (
<Box>Please insert a bio-chip casing!</Box>
)}
<Button
mt={2}
content="Eject Case"
icon="eject"
disabled={!contains_case}
onClick={() => act('eject_case')}
/>
</Section>
</Window.Content>
</Window>
File diff suppressed because one or more lines are too long