mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Earlyport Resleeving Fixes
Earlyport of https://github.com/VOREStation/VOREStation/pull/8643 with a minor change increasing the linter from 80 -> 120, the rest of the backend tweaks/fixes will make their way downstream afterwards.
This commit is contained in:
@@ -97,6 +97,7 @@
|
|||||||
active_br = new /datum/transhuman/body_record(brDisk.stored) // Loads a COPY!
|
active_br = new /datum/transhuman/body_record(brDisk.stored) // Loads a COPY!
|
||||||
to_chat(user, "<span class='notice'>\The [src] loads the body record from \the [W] before ejecting it.</span>")
|
to_chat(user, "<span class='notice'>\The [src] loads the body record from \the [W] before ejecting it.</span>")
|
||||||
attack_hand(user)
|
attack_hand(user)
|
||||||
|
view_b_rec("view_b_rec", list("ref" = "\ref[active_br]"))
|
||||||
else
|
else
|
||||||
..()
|
..()
|
||||||
return
|
return
|
||||||
@@ -216,42 +217,7 @@
|
|||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
if("view_b_rec")
|
if("view_b_rec")
|
||||||
var/ref = params["ref"]
|
view_b_rec(action, params)
|
||||||
if(!length(ref))
|
|
||||||
return
|
|
||||||
active_br = locate(ref)
|
|
||||||
if(istype(active_br))
|
|
||||||
if(isnull(active_br.ckey))
|
|
||||||
qdel(active_br)
|
|
||||||
set_temp("Error: Record corrupt.", "danger")
|
|
||||||
else
|
|
||||||
var/can_grow_active = 1
|
|
||||||
if(!synthetic_capable && active_br.synthetic) //Disqualified due to being synthetic in an organic only.
|
|
||||||
can_grow_active = 0
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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")
|
|
||||||
if("view_m_rec")
|
if("view_m_rec")
|
||||||
var/ref = params["ref"]
|
var/ref = params["ref"]
|
||||||
if(!length(ref))
|
if(!length(ref))
|
||||||
@@ -266,15 +232,12 @@
|
|||||||
if(!LAZYLEN(sleevers))
|
if(!LAZYLEN(sleevers))
|
||||||
can_sleeve_active = 0
|
can_sleeve_active = 0
|
||||||
set_temp("Error: Cannot sleeve due to no sleevers.", "danger")
|
set_temp("Error: Cannot sleeve due to no sleevers.", "danger")
|
||||||
return
|
|
||||||
if(!selected_sleever)
|
if(!selected_sleever)
|
||||||
can_sleeve_active = 0
|
can_sleeve_active = 0
|
||||||
set_temp("Error: Cannot sleeve due to no selected sleever.", "danger")
|
set_temp("Error: Cannot sleeve due to no selected sleever.", "danger")
|
||||||
return
|
|
||||||
if(selected_sleever && !selected_sleever.occupant)
|
if(selected_sleever && !selected_sleever.occupant)
|
||||||
can_sleeve_active = 0
|
can_sleeve_active = 0
|
||||||
set_temp("Error: Cannot sleeve due to lack of sleever occupant.", "danger")
|
set_temp("Error: Cannot sleeve due to lack of sleever occupant.", "danger")
|
||||||
return
|
|
||||||
var/list/payload = list(
|
var/list/payload = list(
|
||||||
activerecord = "\ref[active_mr]",
|
activerecord = "\ref[active_mr]",
|
||||||
realname = sanitize(active_mr.mindname),
|
realname = sanitize(active_mr.mindname),
|
||||||
@@ -519,6 +482,40 @@
|
|||||||
temp = list(text = text, style = style)
|
temp = list(text = text, style = style)
|
||||||
if(update_now)
|
if(update_now)
|
||||||
SStgui.update_uis(src)
|
SStgui.update_uis(src)
|
||||||
|
|
||||||
|
/obj/machinery/computer/transhuman/resleeving/proc/view_b_rec(action, params)
|
||||||
|
var/ref = params["ref"]
|
||||||
|
if(!length(ref))
|
||||||
|
return
|
||||||
|
active_br = locate(ref)
|
||||||
|
if(istype(active_br))
|
||||||
|
var/can_grow_active = 1
|
||||||
|
if(!synthetic_capable && active_br.synthetic) //Disqualified due to being synthetic in an organic only.
|
||||||
|
can_grow_active = 0
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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")
|
||||||
|
|
||||||
#undef MENU_MAIN
|
#undef MENU_MAIN
|
||||||
#undef MENU_BODY
|
#undef MENU_BODY
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ rules:
|
|||||||
# max-depth: error
|
# max-depth: error
|
||||||
## Enforce a maximum line length
|
## Enforce a maximum line length
|
||||||
max-len: [error, {
|
max-len: [error, {
|
||||||
code: 80,
|
code: 120, # Bump to 140 if this is still too in the way
|
||||||
## Ignore imports
|
## Ignore imports
|
||||||
ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
|
ignorePattern: '^(import\s.+\sfrom\s|.*require\()',
|
||||||
ignoreUrls: true,
|
ignoreUrls: true,
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export const Section = props => {
|
|||||||
'Section',
|
'Section',
|
||||||
'Section--level--' + level,
|
'Section--level--' + level,
|
||||||
fill && 'Section--fill',
|
fill && 'Section--fill',
|
||||||
|
scrollable && 'Section--scrollable',
|
||||||
flexGrow && 'Section--flex',
|
flexGrow && 'Section--flex',
|
||||||
className,
|
className,
|
||||||
...computeBoxClassName(rest),
|
...computeBoxClassName(rest),
|
||||||
|
|||||||
@@ -24,7 +24,13 @@ const viewMindRecordModalBodyOverride = (modal, context) => {
|
|||||||
level={2}
|
level={2}
|
||||||
m="-1rem"
|
m="-1rem"
|
||||||
pb="1rem"
|
pb="1rem"
|
||||||
title={"Mind Record (" + realname + ")"}>
|
title={"Mind Record (" + realname + ")"}
|
||||||
|
buttons={
|
||||||
|
<Button
|
||||||
|
icon="times"
|
||||||
|
color="red"
|
||||||
|
onClick={() => act('modal_close')} />
|
||||||
|
}>
|
||||||
<LabeledList>
|
<LabeledList>
|
||||||
<LabeledList.Item label="Name">
|
<LabeledList.Item label="Name">
|
||||||
{realname}
|
{realname}
|
||||||
@@ -52,7 +58,9 @@ const viewMindRecordModalBodyOverride = (modal, context) => {
|
|||||||
/>
|
/>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item label="OOC Notes">
|
<LabeledList.Item label="OOC Notes">
|
||||||
{oocnotes}
|
<Section style={{ 'word-break': 'break-all', 'height': '100px' }} scrollable>
|
||||||
|
{oocnotes}
|
||||||
|
</Section>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
</LabeledList>
|
</LabeledList>
|
||||||
</Section>
|
</Section>
|
||||||
@@ -76,7 +84,13 @@ const viewBodyRecordModalBodyOverride = (modal, context) => {
|
|||||||
level={2}
|
level={2}
|
||||||
m="-1rem"
|
m="-1rem"
|
||||||
pb="1rem"
|
pb="1rem"
|
||||||
title={"Body Record (" + realname + ")"}>
|
title={"Body Record (" + realname + ")"}
|
||||||
|
buttons={
|
||||||
|
<Button
|
||||||
|
icon="times"
|
||||||
|
color="red"
|
||||||
|
onClick={() => act('modal_close')} />
|
||||||
|
}>
|
||||||
<LabeledList>
|
<LabeledList>
|
||||||
<LabeledList.Item label="Name">
|
<LabeledList.Item label="Name">
|
||||||
{realname}
|
{realname}
|
||||||
@@ -94,7 +108,9 @@ const viewBodyRecordModalBodyOverride = (modal, context) => {
|
|||||||
{synthetic ? "Yes" : "No"}
|
{synthetic ? "Yes" : "No"}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item label="OOC Notes">
|
<LabeledList.Item label="OOC Notes">
|
||||||
{oocnotes}
|
<Section style={{ 'word-break': 'break-all', 'height': '100px' }} scrollable>
|
||||||
|
{oocnotes}
|
||||||
|
</Section>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
<LabeledList.Item label="Actions">
|
<LabeledList.Item label="Actions">
|
||||||
<Button
|
<Button
|
||||||
@@ -371,29 +387,6 @@ const ResleevingConsolePodSleevers = (props, context) => {
|
|||||||
|
|
||||||
if (sleevers && sleevers.length) {
|
if (sleevers && sleevers.length) {
|
||||||
return sleevers.map((pod, i) => {
|
return sleevers.map((pod, i) => {
|
||||||
let podAction;
|
|
||||||
if (!pod.occupied) {
|
|
||||||
podAction = (
|
|
||||||
<Box
|
|
||||||
mt={(spods && spods.length) ? "2rem" : "0.5rem"}
|
|
||||||
color="bad">
|
|
||||||
Sleever Empty.
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
podAction = (
|
|
||||||
<Button
|
|
||||||
selected={selected_sleever === pod.sleever}
|
|
||||||
icon={selected_sleever === pod.sleever && "check"}
|
|
||||||
content="Select"
|
|
||||||
mt={(spods && spods.length) ? "3rem" : "1.5rem"}
|
|
||||||
onClick={() => act('selectsleever', {
|
|
||||||
ref: pod.sleever,
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
key={i}
|
key={i}
|
||||||
@@ -408,10 +401,18 @@ const ResleevingConsolePodSleevers = (props, context) => {
|
|||||||
"-ms-interpolation-mode": "nearest-neighbor",
|
"-ms-interpolation-mode": "nearest-neighbor",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Box color="label">
|
<Box color={pod.occupied ? "label" : "bad"}>
|
||||||
{pod.name}
|
{pod.name}
|
||||||
</Box>
|
</Box>
|
||||||
{podAction}
|
<Button
|
||||||
|
selected={selected_sleever === pod.sleever}
|
||||||
|
icon={selected_sleever === pod.sleever && "check"}
|
||||||
|
content="Select"
|
||||||
|
mt={(spods && spods.length) ? "3rem" : "1.5rem"}
|
||||||
|
onClick={() => act('selectsleever', {
|
||||||
|
ref: pod.sleever,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -519,7 +520,7 @@ const ResleevingConsoleRecords = (props, context) => {
|
|||||||
} = props;
|
} = props;
|
||||||
if (!records.length) {
|
if (!records.length) {
|
||||||
return (
|
return (
|
||||||
<Flex height="100%">
|
<Flex height="100%" mt="0.5rem">
|
||||||
<Flex.Item
|
<Flex.Item
|
||||||
grow="1"
|
grow="1"
|
||||||
align="center"
|
align="center"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -66,6 +66,12 @@ $color-separator: colors.$primary !default;
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Section--scrollable .Section__content {
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 100%;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.Section--fill .Section__content {
|
.Section--fill .Section__content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user