Address SteelSlayer

This commit is contained in:
mochi
2020-10-05 21:16:34 +02:00
parent 444a7bfe92
commit 01f8f05633
7 changed files with 17 additions and 14 deletions
+5 -2
View File
@@ -4,8 +4,11 @@
* Singleton that contains all informations related to newscasters (channels, stories).
*/
/datum/feed_network
/// Contains all of the feed channels created during the round.
var/list/datum/feed_channel/channels = list()
/// Contains all of the feed stories created during the round.
var/list/datum/feed_message/stories = list()
/// The current wanted issue.
var/datum/feed_message/wanted_issue
/**
@@ -127,7 +130,7 @@
* * scanned_user - The user's identifying information on the newscaster
*/
/datum/feed_channel/proc/can_publish(mob/user, scanned_user = "Unknown")
return (!frozen && (is_public || (author == scanned_user))) || user.can_admin_interact()
return (!frozen && (is_public || (author == scanned_user))) || user?.can_admin_interact()
/**
* Returns whether the given user can edit or delete this channel.
@@ -137,7 +140,7 @@
* * scanned_user - The user's identifying information on the newscaster
*/
/datum/feed_channel/proc/can_modify(mob/user, scanned_user = "Unknown")
return (!frozen && author == scanned_user) || user.can_admin_interact()
return (!frozen && author == scanned_user) || user?.can_admin_interact()
/**
* Clears the channel's information.
+1 -1
View File
@@ -150,7 +150,7 @@
else
playsound(loc, 'sound/effects/glasshit.ogg', 90, TRUE)
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)
playsound(loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/machinery/newscaster/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
+2 -2
View File
@@ -43,7 +43,7 @@
if(SCREEN_COVER) //Cover
dat += "<div align='center'><b><font size=6>The Griffon</font></b></div>"
dat += "<div align='center'><font size=2>Nanotrasen-standard newspaper, for use on Nanotrasen Space Facilities</font></div><hr>"
if(isemptylist(news_content))
if(!length(news_content))
if(important_message)
dat += "Contents:<br><ul><b><font color='red'>**</font>Important Security Announcement<font color='red'>**</font></b> <font size=2>\[page [pages+2]\]</font><br></ul>"
else
@@ -70,7 +70,7 @@
if(C.censored)
dat += "This channel was deemed dangerous to the general welfare of the station and therefore marked with a <b><font color='red'>D-Notice</b></font>. Its contents were not transferred to the newspaper at the time of printing."
else
if(isemptylist(C.messages))
if(!length(C.messages))
dat += "No Feed stories stem from this channel..."
else
dat += "<ul>"
+6 -6
View File
@@ -52,9 +52,9 @@ export const Newscaster = (properties, context) => {
const [viewingPhoto, _setViewingPhoto] = useLocalState(context, "viewingPhoto", "");
const [censorMode, setCensorMode] = useLocalState(context, "censorMode", false);
let body;
if (screen === 13 || screen === 14) {
if (screen === 0 || screen === 2) {
body = <NewscasterFeed />;
} else if (screen === 12) {
} else if (screen === 1) {
body = <NewscasterJobs />;
}
const totalUnread = channels.reduce((a, c) => a + c.unread, 0);
@@ -86,7 +86,7 @@ export const Newscaster = (properties, context) => {
<MenuButton
icon="newspaper"
title="Headlines"
selected={screen === 13}
selected={screen === 0}
onClick={() => act('headlines')}>
{totalUnread > 0 && (
<Box className="Newscaster__menuButton--unread">
@@ -97,7 +97,7 @@ export const Newscaster = (properties, context) => {
<MenuButton
icon="briefcase"
title="Job Openings"
selected={screen === 12}
selected={screen === 1}
onClick={() => act('jobs')}
/>
<Divider />
@@ -108,7 +108,7 @@ export const Newscaster = (properties, context) => {
key={channel}
icon={channel.icon}
title={channel.name}
selected={screen === 14 && channels[channel_idx - 1] === channel}
selected={screen === 2 && channels[channel_idx - 1] === channel}
onClick={() => act('channel', { uid: channel.uid })}>
{channel.unread > 0 && (
<Box className="Newscaster__menuButton--unread">
@@ -223,7 +223,7 @@ const NewscasterFeed = (properties, context) => {
} = data;
const [fullStories, _setFullStories] = useLocalState(context, "fullStories", []);
const [censorMode, _setCensorMode] = useLocalState(context, "censorMode", false);
const channel = (screen === 14 && channel_idx > -1) ? channels[channel_idx - 1] : null;
const channel = (screen === 2 && channel_idx > -1) ? channels[channel_idx - 1] : null;
return (
<Flex direction="column" height="100%" flex="1">
{!!wanted && <Story story={wanted} wanted />}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -36,7 +36,7 @@
display: inline-block;
width: 12px;
position: absolute;
left: 22px;
left: 16px;
margin-top: 14px;
}