Clockworkslab, skillpanel, telecoms works now

This commit is contained in:
Artur
2020-07-02 23:21:11 +03:00
parent 0e51afade9
commit f46d0b9409
8 changed files with 176 additions and 163 deletions

View File

@@ -295,13 +295,13 @@
if(GLOB.ratvar_awakens) if(GLOB.ratvar_awakens)
return return
if(LAZYLEN(quickbound) < i || !quickbound[i]) if(LAZYLEN(quickbound) < i || !quickbound[i])
.["rec_binds"] += list() .["rec_binds"] += list(list())
else else
var/datum/clockwork_scripture/quickbind_slot = quickbound[i] var/datum/clockwork_scripture/quickbind_slot = quickbound[i]
.["rec_binds"] += list( .["rec_binds"] += list(list(
"name" = initial(quickbind_slot.name), "name" = initial(quickbind_slot.name),
"color" = get_component_color_bright(initial(quickbind_slot.primary_component)) "color" = get_component_color_bright(initial(quickbind_slot.primary_component))
) ))
// .["rec_section"]["title"] //this is here if ever we decided to return these back. // .["rec_section"]["title"] //this is here if ever we decided to return these back.
// .["rec_section"]["info"]// wall of info for the thing // .["rec_section"]["info"]// wall of info for the thing
@@ -313,7 +313,7 @@
INVOKE_ASYNC(src, .proc/recite_scripture, text2path(params["script"]), usr, FALSE) INVOKE_ASYNC(src, .proc/recite_scripture, text2path(params["script"]), usr, FALSE)
if("bind") if("bind")
var/datum/clockwork_scripture/path = text2path(params["script"]) //we need a path and not a string var/datum/clockwork_scripture/path = text2path(params["script"]) //we need a path and not a string
if(!path.quickbind || path.tier == SCRIPTURE_PERIPHERAL) //fuck you href bus if(!ispath(path, /datum/clockwork_scripture) || !initial(path.quickbind) || initial(path.tier) == SCRIPTURE_PERIPHERAL) //fuck you href bus
to_chat(usr, "<span class='warning'>Nice try using href exploits</span>") to_chat(usr, "<span class='warning'>Nice try using href exploits</span>")
return return
var/found_index = quickbound.Find(path) var/found_index = quickbound.Find(path)

View File

@@ -16,6 +16,7 @@ export const ClockworkSlab = (props, context) => {
recollection = true, recollection = true,
recollection_categories = [], recollection_categories = [],
rec_section = null, rec_section = null,
rec_binds = [],
scripture = {}, // this is a {}, not a [] scripture = {}, // this is a {}, not a []
tier_infos = {}, tier_infos = {},
power = "0 W", power = "0 W",
@@ -88,38 +89,37 @@ export const ClockworkSlab = (props, context) => {
</Fragment> </Fragment>
)} )}
</Box> </Box>
{!!recollection_categories {recollection_categories?.map(cat => {
&& recollection_categories.map(cat => { return (
return ( <Fragment key={cat.name} >
<Fragment key={cat.name} > <br />
<br /> <Button
<Button content={cat.name}
content={cat.name} tooltip={cat.desc}
tooltip={cat.desc} tooltipPosition={'right'}
tooltipPosition={'right'} onClick={() => act('rec_category', {
onClick={() => act('rec_category', { "category": cat.name,
"category": cat.name, })} />
})} /> </Fragment>
</Fragment> );
); })}
})}
<Box> <Box>
{data.rec_section} {data.rec_section}
<Box <Box
as={'span'} as={'span'}
textColor={'#BE8700'} textColor={'#BE8700'}
fontSize={2.3}> fontSize={2.3}>
{rec_section ? ( {rec_section?.title ? (
'500 Server Internal archives not found.'
) : (
rec_section.title rec_section.title
) : (
'500 Server Internal archives not found.'
)} )}
</Box> </Box>
<br /><br /> <br /><br />
{rec_section ? ( {rec_section?.info ? (
"One of the cogscarabs must've misplaced this section."
) : (
rec_section.info rec_section.info
) : (
"One of the cogscarabs must've misplaced this section."
)} )}
</Box> </Box>
<br /> <br />
@@ -136,7 +136,7 @@ export const ClockworkSlab = (props, context) => {
action buttons for easy use. action buttons for easy use.
</Box> </Box>
<br /><br /> <br /><br />
{!!data.rec_binds && data.rec_binds.map(bind => ( {rec_binds?.map(bind => (
<Fragment key={bind.name}> <Fragment key={bind.name}>
A <b>Quickbind</b> slot ({data.rec_binds[bind]}), A <b>Quickbind</b> slot ({data.rec_binds[bind]}),
currently set to currently set to
@@ -144,7 +144,7 @@ export const ClockworkSlab = (props, context) => {
as={'span'} as={'span'}
textColor={bind ? bind.color : "#BE8700"} textColor={bind ? bind.color : "#BE8700"}
bold> bold>
{bind ? bind.name : "None"} {bind?.name ? bind.name : "None"}
</Box> </Box>
. .
<br /> <br />

View File

@@ -1,6 +1,7 @@
import { Fragment } from 'inferno'; import { Fragment } from 'inferno';
import { useBackend } from '../backend'; import { useBackend } from '../backend';
import { Box, Button, LabeledList, ProgressBar, Section, Window } from '../components'; import { Window } from '../layouts';
import { Box, Button, LabeledList, ProgressBar, Section } from '../components';
export const SkillPanel = (props, context) => { export const SkillPanel = (props, context) => {
const { act, data } = useBackend(context); const { act, data } = useBackend(context);
@@ -31,7 +32,7 @@ export const SkillPanel = (props, context) => {
<span style={skillyellow}> <span style={skillyellow}>
{skill.desc} {skill.desc}
<br /> <br />
`Modifiers: ${skill.modifiers}` Modifiers: {skill.modifiers}
</span> </span>
<br /> <br />
{!!skill.level_based && ( {!!skill.level_based && (

View File

@@ -68,7 +68,7 @@ export const TelecommsInteraction = (props, context) => {
color={power ? 'good' : 'bad'}> color={power ? 'good' : 'bad'}>
{prefab ? 'TRUE' : 'FALSE'} {prefab ? 'TRUE' : 'FALSE'}
</LabeledList.Item> </LabeledList.Item>
{isrelay ? ( {!!isrelay && (
<Fragment> <Fragment>
<LabeledList.Item label="Broadcasting"> <LabeledList.Item label="Broadcasting">
<Button <Button
@@ -91,8 +91,6 @@ export const TelecommsInteraction = (props, context) => {
/> />
</LabeledList.Item> </LabeledList.Item>
</Fragment> </Fragment>
) : (
''
)} )}
{!!isbus && ( {!!isbus && (
<LabeledList.Item label="Change Signal Frequency"> <LabeledList.Item label="Change Signal Frequency">
@@ -210,6 +208,7 @@ export const TelecommsInteraction = (props, context) => {
return ( return (
<Button <Button
key={thing} key={thing}
icon="times"
content={valid ? ( content={valid ? (
<span style={`color: ${valid.color}`}> <span style={`color: ${valid.color}`}>
{`${thing} (${valid.name})`} {`${thing} (${valid.name})`}

View File

@@ -17,9 +17,9 @@ export const TelecommsLogBrowser = (props, context) => {
setTab, setTab,
] = useSharedState(context, 'tab', 'servers'); ] = useSharedState(context, 'tab', 'servers');
const operational = (selected && selected.status); const operational = (selected && selected.status);
if (!operational) { // some sanity checks. // if (!operational) { // some sanity checks.
setTab("servers"); // setTab("servers");
} // }
return ( return (
<Window theme="ntos"> <Window theme="ntos">
<Window.Content scrollable> <Window.Content scrollable>
@@ -102,11 +102,13 @@ export const TelecommsLogBrowser = (props, context) => {
<Tabs> <Tabs>
<Tabs.Tab <Tabs.Tab
selected={tab === "servers"} selected={tab === "servers"}
icon="server"
onClick={() => setTab("servers")}> onClick={() => setTab("servers")}>
Servers Servers
</Tabs.Tab> </Tabs.Tab>
<Tabs.Tab <Tabs.Tab
disabled={!operational} disabled={!operational}
icon="file"
selected={tab === "messages"} selected={tab === "messages"}
onClick={() => setTab("messages")}> onClick={() => setTab("messages")}>
Messages Messages

View File

@@ -19,9 +19,10 @@ export const TelecommsMonitor = (props, context) => {
setTab, setTab,
] = useSharedState(context, 'tab', 'network-entity'); ] = useSharedState(context, 'tab', 'network-entity');
const operational = (selected && selected.status); const operational = (selected && selected.status);
if (!selected) { // some sanity checks. // if (!selected) { // some sanity checks.
setTab("network-entity"); // setTab("network-entity");
} // }
return ( return (
<Window theme="ntos" resizable> <Window theme="ntos" resizable>
<Window.Content scrollable> <Window.Content scrollable>
@@ -93,11 +94,13 @@ export const TelecommsMonitor = (props, context) => {
<Tabs> <Tabs>
<Tabs.Tab <Tabs.Tab
selected={tab === "network-entity"} selected={tab === "network-entity"}
icon="server"
onClick={() => setTab("network-entity")}> onClick={() => setTab("network-entity")}>
Network Entities Network Entities
</Tabs.Tab> </Tabs.Tab>
<Tabs.Tab <Tabs.Tab
disabled={!selected} disabled={!selected}
icon="tasks"
selected={tab === "network-stat"} selected={tab === "network-stat"}
onClick={() => setTab("network-stat")}> onClick={() => setTab("network-stat")}>
Entity Status Entity Status

View File

@@ -1,15 +1,9 @@
import { Fragment } from 'inferno'; import { Fragment } from 'inferno';
import { Window } from '../layouts'; import { Window } from '../layouts';
import { useBackend, useSharedState } from '../backend'; import { useBackend, useSharedState } from '../backend';
import { act as _act } from '../byond'; // something something image shit (untested) import { callByond } from '../byond';
import { Button, LabeledList, NoticeBox, Section, Tabs, Input } from '../components'; import { Button, LabeledList, NoticeBox, Section, Tabs, Input } from '../components';
const prioritycolorMap = {
'Normal': 'warning',
'High': 'bad',
'Extreme': 'bad',
};
// This is the entrypoint, don't mind the others // This is the entrypoint, don't mind the others
export const TelecommsPDALog = (props, context) => { export const TelecommsPDALog = (props, context) => {
const { act, data } = useBackend(context); const { act, data } = useBackend(context);
@@ -18,6 +12,8 @@ export const TelecommsPDALog = (props, context) => {
notice = "", notice = "",
authenticated = false, authenticated = false,
canhack = false, canhack = false,
silicon = false,
hack_status = null,
selected = null, selected = null,
servers = [], servers = [],
} = data; } = data;
@@ -26,41 +22,46 @@ export const TelecommsPDALog = (props, context) => {
setTab, setTab,
] = useSharedState(context, 'tab', 'pdalog-servers'); ] = useSharedState(context, 'tab', 'pdalog-servers');
const valid = (selected && selected.status && authenticated); const valid = (selected && selected.status && authenticated);
if (!valid || data.hacking) { // a sanity check. // if (!valid || data.hacking) { // a sanity check.
setTab('pdalog-servers'); // setTab('pdalog-servers');
} // }
if (data.hacking) { if (hack_status) {
return ( // should have used en -> jp unicode -> other encoding method->utf8 return ( // should have used en -> jp unicode -> other encoding method->utf8
<NoticeBox> <Window theme="ntos" resizable>
<b> <Window.Content scrollable>
<h3> <NoticeBox>
{"INTRN@L ACfES VIOL<4F>TIa█ DEtE₡TED! Ree3ARcinG A█ \ <b>
BAaKUP RdST<53>RE PbINT [0xcff32ca] - PLfASE aAIT"} <h3>
</h3> {"INTRN@L ACfES VIOL<4F>TIa█ DEtE₡TED! Ree3ARcinG A█ \
</b> BAaKUP RdST<53>RE PbINT [0xcff32ca] - PLfASE aAIT"}
<i> </h3>
{data.borg ? ( </b>
<Fragment> <i>
Brute-forcing for server key. <br /> {(silicon && !hack_status.emagging) ? (
It will take 20 seconds for every character that the password has. <Fragment>
<br /> Brute-forcing for server key. <br />
In the meantime, this console can reveal your It will take 20 seconds for every character that
true intentions if you let someone access it. the password has.
Make sure no humans enter the room during that time. <br />
</Fragment> In the meantime, this console can reveal your
) : ( true intentions if you let someone access it.
<Fragment> Make sure no humans enter the room during that time.
QnJ1dGUtZm9yY2luZyBmb3Igc2VydmVyIGtleS48YnI+IEl0IHdpbG<br /> </Fragment>
wgdGFrZSAyMCBzZWNvbmRzIGZvciBldmVyeSBjaGFyYWN0ZXIgdGhh<br /> ) : (
dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br /> <Fragment>
MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br /> QnJ1dGUtZm9yY2luZyBmb3Igc2VydmVyIGtleS48YnI+IEl0IHdpbG<br />
IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br /> wgdGFrZSAyMCBzZWNvbmRzIGZvciBldmVyeSBjaGFyYWN0ZXIgdGhh<br />
BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=<br /> dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br />
<br /> MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br />
</Fragment> IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br />
)} BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=
</i> <br /><br />
</NoticeBox> </Fragment>
)}
</i>
</NoticeBox>
</Window.Content>
</Window>
); );
} }
@@ -171,24 +172,28 @@ export const TelecommsPDALog = (props, context) => {
</Section> </Section>
<Tabs> <Tabs>
<Tabs.Tab <Tabs.Tab
icon="server"
selected={tab === "pdalog-servers"} selected={tab === "pdalog-servers"}
onClick={() => setTab("pdalog-servers")}> onClick={() => setTab("pdalog-servers")}>
Servers Servers
</Tabs.Tab> </Tabs.Tab>
<Tabs.Tab <Tabs.Tab
disabled={!valid} disabled={!valid}
icon="file"
selected={tab === "pdalog-message"} selected={tab === "pdalog-message"}
onClick={() => setTab("pdalog-message")}> onClick={() => setTab("pdalog-message")}>
Message Logs Message Logs
</Tabs.Tab> </Tabs.Tab>
<Tabs.Tab <Tabs.Tab
disabled={!valid} disabled={!valid}
icon="file"
selected={tab === "pdalog-reqmsg"} selected={tab === "pdalog-reqmsg"}
onClick={() => setTab("pdalog-reqmsg")}> onClick={() => setTab("pdalog-reqmsg")}>
Req. Console Logs Req. Console Logs
</Tabs.Tab> </Tabs.Tab>
<Tabs.Tab <Tabs.Tab
disabled={!valid} disabled={!valid}
icon="server"
selected={tab === "pdalog-custommsg"} selected={tab === "pdalog-custommsg"}
onClick={() => setTab("pdalog-custommsg")}> onClick={() => setTab("pdalog-custommsg")}>
Set Admin Message Set Admin Message
@@ -223,13 +228,13 @@ export const TelecommsPDALog = (props, context) => {
</Section> </Section>
) : ( ) : (
<Fragment> <Fragment>
{tab === "pdalog-message" && valid && ( {tab === "pdalog-message" && (
<TeleLogs /> <TeleLogs />
)} )}
{tab === "pdalog-reqmsg" && valid && ( {tab === "pdalog-reqmsg" && (
<TeleLogs msgs_log /> <TeleLogs msgs_log />
)} )}
{tab === "pdalog-custommsg" && valid && ( {tab === "pdalog-custommsg" && (
<CustomMsg /> <CustomMsg />
)} )}
</Fragment> </Fragment>
@@ -250,6 +255,11 @@ export const TeleLogs = (props, context) => {
message_logs = [], message_logs = [],
recon_logs = [], recon_logs = [],
} = data; } = data;
const prioritycolorMap = {
'Normal': 'warning',
'High': 'bad',
'Extreme': 'bad',
};
const log_to_use = (msgs_log ? recon_logs : message_logs) || []; const log_to_use = (msgs_log ? recon_logs : message_logs) || [];
return ( return (
<Section title="Logs"> <Section title="Logs">
@@ -269,91 +279,89 @@ export const TeleLogs = (props, context) => {
<Section <Section
title="Messages" title="Messages"
level={2}> level={2}>
{(log_to_use && log_to_use.length) ? ( {log_to_use?.map(message => {
log_to_use.map(message => { return (
return ( <Section key={message.ref}>
<Section key={message.ref}> <LabeledList>
<LabeledList> <LabeledList.Item
<LabeledList.Item label={msgs_log ? "Sending Dep." : "Sender"}
label={msgs_log ? "Sending Dep." : "Sender"} buttons={(
buttons={( <Button
<Button content="Delete"
content="Delete" onClick={() => act('del_log', {
onClick={() => act('del_log', { 'ref': message.ref,
'ref': message.ref, })}
/>
)}>
{message.sender}
</LabeledList.Item>
<LabeledList.Item
label={msgs_log ? "Receiving Dep." : "Recipient"}>
{message.recipient}
</LabeledList.Item>
<LabeledList.Item
label="Message"
buttons={(
!!message.picture && ( // don't send img over req
<Button // Had to use _act for this.
content="Image"
icon="image"
onClick={() => callByond('', {
'src': message.ref,
'photo': 1,
})} })}
/> />
)}> )
{message.sender} )}>
</LabeledList.Item> {message.message}
<LabeledList.Item </LabeledList.Item>
label={msgs_log ? "Receiving Dep." : "Recipient"}> {!!msgs_log && (
{message.recipient} <Fragment>
</LabeledList.Item> <LabeledList.Item
<LabeledList.Item label="Stamp"
label="Message" color={message.stamp !== "Unstamped" ? (
buttons={( 'label'
message.image && !msgs_log && ( // don't send img over req ) : (
<Button // Had to use _act for this. 'bad'
content="Image" )}
onClick={() => _act(message.ref, 'photo')} bold={message.stamp !== 'Unstamped'}>
/> {message.stamp}
) </LabeledList.Item>
)}> <LabeledList.Item
{message.message} label="ID Authentication"
</LabeledList.Item> color={message.auth !== "Unauthenticated" ? (
{!!msgs_log && ( 'good'
<Fragment> ) : (
<LabeledList.Item 'bad'
label="Stamp" )}>
color={message.stamp !== "Unstamped" ? ( {message.auth}
'label' </LabeledList.Item>
) : ( <LabeledList.Item
'bad' label="Priority"
)}> color={(message.priority in prioritycolorMap) ? (
{message.stamp !== 'Unstamped' ? ( prioritycolorMap[message.priority]
<b>{message.stamp}</b> ) : (
) : ( 'good'
message.stamp )}
)} bold={message.priority === 'Extreme'}>
</LabeledList.Item> {message.priority === 'Extreme' ? (
<LabeledList.Item `!!${message.priority}!!`
label="ID Authentication" ) : (
color={message.auth !== "Unauthenticated" ? ( message.priority
'good' )}
) : ( </LabeledList.Item>
'bad' </Fragment>
)}> )}
{message.auth} </LabeledList>
</LabeledList.Item> </Section>
<LabeledList.Item );
label="Priority" })}
color={(message.priority in prioritycolorMap) ? (
prioritycolorMap[message.priority]
) : (
'good'
)}>
{message.priority === 'Extreme' ? (
<b>!!{message.priority}!!</b>
) : (
message.priority
)}
</LabeledList.Item>
</Fragment>
)}
</LabeledList>
</Section>
);
})
) : (
'Error: Logs empty'
)}
</Section> </Section>
</Section> </Section>
); );
}; };
const CustomMsg = (props, context) => { export const CustomMsg = (props, context) => {
const { act, data } = useBackend(context); const { act, data } = useBackend(context);
const fake_message = data.fake_message || { const fake_message = data.fake_message || {
'sender': 'System Administrator', 'sender': 'System Administrator',

File diff suppressed because one or more lines are too long