mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Improved cloning UI (#26753)
Co-authored-by: Adrer <adrermail@gmail.com> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
var/feedback
|
||||
/// The desired outcome of the cloning process.
|
||||
var/datum/cloning_data/desired_data
|
||||
|
||||
/// Is the scanner currently scanning someone?
|
||||
var/currently_scanning = FALSE
|
||||
COOLDOWN_DECLARE(scancooldown)
|
||||
|
||||
/obj/machinery/computer/cloning/Initialize(mapload)
|
||||
@@ -157,6 +158,7 @@
|
||||
|
||||
if(scanner)
|
||||
data["has_scanned"] = scanner.has_scanned
|
||||
data["currently_scanning"] = currently_scanning
|
||||
else
|
||||
data["has_scanned"] = FALSE
|
||||
|
||||
@@ -231,7 +233,6 @@
|
||||
switch(text2num(params["tab"]))
|
||||
if(TAB_MAIN)
|
||||
tab = TAB_MAIN
|
||||
scanner?.update_scan_status()
|
||||
return TRUE
|
||||
if(TAB_DAMAGES_BREAKDOWN)
|
||||
tab = TAB_DAMAGES_BREAKDOWN
|
||||
@@ -256,6 +257,7 @@
|
||||
if(!scanner.occupant)
|
||||
return FALSE
|
||||
|
||||
currently_scanning = TRUE
|
||||
scanner.occupant.notify_ghost_cloning()
|
||||
feedback = list("text" = "Scanning occupant! Please wait...", "color" = "good", "scan_succeeded" = FALSE)
|
||||
COOLDOWN_START(src, scancooldown, 10 SECONDS)
|
||||
@@ -318,6 +320,7 @@
|
||||
if("eject")
|
||||
if(scanner?.occupant)
|
||||
scanner.remove_mob(scanner.occupant)
|
||||
currently_scanning = FALSE
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -352,5 +355,6 @@
|
||||
feedback = list("text" = "Successfully scanned the patient.", "color" = "good", "scan_succeeded" = TRUE)
|
||||
desired_data = generate_healthy_data(scan)
|
||||
|
||||
currently_scanning = FALSE
|
||||
#undef TAB_MAIN
|
||||
#undef TAB_DAMAGES_BREAKDOWN
|
||||
|
||||
@@ -111,8 +111,16 @@ const CloningConsoleMain = (props, context) => {
|
||||
|
||||
const CloningConsoleDamage = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
const { selected_pod_data, has_scanned, scanner_has_patient, feedback, scan_successful, cloning_cost, has_scanner } =
|
||||
data;
|
||||
const {
|
||||
selected_pod_data,
|
||||
has_scanned,
|
||||
scanner_has_patient,
|
||||
feedback,
|
||||
scan_successful,
|
||||
cloning_cost,
|
||||
has_scanner,
|
||||
currently_scanning,
|
||||
} = data;
|
||||
return (
|
||||
<Box>
|
||||
{!has_scanner && <Box color="average">Notice: No scanner connected.</Box>}
|
||||
@@ -123,21 +131,25 @@ const CloningConsoleDamage = (props, context) => {
|
||||
title="Scanner Info"
|
||||
buttons={
|
||||
<Box>
|
||||
<Button icon="hourglass-half" onClick={() => act('scan')}>
|
||||
<Button
|
||||
icon="hourglass-half"
|
||||
onClick={() => act('scan')}
|
||||
disabled={!scanner_has_patient || currently_scanning}
|
||||
>
|
||||
Scan
|
||||
</Button>
|
||||
<Button icon="eject" onClick={() => act('eject')}>
|
||||
<Button icon="eject" onClick={() => act('eject')} disabled={!scanner_has_patient || currently_scanning}>
|
||||
Eject Patient
|
||||
</Button>
|
||||
</Box>
|
||||
}
|
||||
>
|
||||
{!has_scanned && (
|
||||
{!has_scanned && !currently_scanning && (
|
||||
<Box color="average">
|
||||
{scanner_has_patient ? 'No scan detected for current patient.' : 'No patient is in the scanner.'}
|
||||
</Box>
|
||||
)}
|
||||
{!!has_scanned && <Box color={feedback['color']}>{feedback['text']}</Box>}
|
||||
{(!!has_scanned || !!currently_scanning) && <Box color={feedback['color']}>{feedback['text']}</Box>}
|
||||
</Section>
|
||||
<Section layer={2} title="Damages Breakdown">
|
||||
<Box>
|
||||
|
||||
+25
-25
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user