diff --git a/code/modules/resleeving/computers.dm b/code/modules/resleeving/computers.dm
index e8caee09001..feab1da4851 100644
--- a/code/modules/resleeving/computers.dm
+++ b/code/modules/resleeving/computers.dm
@@ -17,7 +17,9 @@
var/list/temp = null
var/menu = MENU_MAIN //Which menu screen to display
var/datum/transhuman/body_record/active_br = null
+ var/can_grow_active = FALSE
var/datum/transhuman/mind_record/active_mr = null
+ var/can_sleeve_active = FALSE
var/organic_capable = 1
var/synthetic_capable = 1
var/obj/item/disk/transcore/disk
@@ -25,6 +27,7 @@
var/obj/machinery/transhuman/synthprinter/selected_printer
var/obj/machinery/transhuman/resleever/selected_sleever
+
// Resleeving database this machine interacts with. Blank for default database
// Needs a matching /datum/transcore_db with key defined in code
var/db_key
@@ -103,7 +106,7 @@
active_br = new /datum/transhuman/body_record(brDisk.stored) // Loads a COPY!
to_chat(user, "\The [src] loads the body record from \the [W] before ejecting it.")
attack_hand(user)
- view_b_rec("view_b_rec", list("ref" = "\ref[active_br]"))
+ view_b_rec(REF(active_br))
else
..()
return
@@ -140,121 +143,111 @@
var/data[0]
data["menu"] = menu
- var/list/temppods[0]
+ var/list/clonepods = list()
for(var/obj/machinery/clonepod/transhuman/pod in pods)
var/status = "idle"
if(pod.mess)
status = "mess"
else if(pod.occupant && !(pod.stat & NOPOWER))
status = "cloning"
- temppods.Add(list(list(
- "pod" = "\ref[pod]",
+ clonepods += list(list(
+ "pod" = REF(pod),
"name" = sanitize(capitalize(pod.name)),
"biomass" = pod.get_biomass(),
"status" = status,
"progress" = (pod.occupant && pod.occupant.stat != DEAD) ? pod.get_completion() : 0
- )))
- data["pods"] = temppods.Copy()
- temppods.Cut()
+ ))
+ data["pods"] = clonepods
+ var/list/synthpods = list()
for(var/obj/machinery/transhuman/synthprinter/spod in spods)
- temppods.Add(list(list(
- "spod" = "\ref[spod]",
+ synthpods += list(list(
+ "spod" = REF(spod),
"name" = sanitize(capitalize(spod.name)),
"busy" = spod.busy,
"steel" = spod.stored_material[MAT_STEEL],
"glass" = spod.stored_material[MAT_GLASS]
- )))
- data["spods"] = temppods.Copy()
- temppods.Cut()
+ ))
+ data["spods"] = synthpods
+ var/list/resleevers = list()
for(var/obj/machinery/transhuman/resleever/resleever in sleevers)
- temppods.Add(list(list(
- "sleever" = "\ref[resleever]",
+ resleevers += list(list(
+ "sleever" = REF(resleever),
"name" = sanitize(capitalize(resleever.name)),
"occupied" = !!resleever.occupant,
"occupant" = resleever.occupant ? resleever.occupant.real_name : "None"
- )))
- data["sleevers"] = temppods.Copy()
- temppods.Cut()
+ ))
+ data["sleevers"] = resleevers
data["coredumped"] = our_db.core_dumped
data["emergency"] = disk
data["temp"] = temp
- data["selected_pod"] = "\ref[selected_pod]"
- data["selected_printer"] = "\ref[selected_printer]"
- data["selected_sleever"] = "\ref[selected_sleever]"
+ data["selected_pod"] = REF(selected_pod)
+ data["selected_printer"] = REF(selected_printer)
+ data["selected_sleever"] = REF(selected_sleever)
- var/bodyrecords_list_ui[0]
+ var/list/bodyrecords_list_ui = list()
for(var/N in our_db.body_scans)
var/datum/transhuman/body_record/BR = our_db.body_scans[N]
- bodyrecords_list_ui[++bodyrecords_list_ui.len] = list("name" = N, "recref" = "\ref[BR]")
+ bodyrecords_list_ui += list(list(
+ "name" = N,
+ "recref" = REF(BR)
+ ))
data["bodyrecords"] = bodyrecords_list_ui
- var/mindrecords_list_ui[0]
+ var/list/mindrecords_list_ui = list()
for(var/N in our_db.backed_up)
var/datum/transhuman/mind_record/MR = our_db.backed_up[N]
- mindrecords_list_ui[++mindrecords_list_ui.len] = list("name" = N, "recref" = "\ref[MR]")
+ mindrecords_list_ui += list(list(
+ "name" = N,
+ "recref" = REF(MR)
+ ))
data["mindrecords"] = mindrecords_list_ui
- data["modal"] = tgui_modal_data(src)
+ data["active_b_rec"] = null
+ if(active_br)
+ data["active_b_rec"] = list(
+ activerecord = REF(active_br),
+ realname = sanitize(active_br.mydna.name),
+ species = active_br.speciesname ? active_br.speciesname : active_br.mydna.dna.species,
+ sex = active_br.bodygender,
+ mind_compat = active_br.locked ? "Low" : "High",
+ synthetic = active_br.synthetic,
+ oocnotes = active_br.body_oocnotes ? active_br.body_oocnotes : "None",
+ can_grow_active = can_grow_active,
+ )
+
+ data["active_m_rec"] = null
+ if(active_mr)
+ data["active_m_rec"] = list(
+ activerecord = REF(active_mr),
+ realname = sanitize(active_mr.mindname),
+ obviously_dead = active_mr.dead_state == MR_DEAD ? "Past-due" : "Current",
+ oocnotes = active_mr.mind_oocnotes ? active_mr.mind_oocnotes : "None.",
+ can_sleeve_active = can_sleeve_active,
+ )
+
return data
/obj/machinery/computer/transhuman/resleeving/tgui_act(action, params)
- if(..())
- return TRUE
-
- . = TRUE
- switch(tgui_modal_act(src, action, params))
- if(TGUI_MODAL_ANSWER)
- // if(params["id"] == "del_rec" && active_record)
- // var/obj/item/card/id/C = usr.get_active_hand()
- // if(!istype(C) && !istype(C, /obj/item/pda))
- // set_temp("ID not in hand.", "danger")
- // return
- // if(check_access(C))
- // records.Remove(active_record)
- // qdel(active_record)
- // set_temp("Record deleted.", "success")
- // menu = MENU_RECORDS
- // else
- // set_temp("Access denied.", "danger")
- return
+ . = ..()
+ if(.)
+ return
switch(action)
if("view_b_rec")
- view_b_rec(action, params)
+ view_b_rec(params["ref"])
+ . = TRUE
+ if("clear_b_rec")
+ active_br = null
+ . = TRUE
if("view_m_rec")
- var/ref = params["ref"]
- if(!length(ref))
- return
- active_mr = locate(ref)
- if(istype(active_mr))
- if(isnull(active_mr.ckey))
- qdel(active_mr)
- set_temp("Error: Record corrupt.", "danger")
- else
- var/can_sleeve_active = 1
- if(!LAZYLEN(sleevers))
- can_sleeve_active = 0
- set_temp("Error: Cannot sleeve due to no sleevers.", "danger")
- if(!selected_sleever)
- can_sleeve_active = 0
- set_temp("Error: Cannot sleeve due to no selected sleever.", "danger")
- if(selected_sleever && !selected_sleever.occupant)
- can_sleeve_active = 0
- set_temp("Error: Cannot sleeve due to lack of sleever occupant.", "danger")
- var/list/payload = list(
- activerecord = "\ref[active_mr]",
- realname = sanitize(active_mr.mindname),
- obviously_dead = active_mr.dead_state == MR_DEAD ? "Past-due" : "Current",
- oocnotes = active_mr.mind_oocnotes ? active_mr.mind_oocnotes : "None.",
- can_sleeve_active = can_sleeve_active,
- )
- tgui_modal_message(src, action, "", null, payload)
- else
- active_mr = null
- set_temp("Error: Record missing.", "danger")
+ view_m_rec(params["ref"])
+ . = TRUE
+ if("clear_m_rec")
+ active_mr = null
+ . = TRUE
if("coredump")
if(disk)
our_db.core_dump(disk)
@@ -262,11 +255,13 @@
visible_message("\The [src] spits out \the [disk].")
disk.forceMove(get_turf(src))
disk = null
+ . = TRUE
if("ejectdisk")
disk.forceMove(get_turf(src))
disk = null
-
+ . = TRUE
if("create")
+ . = TRUE
if(istype(active_br))
//Tried to grow a synth but no synth pods.
if(active_br.synthetic && !spods.len)
@@ -281,32 +276,39 @@
var/obj/machinery/transhuman/synthprinter/spod = selected_printer
if(!istype(spod))
set_temp("Error: No SynthFab selected.", "danger")
+ active_br = null
return
//Already doing someone.
if(spod.busy)
set_temp("Error: SynthFab is currently busy.", "danger")
+ active_br = null
return
//Not enough steel or glass
else if(spod.stored_material[MAT_STEEL] < spod.body_cost)
set_temp("Error: Not enough [MAT_STEEL] in SynthFab.", "danger")
+ active_br = null
return
else if(spod.stored_material["glass"] < spod.body_cost)
set_temp("Error: Not enough glass in SynthFab.", "danger")
+ active_br = null
return
//Gross pod (broke mid-cloning or something).
else if(spod.broken)
set_temp("Error: SynthFab malfunction.", "danger")
+ active_br = null
return
//Do the cloning!
else if(spod.print(active_br))
set_temp("Initiating printing cycle...", "success")
+ active_br = null
menu = 1
else
set_temp("Initiating printing cycle... Error: Post-initialisation failed. Printing cycle aborted.", "danger")
+ active_br = null
return
//We're cloning an organic.
@@ -314,59 +316,58 @@
var/obj/machinery/clonepod/transhuman/pod = selected_pod
if(!istype(pod))
set_temp("Error: No clonepod selected.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
//Already doing someone.
if(pod.occupant)
set_temp("Error: Growpod is currently occupied.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
//Not enough materials.
else if(pod.get_biomass() < CLONE_BIOMASS)
set_temp("Error: Not enough biomass.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
//Gross pod (broke mid-cloning or something).
else if(pod.mess)
set_temp("Error: Growpod malfunction.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
//Disabled in config.
else if(!config.revival_cloning)
set_temp("Error: Unable to initiate growing cycle.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
//Do the cloning!
else if(pod.growclone(active_br))
set_temp("Initiating growing cycle...", "success")
- tgui_modal_clear(src)
+ active_br = null
else
set_temp("Initiating growing cycle... Error: Post-initialisation failed. Growing cycle aborted.", "danger")
- tgui_modal_clear(src)
+ active_br = null
return
-
//The body record is broken somehow.
else
set_temp("Error: Data corruption.", "danger")
- tgui_modal_clear(src)
- return
-
+ active_br = null
if("sleeve")
if(istype(active_mr))
+ . = TRUE
if(!sleevers.len)
set_temp("Error: No sleevers detected.", "danger")
+ active_mr = null
else
var/mode = text2num(params["mode"])
var/override
var/obj/machinery/transhuman/resleever/sleever = selected_sleever
if(!istype(sleever))
set_temp("Error: No resleeving pod selected.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return
switch(mode)
@@ -374,13 +375,13 @@
//No body to sleeve into.
if(!sleever.occupant)
set_temp("Error: Resleeving pod is not occupied.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return
//OOC body lock thing.
if(sleever.occupant.resleeve_lock && active_mr.ckey != sleever.occupant.resleeve_lock)
set_temp("Error: Mind incompatible with body.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return
var/list/subtargets = list()
@@ -393,13 +394,13 @@
override = tgui_input_list(usr,"Multiple bodies detected. Select target for resleeving of [active_mr.mindname] manually. Sleeving of primary body is unsafe with sub-contents, and is not listed.", "Resleeving Target", subtargets)
if(!override || oc_sanity != sleever.occupant || !(override in sleever.occupant))
set_temp("Error: Target selection aborted.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return
if(2) //Card resleeving
if(sleever.sleevecards <= 0)
set_temp("Error: No available cards in resleever.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return
//Body to sleeve into, but mind is in another living body.
@@ -409,16 +410,14 @@
//They declined to be moved.
if(answer != "Yes")
set_temp("Initiating resleeving... Error: Post-initialisation failed. Resleeving cycle aborted.", "danger")
- tgui_modal_clear(src)
+ active_mr = null
return TRUE
//They were dead, or otherwise available.
sleever.putmind(active_mr,mode,override,db_key = db_key)
set_temp("Initiating resleeving...")
- tgui_modal_clear(src)
+ active_mr = null
- if("refresh")
- SStgui.update_uis(src)
if("selectpod")
var/ref = params["ref"]
if(!length(ref))
@@ -426,6 +425,7 @@
var/obj/machinery/clonepod/selected = locate(ref)
if(istype(selected) && (selected in pods))
selected_pod = selected
+ . = TRUE
if("selectprinter")
var/ref = params["ref"]
if(!length(ref))
@@ -433,6 +433,7 @@
var/obj/machinery/transhuman/synthprinter/selected = locate(ref)
if(istype(selected) && (selected in spods))
selected_printer = selected
+ . = TRUE
if("selectsleever")
var/ref = params["ref"]
if(!length(ref))
@@ -440,12 +441,13 @@
var/obj/machinery/transhuman/resleever/selected = locate(ref)
if(istype(selected) && (selected in sleevers))
selected_sleever = selected
+ . = TRUE
if("menu")
menu = clamp(text2num(params["num"]), MENU_MAIN, MENU_MIND)
+ . = TRUE
if("cleartemp")
temp = null
- else
- return FALSE
+ . = TRUE
// In here because only relevant to computer
/obj/item/cmo_disk_holder
@@ -489,40 +491,53 @@
if(update_now)
SStgui.update_uis(src)
-/obj/machinery/computer/transhuman/resleeving/proc/view_b_rec(action, params)
- var/ref = params["ref"]
+/obj/machinery/computer/transhuman/resleeving/proc/view_b_rec(ref)
if(!length(ref))
return
+
active_br = locate(ref)
if(istype(active_br))
- var/can_grow_active = 1
+ can_grow_active = TRUE
if(!synthetic_capable && active_br.synthetic) //Disqualified due to being synthetic in an organic only.
- can_grow_active = 0
+ can_grow_active = FALSE
set_temp("Error: Cannot grow [active_br.mydna.name] due to lack of synthfabs.", "danger")
else if(!organic_capable && !active_br.synthetic) //Disqualified for the opposite.
- can_grow_active = 0
+ can_grow_active = FALSE
set_temp("Error: Cannot grow [active_br.mydna.name] due to lack of cloners.", "danger")
else if(!synthetic_capable && !organic_capable) //What have you done??
- can_grow_active = 0
+ can_grow_active = FALSE
set_temp("Error: Cannot grow [active_br.mydna.name] due to lack of synthfabs and cloners.", "danger")
else if(active_br.toocomplex)
- can_grow_active = 0
+ can_grow_active = FALSE
set_temp("Error: Cannot grow [active_br.mydna.name] due to species complexity.", "danger")
- var/list/payload = list(
- activerecord = "\ref[active_br]",
- realname = sanitize(active_br.mydna.name),
- species = active_br.speciesname ? active_br.speciesname : active_br.mydna.dna.species,
- sex = active_br.bodygender,
- mind_compat = active_br.locked ? "Low" : "High",
- synthetic = active_br.synthetic,
- oocnotes = active_br.body_oocnotes ? active_br.body_oocnotes : "None",
- can_grow_active = can_grow_active,
- )
- tgui_modal_message(src, action, "", null, payload)
else
active_br = null
set_temp("Error: Record missing.", "danger")
+/obj/machinery/computer/transhuman/resleeving/proc/view_m_rec(ref)
+ if(!length(ref))
+ return
+
+ active_mr = locate(ref)
+ if(istype(active_mr))
+ if(isnull(active_mr.ckey))
+ qdel(active_mr)
+ set_temp("Error: Record corrupt.", "danger")
+ else
+ can_sleeve_active = TRUE
+ if(!LAZYLEN(sleevers))
+ can_sleeve_active = FALSE
+ set_temp("Error: Cannot sleeve due to no sleevers.", "danger")
+ if(!selected_sleever)
+ can_sleeve_active = FALSE
+ set_temp("Error: Cannot sleeve due to no selected sleever.", "danger")
+ if(selected_sleever && !selected_sleever.occupant)
+ can_sleeve_active = FALSE
+ set_temp("Error: Cannot sleeve due to lack of sleever occupant.", "danger")
+ else
+ active_mr = null
+ set_temp("Error: Record missing.", "danger")
+
#undef MENU_MAIN
#undef MENU_BODY
#undef MENU_MIND
diff --git a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOccupant.tsx b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOccupant.tsx
index 95f54a5cd97..59ada652b36 100644
--- a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOccupant.tsx
+++ b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOccupant.tsx
@@ -62,7 +62,7 @@ export const BodyScannerMainOccupant = (props: { occupant: occupant }) => {
value={occupant.blood.volume}
format={(value) => toFixed(value)}
/>
- units (
+ u (
toFixed(value)}
@@ -70,10 +70,8 @@ export const BodyScannerMainOccupant = (props: { occupant: occupant }) => {
%)
- {toFixed(occupant.weight) +
- 'lbs, ' +
- toFixed(occupant.weight / 2.20463) +
- 'kgs'}
+ {toFixed(occupant.weight / 2.20463, 1) + 'kg, '}
+ {toFixed(occupant.weight) + 'lbs'}
diff --git a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOrgansExternal.tsx b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOrgansExternal.tsx
index cd32c84a4a8..3c4139827bb 100644
--- a/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOrgansExternal.tsx
+++ b/tgui/packages/tgui/interfaces/BodyScanner/BodyScannerMainOrgansExternal.tsx
@@ -51,18 +51,17 @@ export const BodyScannerMainOrgansExternal = (props: {
inline
>
{!!o.bruteLoss && (
-
-
+
+
{toFixed(o.bruteLoss)}
-
-
+
)}
{!!o.fireLoss && (
-
+
{toFixed(o.fireLoss)}
-
+
)}
{toFixed(o.totalLoss)}
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsList.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsList.tsx
index ae0fc26729d..053c1ac038b 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsList.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsList.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Box, Button, Input } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Input } from 'tgui-core/components';
+
import { Data } from './types';
export const MedicalRecordsList = (props) => {
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsMedbots.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsMedbots.tsx
index f0389b1c483..e4d6dba9093 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsMedbots.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsMedbots.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Box, Collapsible, LabeledList } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, Collapsible, LabeledList } from 'tgui-core/components';
+
import { Data } from './types';
export const MedicalRecordsMedbots = (props) => {
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsOptions.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsOptions.tsx
index 037fa47dda5..757e79b7cda 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsOptions.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsOptions.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Button, Icon, Section, Tabs } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Button, Section, Tabs } from 'tgui-core/components';
+
import { MedicalRecordsViewGeneral } from './MedicalRecordsViewGeneral';
import { MedicalRecordsViewMedical } from './MedicalRecordsViewMedical';
import { Data } from './types';
@@ -73,29 +74,29 @@ export const MedicalRecordsNavigation = (props) => {
act('screen', { screen: 2 })}
+ icon="list"
>
-
List Records
act('screen', { screen: 5 })}
+ icon="database"
>
-
Virus Database
act('screen', { screen: 6 })}
+ icon="plus-square"
>
-
Medbot Tracking
act('screen', { screen: 3 })}
+ icon="wrench"
>
-
Record Maintenance
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewGeneral.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewGeneral.tsx
index 01ca768df89..12bab768bd2 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewGeneral.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewGeneral.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Box, Button, Image, LabeledList } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Image, LabeledList, Stack } from 'tgui-core/components';
+
import { doEdit } from '../GeneralRecords/functions';
import { Data } from './types';
@@ -10,13 +11,8 @@ export const MedicalRecordsViewGeneral = (props) => {
return General records lost!;
}
return (
- <>
-
+
+
{general.fields.map((field, i) => (
@@ -33,14 +29,8 @@ export const MedicalRecordsViewGeneral = (props) => {
))}
-
-
+
+
{!!general.has_photos &&
general.photos!.map((p, i) => (
@@ -55,7 +45,7 @@ export const MedicalRecordsViewGeneral = (props) => {
Photo #{i + 1}
))}
-
- >
+
+
);
};
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx
index dc3b07c08b2..8745c78b98a 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViewMedical.tsx
@@ -1,6 +1,7 @@
-import { useBackend } from '../../backend';
-import { Box, Button, LabeledList, Section } from '../../components';
-import { modalOpen } from '../../interfaces/common/ComplexModal';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, LabeledList, Section } from 'tgui-core/components';
+
+import { modalOpen } from '../common/ComplexModal';
import { doEdit } from '../GeneralRecords/functions';
import { Data } from './types';
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViruses.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViruses.tsx
index eb7ea731b9d..cb57dabf453 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViruses.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/MedicalRecordsViruses.tsx
@@ -1,26 +1,29 @@
import { Fragment } from 'react';
import { useBackend } from '../../backend';
-import { Button } from '../../components';
+import { Button, NoticeBox } from '../../components';
import { Data } from './types';
export const MedicalRecordsViruses = (props) => {
const { act, data } = useBackend();
const { virus } = data;
- virus && virus.sort((a, b) => (a.name > b.name ? 1 : -1));
- return (
- virus &&
- virus.map((vir, i) => (
-
-
-
-
- ))
- );
+
+ if (!virus?.length) {
+ return No viruses in database.;
+ }
+
+ virus.sort((a, b) => (a.name > b.name ? 1 : -1));
+
+ return virus.map((vir, i) => (
+
+
+
+
+ ));
};
diff --git a/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx
index 61fd434ab91..3ceae1aeb0a 100644
--- a/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx
+++ b/tgui/packages/tgui/interfaces/MedicalRecords/index.tsx
@@ -1,10 +1,11 @@
-import { useBackend } from '../../backend';
-import { Section } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Window } from 'tgui/layouts';
+import { Section, Stack } from 'tgui-core/components';
+
import {
ComplexModal,
modalRegisterBodyOverride,
-} from '../../interfaces/common/ComplexModal';
-import { Window } from '../../layouts';
+} from '../common/ComplexModal';
import { LoginInfo } from '../common/LoginInfo';
import { LoginScreen } from '../common/LoginScreen';
import { TemporaryNotice } from '../common/TemporaryNotice';
@@ -46,14 +47,26 @@ export const MedicalRecords = (props) => {
return (
-
-
-
-
-
-
- {(screen && body[screen]) || ''}
-
+
+
+
+
+
+
+ {!!data.temp && (
+
+
+
+ )}
+
+
+
+
+
+ {(screen && body[screen]) || ''}
+
+
+
);
diff --git a/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerOptions.tsx b/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerOptions.tsx
index 57b9bde2c7c..54a25d2b966 100644
--- a/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerOptions.tsx
+++ b/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerOptions.tsx
@@ -58,6 +58,7 @@ export const OperatingComputerOptions = (props) => {
value={oxyAlarm}
stepPixelSize={5}
ml="0"
+ format={(val) => val + '%'}
onChange={(e, val: number) =>
act('oxy_adj', {
new: val,
diff --git a/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerPatient.tsx b/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerPatient.tsx
index 3b1ec80fa4e..137cee9d7c9 100644
--- a/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerPatient.tsx
+++ b/tgui/packages/tgui/interfaces/OperatingComputer/OperatingComputerPatient.tsx
@@ -74,7 +74,7 @@ export const OperatingComputerPatient = (props: { occupant: occupant }) => {
- {occupant.surgery && occupant.surgery.length ? (
+ {occupant.surgery?.length ? (
{occupant.surgery.map((limb) => (
diff --git a/tgui/packages/tgui/interfaces/OperatingComputer/index.tsx b/tgui/packages/tgui/interfaces/OperatingComputer/index.tsx
index cf293d98786..6aa4d90e7c4 100644
--- a/tgui/packages/tgui/interfaces/OperatingComputer/index.tsx
+++ b/tgui/packages/tgui/interfaces/OperatingComputer/index.tsx
@@ -1,3 +1,5 @@
+import { Stack } from 'tgui-core/components';
+
import { useBackend } from '../../backend';
import { Section, Tabs } from '../../components';
import { Window } from '../../layouts';
@@ -22,23 +24,31 @@ export const OperatingComputer = (props) => {
return (
-
- act('choiceOff')}
- >
- Patient
-
- act('choiceOn')}
- >
- Options
-
-
-
+
+
+
+ act('choiceOff')}
+ >
+ Patient
+
+ act('choiceOn')}
+ >
+ Options
+
+
+
+
+
+
+
);
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/viewBodyRecordModalBodyOverride.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/BodyRecordModal.tsx
similarity index 55%
rename from tgui/packages/tgui/interfaces/ResleevingConsole/viewBodyRecordModalBodyOverride.tsx
rename to tgui/packages/tgui/interfaces/ResleevingConsole/BodyRecordModal.tsx
index 58b20b8a976..7aab7736dff 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/viewBodyRecordModalBodyOverride.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/BodyRecordModal.tsx
@@ -1,8 +1,9 @@
-import { useBackend } from '../../backend';
-import { Button, LabeledList, Section } from '../../components';
-import { modalBBodyData } from './types';
+import { Box, Button, LabeledList, Section } from 'tgui-core/components';
-export const viewBodyRecordModalBodyOverride = (modal: modalBBodyData) => {
+import { useBackend } from '../../backend';
+import { ActiveBodyRecordData } from './types';
+
+export const BodyRecordModal = (props: { data: ActiveBodyRecordData }) => {
const { act } = useBackend();
const {
activerecord,
@@ -13,32 +14,26 @@ export const viewBodyRecordModalBodyOverride = (modal: modalBBodyData) => {
synthetic,
oocnotes,
can_grow_active,
- } = modal.args;
+ } = props.data;
return (
act('modal_close')} />
+
);
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/viewMindRecordModalBodyOverride.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/MindRecordModal.tsx
similarity index 57%
rename from tgui/packages/tgui/interfaces/ResleevingConsole/viewMindRecordModalBodyOverride.tsx
rename to tgui/packages/tgui/interfaces/ResleevingConsole/MindRecordModal.tsx
index 18cfccb73a1..b9532910e94 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/viewMindRecordModalBodyOverride.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/MindRecordModal.tsx
@@ -1,8 +1,9 @@
-import { useBackend } from '../../backend';
-import { Button, LabeledList, Section } from '../../components';
-import { modalMindData } from './types';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, LabeledList, Section } from 'tgui-core/components';
-export const viewMindRecordModalBodyOverride = (modal: modalMindData) => {
+import { modalMindData as ActiveMindRecordData } from './types';
+
+export const MindRecordModal = (props: { data: ActiveMindRecordData }) => {
const { act } = useBackend();
const {
activerecord,
@@ -10,14 +11,14 @@ export const viewMindRecordModalBodyOverride = (modal: modalMindData) => {
obviously_dead,
oocnotes,
can_sleeve_active,
- } = modal.args;
+ } = props.data;
return (
act('modal_close')} />
+ act('clear_m_rec')} />
}
>
@@ -48,13 +49,18 @@ export const viewMindRecordModalBodyOverride = (modal: modalMindData) => {
Card
-
-
+
+
+
+
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleTexts.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleCoreDump.tsx
similarity index 79%
rename from tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleTexts.tsx
rename to tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleCoreDump.tsx
index f350fc85325..bab69e13355 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleTexts.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleCoreDump.tsx
@@ -1,5 +1,5 @@
-import { useBackend } from '../../backend';
-import { Box, Button, Dimmer, Flex, Icon } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Dimmer, Flex, Icon } from 'tgui-core/components';
export const ResleevingConsoleCoreDump = (props) => {
return (
@@ -26,6 +26,7 @@ export const ResleevingConsoleDiskPrep = (props) => {
!!WARNING!!
+
This will transfer all minds to the dump disk, and the TransCore will be
made unusable until post-shift maintenance! This should only be used in
@@ -50,3 +51,14 @@ export const ResleevingConsoleDiskPrep = (props) => {
);
};
+
+export const PulsingWarningTriangle = (props) => {
+ return (
+
+ );
+};
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleElements.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleElements.tsx
index 1eb7e8d069e..84ea81ff148 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleElements.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleElements.tsx
@@ -1,5 +1,7 @@
-import { useBackend } from '../../backend';
-import { Box, Button, NoticeBox, Section, Tabs } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Stack } from 'tgui-core/components';
+import { Box, Button, NoticeBox, Section, Tabs } from 'tgui-core/components';
+
import { MENU_BODY, MENU_MAIN, MENU_MIND } from './constants';
import { ResleevingConsolePodGrowers } from './ResleevingConsolePodGrowers';
import { ResleevingConsolePodSleevers } from './ResleevingConsolePodSleevers';
@@ -84,22 +86,24 @@ export const ResleevingConsoleTemp = (props) => {
const tempProp = { [temp.style]: true };
return (
-
-
- {temp.text}
-
- act('cleartemp')}
- />
-
-
+
+
+
+ {temp.text}
+
+ act('cleartemp')}
+ />
+
+
+
);
};
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodGrowers.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodGrowers.tsx
index 2bd4bd8d5bd..604f4b3b8dc 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodGrowers.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodGrowers.tsx
@@ -1,8 +1,8 @@
import { toFixed } from 'common/math';
+import { resolveAsset } from 'tgui/assets';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Icon, Image, ProgressBar } from 'tgui-core/components';
-import { resolveAsset } from '../../assets';
-import { useBackend } from '../../backend';
-import { Box, Button, Icon, Image, ProgressBar } from '../../components';
import { Data } from './types';
export const ResleevingConsolePodGrowers = (props) => {
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSleevers.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSleevers.tsx
index 34a9976ebb5..db314c2324c 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSleevers.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSleevers.tsx
@@ -1,6 +1,7 @@
-import { resolveAsset } from '../../assets';
-import { useBackend } from '../../backend';
-import { Box, Button, Image } from '../../components';
+import { resolveAsset } from 'tgui/assets';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Image } from 'tgui-core/components';
+
import { Data } from './types';
export const ResleevingConsolePodSleevers = (props) => {
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSpods.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSpods.tsx
index 87fde7a5d59..180d7e0e2fc 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSpods.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsolePodSpods.tsx
@@ -1,8 +1,8 @@
import { toFixed } from 'common/math';
+import { resolveAsset } from 'tgui/assets';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Icon, Image, ProgressBar } from 'tgui-core/components';
-import { resolveAsset } from '../../assets';
-import { useBackend } from '../../backend';
-import { Box, Button, Icon, Image, ProgressBar } from '../../components';
import { Data } from './types';
export const ResleevingConsolePodSpods = (props) => {
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleRecords.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleRecords.tsx
index 58153d9917b..a7ed4558105 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleRecords.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleRecords.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Box, Button, Flex, Icon } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, Button, Flex, Icon } from 'tgui-core/components';
+
import { record } from './types';
export const ResleevingConsoleRecords = (props: {
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleStatus.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleStatus.tsx
index ac7ff47a523..d7048de9e71 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleStatus.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/ResleevingConsoleStatus.tsx
@@ -1,5 +1,6 @@
-import { useBackend } from '../../backend';
-import { Box, LabeledList, Section } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Box, LabeledList, Section } from 'tgui-core/components';
+
import { Data } from './types';
export const ResleevingConsoleStatus = (props) => {
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/index.tsx b/tgui/packages/tgui/interfaces/ResleevingConsole/index.tsx
index 286582fc59e..c1257973bea 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/index.tsx
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/index.tsx
@@ -1,36 +1,39 @@
-import { useBackend } from '../../backend';
-import { Section } from '../../components';
+import { useBackend } from 'tgui/backend';
+import { Window } from 'tgui/layouts';
+import { Dimmer, Section, Stack } from 'tgui-core/components';
+
+import { BodyRecordModal } from './BodyRecordModal';
+import { MindRecordModal } from './MindRecordModal';
import {
- ComplexModal,
- modalRegisterBodyOverride,
-} from '../../interfaces/common/ComplexModal';
-import { Window } from '../../layouts';
+ ResleevingConsoleCoreDump,
+ ResleevingConsoleDiskPrep,
+} from './ResleevingConsoleCoreDump';
import {
ResleevingConsoleBody,
ResleevingConsoleNavigation,
ResleevingConsoleTemp,
} from './ResleevingConsoleElements';
import { ResleevingConsoleStatus } from './ResleevingConsoleStatus';
-import {
- ResleevingConsoleCoreDump,
- ResleevingConsoleDiskPrep,
-} from './ResleevingConsoleTexts';
import { Data } from './types';
-import { viewBodyRecordModalBodyOverride } from './viewBodyRecordModalBodyOverride';
-import { viewMindRecordModalBodyOverride } from './viewMindRecordModalBodyOverride';
export const ResleevingConsole = (props) => {
const { data } = useBackend();
const { coredumped, emergency } = data;
let body: React.JSX.Element = (
- <>
+
-
-
-
- >
+
+
+
+
+
+
+
+
+
+
);
if (coredumped) {
body = ;
@@ -38,14 +41,19 @@ export const ResleevingConsole = (props) => {
if (emergency) {
body = ;
}
- modalRegisterBodyOverride('view_b_rec', viewBodyRecordModalBodyOverride);
- modalRegisterBodyOverride('view_m_rec', viewMindRecordModalBodyOverride);
return (
-
-
- {body}
-
+ {data.active_b_rec && (
+
+
+
+ )}
+ {data.active_m_rec && (
+
+
+
+ )}
+ {body}
);
};
diff --git a/tgui/packages/tgui/interfaces/ResleevingConsole/types.ts b/tgui/packages/tgui/interfaces/ResleevingConsole/types.ts
index 8802231afbc..5b0368f601e 100644
--- a/tgui/packages/tgui/interfaces/ResleevingConsole/types.ts
+++ b/tgui/packages/tgui/interfaces/ResleevingConsole/types.ts
@@ -26,7 +26,8 @@ export type Data = {
selected_sleever: string;
bodyrecords: record[];
mindrecords: record[];
- modal: Partial;
+ active_b_rec: ActiveBodyRecordData | null;
+ active_m_rec: modalMindData | null;
};
type pod = {
@@ -37,33 +38,23 @@ type pod = {
progress: number;
};
-export type modalBBodyData = {
- id: string;
- text: string;
- args: {
- activerecord: string;
- realname: string;
- species: string;
- sex: string;
- mind_compat: string;
- synthetic: BooleanLike;
- oocnotes: string;
- can_grow_active: BooleanLike;
- };
- modal_type: string;
+export type ActiveBodyRecordData = {
+ activerecord: string;
+ realname: string;
+ species: string;
+ sex: string;
+ mind_compat: string;
+ synthetic: BooleanLike;
+ oocnotes: string;
+ can_grow_active: BooleanLike;
};
export type modalMindData = {
- id: string;
- text: string;
- args: {
- activerecord: string;
- realname: string;
- obviously_dead: string;
- oocnotes: string;
- can_sleeve_active: BooleanLike;
- };
- modal_type: string;
+ activerecord: string;
+ realname: string;
+ obviously_dead: string;
+ oocnotes: string;
+ can_sleeve_active: BooleanLike;
};
export type record = { name: string; recref: string };
diff --git a/tgui/packages/tgui/styles/interfaces/ResleevingConsole.scss b/tgui/packages/tgui/styles/interfaces/ResleevingConsole.scss
new file mode 100644
index 00000000000..33fd1918f48
--- /dev/null
+++ b/tgui/packages/tgui/styles/interfaces/ResleevingConsole.scss
@@ -0,0 +1,15 @@
+.ResleevingConsole__WarningTriangle {
+ animation: pulse 1s ease infinite;
+}
+
+@keyframes pulse {
+ 0% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
diff --git a/tgui/packages/tgui/styles/main.scss b/tgui/packages/tgui/styles/main.scss
index dcdf4c87894..7704bd3c26e 100644
--- a/tgui/packages/tgui/styles/main.scss
+++ b/tgui/packages/tgui/styles/main.scss
@@ -56,6 +56,7 @@
@include meta.load-css('./interfaces/NuclearBomb.scss');
@include meta.load-css('./interfaces/Paper.scss');
@include meta.load-css('./interfaces/Pda.scss');
+@include meta.load-css('./interfaces/ResleevingConsole.scss');
@include meta.load-css('./interfaces/Roulette.scss');
@include meta.load-css('./interfaces/Safe.scss');
@include meta.load-css('./interfaces/TachyonArray.scss');