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() /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

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 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>")

View File

@@ -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)

View File

@@ -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} />&deg;C / {optimalTemp}&deg;C <AnimatedNumber value={temperature} />&deg;C / {optimalTemp}&deg;C
</ProgressBar> </ProgressBar>
</LabeledList.Item> </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 { 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;
}; };
@@ -147,7 +149,7 @@ export const ExosuitFabricator = (props, context) => {
displayMatCost, displayMatCost,
setDisplayMatCost, setDisplayMatCost,
] = useSharedState(context, "display_mats", false); ] = useSharedState(context, "display_mats", false);
const [ const [
displayAllMat, displayAllMat,
setDisplayAllMat, setDisplayAllMat,
@@ -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>
@@ -559,7 +571,7 @@ const PartCategory = (props, context) => {
<Flex.Item> <Flex.Item>
<Button <Button
disabled={buildingPart disabled={buildingPart
|| (part.format.textColor === COLOR_BAD)} || (part.format.textColor === COLOR_BAD)}
color="good" color="good"
height="20px" height="20px"
mr={1} mr={1}
@@ -590,8 +602,8 @@ const PartCategory = (props, context) => {
height="20px" height="20px"
tooltip={ tooltip={
"Build Time: " "Build Time: "
+ part.printTime + "s. " + part.printTime + "s. "
+ (part.desc || "") + (part.desc || "")
} }
tooltipPosition="left" /> tooltipPosition="left" />
</Flex.Item> </Flex.Item>
@@ -760,7 +772,7 @@ const QueueList = (props, context) => {
mr={1} mr={1}
icon="minus-circle" icon="minus-circle"
color="bad" color="bad"
onClick={() => act("del_queue_part", { index: index+1 })} /> onClick={() => act("del_queue_part", { index: index + 1 })} />
</Flex.Item> </Flex.Item>
<Flex.Item> <Flex.Item>
<Box <Box
@@ -817,7 +829,7 @@ const BeingBuilt = (props, context) => {
printTime, printTime,
} = buildingPart; } = buildingPart;
const timeLeft = Math.ceil(duration/10); const timeLeft = Math.ceil(duration / 10);
return ( return (
<Box> <Box>

View File

@@ -98,13 +98,17 @@ 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} />
<LabeledList> {(designs && designs.length && (
{designs.map(design => ( <LabeledList>
<LabeledList.Item label={design.name} key={design.name}> {designs.map(design => (
{design.desc} <LabeledList.Item label={design.name} key={design.name}>
</LabeledList.Item> {design.desc}
))} </LabeledList.Item>
</LabeledList> ))}
</LabeledList>
)) || (
<Box color="warning">No designs found.</Box>
)}
</Section> </Section>
); );
}; };
@@ -228,7 +232,7 @@ const DataDisk = (props, context) => {
if (saveDialog) { if (saveDialog) {
return ( return (
<Section <Section
title={<PaginationTitle title="Load Design to Disk" target="design_page" />} title={<PaginationTitle title="Load Design to Disk" target="design_page" />}
buttons={ buttons={
<Fragment> <Fragment>
@@ -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 /> },

View File

@@ -11,7 +11,7 @@ export const Uplink = (props, context) => {
const { data } = useBackend(context); const { data } = useBackend(context);
const [screen, setScreen] = useLocalState(context, 'screen', 0); const [screen, setScreen] = useLocalState(context, 'screen', 0);
const { telecrystals } = data; const { telecrystals } = data;
return ( return (
<Window <Window
@@ -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