mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
TGUI Fix Compilation
This commit is contained in:
@@ -209,12 +209,12 @@
|
|||||||
/mob/living/silicon/robot/proc/setup_PDA()
|
/mob/living/silicon/robot/proc/setup_PDA()
|
||||||
if (!rbPDA)
|
if (!rbPDA)
|
||||||
rbPDA = new/obj/item/device/pda/ai(src)
|
rbPDA = new/obj/item/device/pda/ai(src)
|
||||||
rbPDA.set_name_and_job(custom_name,"[modtype] [braintype]")
|
rbPDA.set_name_and_job(name,"[modtype] [braintype]")
|
||||||
|
|
||||||
/mob/living/silicon/robot/proc/setup_communicator()
|
/mob/living/silicon/robot/proc/setup_communicator()
|
||||||
if (!communicator)
|
if (!communicator)
|
||||||
communicator = new/obj/item/device/communicator/integrated(src)
|
communicator = new/obj/item/device/communicator/integrated(src)
|
||||||
communicator.register_device(src.name, "[modtype] [braintype]")
|
communicator.register_device(name, "[modtype] [braintype]")
|
||||||
|
|
||||||
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
|
//If there's an MMI in the robot, have it ejected when the mob goes away. --NEO
|
||||||
//Improved /N
|
//Improved /N
|
||||||
|
|||||||
@@ -181,6 +181,7 @@
|
|||||||
|
|
||||||
SStgui.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message
|
SStgui.update_user_uis(U, P) // Update the sending user's PDA UI so that they can see the new message
|
||||||
log_pda("(PDA: [src.name]) sent \"[t]\" to [P.name]", usr)
|
log_pda("(PDA: [src.name]) sent \"[t]\" to [P.name]", usr)
|
||||||
|
to_chat(U, "[bicon(pda)] <b>Sent message to [P.owner] ([P.ownjob]), </b>\"[t]\"")
|
||||||
else
|
else
|
||||||
to_chat(U, "<span class='notice'>ERROR: Messaging server is not responding.</span>")
|
to_chat(U, "<span class='notice'>ERROR: Messaging server is not responding.</span>")
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
|
|
||||||
/obj/structure/noticeboard/examine(mob/user)
|
/obj/structure/noticeboard/examine(mob/user)
|
||||||
tgui_interact(user)
|
tgui_interact(user)
|
||||||
return list()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/noticeboard/tgui_interact(mob/user, datum/tgui/ui)
|
/obj/structure/noticeboard/tgui_interact(mob/user, datum/tgui/ui)
|
||||||
ui = SStgui.try_update_ui(user, src, ui)
|
ui = SStgui.try_update_ui(user, src, ui)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const CookingAppliance = (props, context) => {
|
|||||||
<ProgressBar
|
<ProgressBar
|
||||||
color={temperatureEnough ? "good" : "blue"}
|
color={temperatureEnough ? "good" : "blue"}
|
||||||
value={temperature}
|
value={temperature}
|
||||||
maxValue={optimalTemp + 100}>
|
maxValue={optimalTemp}>
|
||||||
<AnimatedNumber value={temperature} />°C / {optimalTemp}°C
|
<AnimatedNumber value={temperature} />°C / {optimalTemp}°C
|
||||||
</ProgressBar>
|
</ProgressBar>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { formatSiUnit, formatMoney } from '../format';
|
|||||||
import { Flex, Section, Tabs, Box, Button, Fragment, ProgressBar, NumberInput, Icon, Input, Tooltip } from '../components';
|
import { Flex, Section, Tabs, Box, Button, Fragment, ProgressBar, NumberInput, Icon, Input, Tooltip } from '../components';
|
||||||
import { Window } from '../layouts';
|
import { Window } from '../layouts';
|
||||||
import { createSearch, toTitleCase } from 'common/string';
|
import { createSearch, toTitleCase } from 'common/string';
|
||||||
|
import { toFixed } from 'common/math';
|
||||||
|
|
||||||
const MATERIAL_KEYS = {
|
const MATERIAL_KEYS = {
|
||||||
"steel": "sheet-metal_3",
|
"steel": "sheet-metal_3",
|
||||||
@@ -41,7 +42,8 @@ const materialArrayToObj = materials => {
|
|||||||
let materialObj = {};
|
let materialObj = {};
|
||||||
|
|
||||||
materials.forEach(m => {
|
materials.forEach(m => {
|
||||||
materialObj[m.name] = m.amount; });
|
materialObj[m.name] = m.amount;
|
||||||
|
});
|
||||||
|
|
||||||
return materialObj;
|
return materialObj;
|
||||||
};
|
};
|
||||||
@@ -351,6 +353,18 @@ const MaterialAmount = (props, context) => {
|
|||||||
style,
|
style,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
|
let amountDisplay = "0";
|
||||||
|
if (amount < 1 && amount > 0) {
|
||||||
|
amountDisplay = toFixed(amount, 2);
|
||||||
|
} else if (formatsi) {
|
||||||
|
amountDisplay = formatSiUnit(amount, 0);
|
||||||
|
} else if (formatmoney) {
|
||||||
|
amountDisplay = formatMoney(amount);
|
||||||
|
} else {
|
||||||
|
amountDisplay = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
direction="column"
|
direction="column"
|
||||||
@@ -372,9 +386,7 @@ const MaterialAmount = (props, context) => {
|
|||||||
<Box
|
<Box
|
||||||
textColor={color}
|
textColor={color}
|
||||||
style={{ "text-align": "center" }}>
|
style={{ "text-align": "center" }}>
|
||||||
{(formatsi && formatSiUnit(amount, 0))
|
{amountDisplay}
|
||||||
|| (formatmoney && formatMoney(amount))
|
|
||||||
|| (amount)}
|
|
||||||
</Box>
|
</Box>
|
||||||
</Flex.Item>
|
</Flex.Item>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ const ResearchConsoleViewDesigns = (props, context) => {
|
|||||||
value={data.search}
|
value={data.search}
|
||||||
onInput={(e, v) => act("search", { search: v })}
|
onInput={(e, v) => act("search", { search: v })}
|
||||||
mb={1} />
|
mb={1} />
|
||||||
|
{(designs && designs.length && (
|
||||||
<LabeledList>
|
<LabeledList>
|
||||||
{designs.map(design => (
|
{designs.map(design => (
|
||||||
<LabeledList.Item label={design.name} key={design.name}>
|
<LabeledList.Item label={design.name} key={design.name}>
|
||||||
@@ -105,6 +106,9 @@ const ResearchConsoleViewDesigns = (props, context) => {
|
|||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
))}
|
))}
|
||||||
</LabeledList>
|
</LabeledList>
|
||||||
|
)) || (
|
||||||
|
<Box color="warning">No designs found.</Box>
|
||||||
|
)}
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -439,7 +443,7 @@ const ResearchConsoleBuildMenu = (props, context) => {
|
|||||||
value={data.search}
|
value={data.search}
|
||||||
onInput={(e, v) => act("search", { search: v })}
|
onInput={(e, v) => act("search", { search: v })}
|
||||||
mb={1} />
|
mb={1} />
|
||||||
{designs.length ? designs.map(design => (
|
{designs && designs.length ? designs.map(design => (
|
||||||
<Fragment key={design.id}>
|
<Fragment key={design.id}>
|
||||||
<Flex width="100%" justify="space-between">
|
<Flex width="100%" justify="space-between">
|
||||||
<Flex.Item width="40%" style={{ "word-wrap": "break-all" }}>
|
<Flex.Item width="40%" style={{ "word-wrap": "break-all" }}>
|
||||||
@@ -520,6 +524,25 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
|
|
||||||
const [protoTab, setProtoTab] = useSharedState(context, "protoTab", 0);
|
const [protoTab, setProtoTab] = useSharedState(context, "protoTab", 0);
|
||||||
|
|
||||||
|
let queueColor = "transparent";
|
||||||
|
let queueSpin = false;
|
||||||
|
let queueIcon = "layer-group";
|
||||||
|
if (busy) {
|
||||||
|
queueIcon = "hammer";
|
||||||
|
queueColor = "average";
|
||||||
|
queueSpin = true;
|
||||||
|
} else if (queue && queue.length) {
|
||||||
|
queueIcon = "sync";
|
||||||
|
queueColor = "green";
|
||||||
|
queueSpin = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Proto vs Circuit differences
|
||||||
|
let removeQueueAction = (name === "Protolathe") ? "removeP" : "removeI";
|
||||||
|
let ejectSheetAction = (name === "Protolathe") ? "lathe_ejectsheet" : "imprinter_ejectsheet";
|
||||||
|
let ejectChemAction = (name === "Protolathe") ? "disposeP" : "disposeI";
|
||||||
|
let ejectAllChemAction = (name === "Protolathe") ? "disposeallP" : "disposeallI";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section title={name} buttons={busy && (
|
<Section title={name} buttons={busy && (
|
||||||
<Icon
|
<Icon
|
||||||
@@ -550,9 +573,9 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
Build
|
Build
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
<Tabs.Tab
|
<Tabs.Tab
|
||||||
icon="layer-group"
|
icon={queueIcon}
|
||||||
iconSpin={busy}
|
iconSpin={queueSpin}
|
||||||
color={busy ? "average" : "transparent"}
|
color={queueColor}
|
||||||
selected={protoTab === 1}
|
selected={protoTab === 1}
|
||||||
onClick={() => setProtoTab(1)}>
|
onClick={() => setProtoTab(1)}>
|
||||||
Queue
|
Queue
|
||||||
@@ -588,7 +611,7 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
<Button
|
<Button
|
||||||
ml={1}
|
ml={1}
|
||||||
icon="trash"
|
icon="trash"
|
||||||
onClick={() => act("removeP", { removeP: item.index })}>
|
onClick={() => act(removeQueueAction, { [removeQueueAction]: item.index })}>
|
||||||
Remove
|
Remove
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -602,7 +625,7 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
<LabeledList.Item label={item.name} key={item.name}>
|
<LabeledList.Item label={item.name} key={item.name}>
|
||||||
<Button
|
<Button
|
||||||
icon="trash"
|
icon="trash"
|
||||||
onClick={() => act("removeP", { removeP: item.index })}>
|
onClick={() => act(removeQueueAction, { [removeQueueAction]: item.index })}>
|
||||||
Remove
|
Remove
|
||||||
</Button>
|
</Button>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
@@ -631,14 +654,14 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
disabled={!mat.removable}
|
disabled={!mat.removable}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setEjectAmt(0);
|
setEjectAmt(0);
|
||||||
act("lathe_ejectsheet", { lathe_ejectsheet: mat.name, amount: ejectAmt });
|
act(ejectSheetAction, { [ejectSheetAction]: mat.name, amount: ejectAmt });
|
||||||
}}>
|
}}>
|
||||||
Num
|
Num
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
icon="eject"
|
icon="eject"
|
||||||
disabled={!mat.removable}
|
disabled={!mat.removable}
|
||||||
onClick={() => act("lathe_ejectsheet", { lathe_ejectsheet: mat.name, amount: 50 })}>
|
onClick={() => act(ejectSheetAction, { [ejectSheetAction]: mat.name, amount: 50 })}>
|
||||||
All
|
All
|
||||||
</Button>
|
</Button>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
@@ -657,7 +680,7 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
<Button
|
<Button
|
||||||
ml={1}
|
ml={1}
|
||||||
icon="eject"
|
icon="eject"
|
||||||
onClick={() => act("disposeP", { dispose: chem.id })}>
|
onClick={() => act(ejectChemAction, { dispose: chem.id })}>
|
||||||
Purge
|
Purge
|
||||||
</Button>
|
</Button>
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
@@ -670,7 +693,7 @@ const ResearchConsoleConstructor = (props, context) => {
|
|||||||
<Button
|
<Button
|
||||||
mt={1}
|
mt={1}
|
||||||
icon="trash"
|
icon="trash"
|
||||||
onClick={() => act("disposeallP")}>
|
onClick={() => act(ejectAllChemAction)}>
|
||||||
Disposal All Chemicals In Storage
|
Disposal All Chemicals In Storage
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -800,9 +823,11 @@ const ResearchConsoleSettings = (props, context) => {
|
|||||||
|
|
||||||
const menus = [
|
const menus = [
|
||||||
{ name: "Protolathe", icon: "wrench", template: <ResearchConsoleConstructor name="Protolathe" /> },
|
{ name: "Protolathe", icon: "wrench", template: <ResearchConsoleConstructor name="Protolathe" /> },
|
||||||
{ name: "Circuit Imprinter",
|
{
|
||||||
|
name: "Circuit Imprinter",
|
||||||
icon: "digital-tachograph",
|
icon: "digital-tachograph",
|
||||||
template: <ResearchConsoleConstructor name="Circuit Imprinter" /> },
|
template: <ResearchConsoleConstructor name="Circuit Imprinter" />,
|
||||||
|
},
|
||||||
{ name: "Destructive Analyzer", icon: "eraser", template: <ResearchConsoleDestructiveAnalyzer /> },
|
{ name: "Destructive Analyzer", icon: "eraser", template: <ResearchConsoleDestructiveAnalyzer /> },
|
||||||
{ name: "Settings", icon: "cog", template: <ResearchConsoleSettings /> },
|
{ name: "Settings", icon: "cog", template: <ResearchConsoleSettings /> },
|
||||||
{ name: "Research List", icon: "flask", template: <ResearchConsoleViewResearch /> },
|
{ name: "Research List", icon: "flask", template: <ResearchConsoleViewResearch /> },
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ const ExploitableInformation = (props, context) => {
|
|||||||
<LabeledList.Divider />
|
<LabeledList.Divider />
|
||||||
<LabeledList.Item>Acquired Information</LabeledList.Item>
|
<LabeledList.Item>Acquired Information</LabeledList.Item>
|
||||||
<LabeledList.Item label="Notes">
|
<LabeledList.Item label="Notes">
|
||||||
{exploit.nanoui_exploit_record}
|
{exploit.nanoui_exploit_record.split("<br>").map(m => <Box key={m}>{m}</Box>)}
|
||||||
</LabeledList.Item>
|
</LabeledList.Item>
|
||||||
</LabeledList>
|
</LabeledList>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user