TGUI Fix Compilation

This commit is contained in:
Chompstation Bot
2021-04-19 18:13:08 +00:00
parent 4b4d522565
commit 1bc56b471f
8 changed files with 87 additions and 37 deletions

View File

@@ -209,12 +209,12 @@
/mob/living/silicon/robot/proc/setup_PDA()
if (!rbPDA)
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()
if (!communicator)
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
//Improved /N

View File

@@ -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
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
to_chat(U, "<span class='notice'>ERROR: Messaging server is not responding.</span>")

View File

@@ -104,7 +104,7 @@
/obj/structure/noticeboard/examine(mob/user)
tgui_interact(user)
return list()
return ..()
/obj/structure/noticeboard/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)

View File

@@ -25,7 +25,7 @@ export const CookingAppliance = (props, context) => {
<ProgressBar
color={temperatureEnough ? "good" : "blue"}
value={temperature}
maxValue={optimalTemp + 100}>
maxValue={optimalTemp}>
<AnimatedNumber value={temperature} />&deg;C / {optimalTemp}&deg;C
</ProgressBar>
</LabeledList.Item>

View File

@@ -5,6 +5,7 @@ import { formatSiUnit, formatMoney } from '../format';
import { Flex, Section, Tabs, Box, Button, Fragment, ProgressBar, NumberInput, Icon, Input, Tooltip } from '../components';
import { Window } from '../layouts';
import { createSearch, toTitleCase } from 'common/string';
import { toFixed } from 'common/math';
const MATERIAL_KEYS = {
"steel": "sheet-metal_3",
@@ -41,7 +42,8 @@ const materialArrayToObj = materials => {
let materialObj = {};
materials.forEach(m => {
materialObj[m.name] = m.amount; });
materialObj[m.name] = m.amount;
});
return materialObj;
};
@@ -351,6 +353,18 @@ const MaterialAmount = (props, context) => {
style,
} = 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 (
<Flex
direction="column"
@@ -372,9 +386,7 @@ const MaterialAmount = (props, context) => {
<Box
textColor={color}
style={{ "text-align": "center" }}>
{(formatsi && formatSiUnit(amount, 0))
|| (formatmoney && formatMoney(amount))
|| (amount)}
{amountDisplay}
</Box>
</Flex.Item>
</Flex>
@@ -760,7 +772,7 @@ const QueueList = (props, context) => {
mr={1}
icon="minus-circle"
color="bad"
onClick={() => act("del_queue_part", { index: index+1 })} />
onClick={() => act("del_queue_part", { index: index + 1 })} />
</Flex.Item>
<Flex.Item>
<Box
@@ -817,7 +829,7 @@ const BeingBuilt = (props, context) => {
printTime,
} = buildingPart;
const timeLeft = Math.ceil(duration/10);
const timeLeft = Math.ceil(duration / 10);
return (
<Box>

View File

@@ -98,6 +98,7 @@ const ResearchConsoleViewDesigns = (props, context) => {
value={data.search}
onInput={(e, v) => act("search", { search: v })}
mb={1} />
{(designs && designs.length && (
<LabeledList>
{designs.map(design => (
<LabeledList.Item label={design.name} key={design.name}>
@@ -105,6 +106,9 @@ const ResearchConsoleViewDesigns = (props, context) => {
</LabeledList.Item>
))}
</LabeledList>
)) || (
<Box color="warning">No designs found.</Box>
)}
</Section>
);
};
@@ -439,7 +443,7 @@ const ResearchConsoleBuildMenu = (props, context) => {
value={data.search}
onInput={(e, v) => act("search", { search: v })}
mb={1} />
{designs.length ? designs.map(design => (
{designs && designs.length ? designs.map(design => (
<Fragment key={design.id}>
<Flex width="100%" justify="space-between">
<Flex.Item width="40%" style={{ "word-wrap": "break-all" }}>
@@ -520,6 +524,25 @@ const ResearchConsoleConstructor = (props, context) => {
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 (
<Section title={name} buttons={busy && (
<Icon
@@ -550,9 +573,9 @@ const ResearchConsoleConstructor = (props, context) => {
Build
</Tabs.Tab>
<Tabs.Tab
icon="layer-group"
iconSpin={busy}
color={busy ? "average" : "transparent"}
icon={queueIcon}
iconSpin={queueSpin}
color={queueColor}
selected={protoTab === 1}
onClick={() => setProtoTab(1)}>
Queue
@@ -588,7 +611,7 @@ const ResearchConsoleConstructor = (props, context) => {
<Button
ml={1}
icon="trash"
onClick={() => act("removeP", { removeP: item.index })}>
onClick={() => act(removeQueueAction, { [removeQueueAction]: item.index })}>
Remove
</Button>
</Box>
@@ -602,7 +625,7 @@ const ResearchConsoleConstructor = (props, context) => {
<LabeledList.Item label={item.name} key={item.name}>
<Button
icon="trash"
onClick={() => act("removeP", { removeP: item.index })}>
onClick={() => act(removeQueueAction, { [removeQueueAction]: item.index })}>
Remove
</Button>
</LabeledList.Item>
@@ -631,14 +654,14 @@ const ResearchConsoleConstructor = (props, context) => {
disabled={!mat.removable}
onClick={() => {
setEjectAmt(0);
act("lathe_ejectsheet", { lathe_ejectsheet: mat.name, amount: ejectAmt });
act(ejectSheetAction, { [ejectSheetAction]: mat.name, amount: ejectAmt });
}}>
Num
</Button>
<Button
icon="eject"
disabled={!mat.removable}
onClick={() => act("lathe_ejectsheet", { lathe_ejectsheet: mat.name, amount: 50 })}>
onClick={() => act(ejectSheetAction, { [ejectSheetAction]: mat.name, amount: 50 })}>
All
</Button>
</Fragment>
@@ -657,7 +680,7 @@ const ResearchConsoleConstructor = (props, context) => {
<Button
ml={1}
icon="eject"
onClick={() => act("disposeP", { dispose: chem.id })}>
onClick={() => act(ejectChemAction, { dispose: chem.id })}>
Purge
</Button>
</LabeledList.Item>
@@ -670,7 +693,7 @@ const ResearchConsoleConstructor = (props, context) => {
<Button
mt={1}
icon="trash"
onClick={() => act("disposeallP")}>
onClick={() => act(ejectAllChemAction)}>
Disposal All Chemicals In Storage
</Button>
</Box>
@@ -800,9 +823,11 @@ const ResearchConsoleSettings = (props, context) => {
const menus = [
{ name: "Protolathe", icon: "wrench", template: <ResearchConsoleConstructor name="Protolathe" /> },
{ name: "Circuit Imprinter",
{
name: "Circuit Imprinter",
icon: "digital-tachograph",
template: <ResearchConsoleConstructor name="Circuit Imprinter" /> },
template: <ResearchConsoleConstructor name="Circuit Imprinter" />,
},
{ name: "Destructive Analyzer", icon: "eraser", template: <ResearchConsoleDestructiveAnalyzer /> },
{ name: "Settings", icon: "cog", template: <ResearchConsoleSettings /> },
{ name: "Research List", icon: "flask", template: <ResearchConsoleViewResearch /> },

View File

@@ -137,7 +137,7 @@ const ExploitableInformation = (props, context) => {
<LabeledList.Divider />
<LabeledList.Item>Acquired Information</LabeledList.Item>
<LabeledList.Item label="Notes">
{exploit.nanoui_exploit_record}
{exploit.nanoui_exploit_record.split("<br>").map(m => <Box key={m}>{m}</Box>)}
</LabeledList.Item>
</LabeledList>
</Box>

File diff suppressed because one or more lines are too long