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,8 +89,7 @@ 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 />
@@ -109,17 +109,17 @@ export const ClockworkSlab = (props, context) => {
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,11 +22,13 @@ 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
<Window theme="ntos" resizable>
<Window.Content scrollable>
<NoticeBox> <NoticeBox>
<b> <b>
<h3> <h3>
@@ -39,10 +37,11 @@ export const TelecommsPDALog = (props, context) => {
</h3> </h3>
</b> </b>
<i> <i>
{data.borg ? ( {(silicon && !hack_status.emagging) ? (
<Fragment> <Fragment>
Brute-forcing for server key. <br /> Brute-forcing for server key. <br />
It will take 20 seconds for every character that the password has. It will take 20 seconds for every character that
the password has.
<br /> <br />
In the meantime, this console can reveal your In the meantime, this console can reveal your
true intentions if you let someone access it. true intentions if you let someone access it.
@@ -55,12 +54,14 @@ export const TelecommsPDALog = (props, context) => {
dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br /> dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br />
MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br /> MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br />
IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br /> IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br />
BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=<br /> BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=
<br /> <br /><br />
</Fragment> </Fragment>
)} )}
</i> </i>
</NoticeBox> </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,8 +279,7 @@ 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>
@@ -293,10 +302,14 @@ export const TeleLogs = (props, context) => {
<LabeledList.Item <LabeledList.Item
label="Message" label="Message"
buttons={( buttons={(
message.image && !msgs_log && ( // don't send img over req !!message.picture && ( // don't send img over req
<Button // Had to use _act for this. <Button // Had to use _act for this.
content="Image" content="Image"
onClick={() => _act(message.ref, 'photo')} icon="image"
onClick={() => callByond('', {
'src': message.ref,
'photo': 1,
})}
/> />
) )
)}> )}>
@@ -310,12 +323,9 @@ export const TeleLogs = (props, context) => {
'label' 'label'
) : ( ) : (
'bad' 'bad'
)}>
{message.stamp !== 'Unstamped' ? (
<b>{message.stamp}</b>
) : (
message.stamp
)} )}
bold={message.stamp !== 'Unstamped'}>
{message.stamp}
</LabeledList.Item> </LabeledList.Item>
<LabeledList.Item <LabeledList.Item
label="ID Authentication" label="ID Authentication"
@@ -332,9 +342,10 @@ export const TeleLogs = (props, context) => {
prioritycolorMap[message.priority] prioritycolorMap[message.priority]
) : ( ) : (
'good' 'good'
)}> )}
bold={message.priority === 'Extreme'}>
{message.priority === 'Extreme' ? ( {message.priority === 'Extreme' ? (
<b>!!{message.priority}!!</b> `!!${message.priority}!!`
) : ( ) : (
message.priority message.priority
)} )}
@@ -344,16 +355,13 @@ export const TeleLogs = (props, context) => {
</LabeledList> </LabeledList>
</Section> </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