From 927b9d0622ee141eacddb4abdbcb0eb01eccf7db Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Wed, 5 Feb 2020 23:50:41 -0700
Subject: [PATCH 01/11] Revert "Merge pull request #10883 from
ancientpower/ghost-newscasters"
This reverts commit 3c5a3cb4d4c284381b1c8aab0587022658fe37b7, reversing
changes made to 109b15ebdde758cab20b849fa6c23dbe433530ab.
---
code/__DEFINES/interaction_flags.dm | 2 -
code/game/atoms.dm | 1 -
code/game/machinery/_machinery.dm | 2 +-
code/game/machinery/newscaster.dm | 97 ++--------------------
code/game/turfs/turf.dm | 4 +-
code/modules/library/lib_items.dm | 16 +---
code/modules/mob/dead/observer/observer.dm | 2 +-
code/modules/mob/mob_helpers.dm | 12 ---
8 files changed, 13 insertions(+), 123 deletions(-)
diff --git a/code/__DEFINES/interaction_flags.dm b/code/__DEFINES/interaction_flags.dm
index 6df5bf77fb..dc3242c910 100644
--- a/code/__DEFINES/interaction_flags.dm
+++ b/code/__DEFINES/interaction_flags.dm
@@ -20,5 +20,3 @@
#define INTERACT_MACHINE_SET_MACHINE (1<<6) //MACHINES HAVE THIS BY DEFAULT, SOMEONE SHOULD RUN THROUGH MACHINES AND REMOVE IT FROM THINGS LIKE LIGHT SWITCHES WHEN POSSIBLE!!--------------------------
//This flag determines if a machine set_machine's the user when the user uses it, making updateUsrDialog make the user re-call interact() on it.
//THIS FLAG IS ON ALL MACHINES BY DEFAULT, NEEDS TO BE RE-EVALUATED LATER!!
-
-#define INTERACT_GHOST_READ (1<<0)
\ No newline at end of file
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 7e224080b9..83117bad64 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -6,7 +6,6 @@
var/flags_1 = NONE
var/interaction_flags_atom = NONE
- var/ghost_flags = NONE
var/datum/reagents/reagents = null
//This atom's HUD (med/sec, etc) images. Associative list.
diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm
index 44739fcbc0..a0666b3133 100644
--- a/code/game/machinery/_machinery.dm
+++ b/code/game/machinery/_machinery.dm
@@ -242,7 +242,7 @@ Class Procs:
else
if(interaction_flags_machine & INTERACT_MACHINE_REQUIRES_SILICON)
return FALSE
- if(!Adjacent(user) && !isobserver(user))
+ if(!Adjacent(user))
var/mob/living/carbon/H = user
if(!(istype(H) && H.has_dna() && H.dna.check_mutation(TK)))
return FALSE
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 7097de1f3b..a9b4461085 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -189,7 +189,6 @@ GLOBAL_LIST_EMPTY(allCasters)
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 30)
max_integrity = 200
integrity_failure = 50
- ghost_flags = INTERACT_GHOST_READ
var/screen = 0
var/paper_remaining = 15
var/securityCaster = 0
@@ -197,7 +196,6 @@ GLOBAL_LIST_EMPTY(allCasters)
var/alert_delay = 500
var/alert = FALSE
var/scanned_user = "Unknown"
- var/mob/active_user = null
var/msg = ""
var/datum/picture/picture
var/channel_name = ""
@@ -266,10 +264,10 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/machinery/newscaster/ui_interact(mob/user)
. = ..()
- if(ishuman(user) || issilicon(user) || isobserver(user))
- var/mob/M = user
+ if(ishuman(user) || issilicon(user))
+ var/mob/living/human_or_robot_user = user
var/dat
- scan_user(M)
+ scan_user(human_or_robot_user)
switch(screen)
if(0)
dat += "Welcome to Newscasting Unit #[unit_no].
Interface & News networks Operational."
@@ -281,7 +279,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+= "
Submit new Feed story"
dat+= "
Print newspaper"
dat+= "
Re-scan User"
- dat+= "
Exit"
+ dat+= "
Exit"
if(securityCaster)
var/wanted_already = 0
if(GLOB.news_network.wanted_issue.active)
@@ -503,36 +501,24 @@ GLOBAL_LIST_EMPTY(allCasters)
if(21)
dat+="Unable to print newspaper. Insufficient paper. Please notify maintenance personnel to refill machine storage.
"
dat+="Return"
- var/datum/browser/popup = new(M, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600)
+ var/datum/browser/popup = new(human_or_robot_user, "newscaster_main", "Newscaster Unit #[unit_no]", 400, 600)
popup.set_content(dat)
- popup.set_title_image(M.browse_rsc_icon(icon, icon_state))
+ popup.set_title_image(human_or_robot_user.browse_rsc_icon(icon, icon_state))
popup.open()
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return
- if(active_user && !isobserver(active_user) && get_dist(active_user,src)<=1 && usr!=active_user)
- to_chat(usr, "You must wait for [active_user] to finish and move away.")
- return
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || issilicon(usr) || isobserver(usr))
+ if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || issilicon(usr))
usr.set_machine(src)
scan_user(usr)
if(href_list["set_channel_name"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"set a channel's name"))
- to_chat(usr, "You can't do that.")
- return
channel_name = stripped_input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "", MAX_NAME_LEN)
updateUsrDialog()
else if(href_list["set_channel_lock"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"locked a channel"))
- to_chat(usr, "You can't do that.")
- return
c_locked = !c_locked
updateUsrDialog()
else if(href_list["submit_new_channel"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"created a new channel"))
- to_chat(usr, "You can't do that.")
- return
var/list/existing_authors = list()
for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.authorCensor)
@@ -555,9 +541,6 @@ GLOBAL_LIST_EMPTY(allCasters)
screen=5
updateUsrDialog()
else if(href_list["set_channel_receiving"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the receiving channel"))
- to_chat(usr, "You can't do that.")
- return
var/list/available_channels = list()
for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels)
if( (!F.locked || F.author == scanned_user) && !F.censored)
@@ -565,23 +548,14 @@ GLOBAL_LIST_EMPTY(allCasters)
channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels
updateUsrDialog()
else if(href_list["set_new_message"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"set the message of a new feed story"))
- to_chat(usr, "You can't do that.")
- return
var/temp_message = trim(stripped_multiline_input(usr, "Write your Feed story", "Network Channel Handler", msg))
if(temp_message)
msg = temp_message
updateUsrDialog()
else if(href_list["set_attachment"])
- if(isobserver(usr))
- to_chat(usr, "You can't do that.")
- return
AttachPhoto(usr)
updateUsrDialog()
else if(href_list["submit_new_message"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"added a new story"))
- to_chat(usr, "You can't do that.")
- return
if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "" )
screen=6
else
@@ -591,27 +565,15 @@ GLOBAL_LIST_EMPTY(allCasters)
msg = ""
updateUsrDialog()
else if(href_list["create_channel"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"created a channel"))
- to_chat(usr, "You can't do that.")
- return
screen=2
updateUsrDialog()
else if(href_list["create_feed_story"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"created a feed story"))
- to_chat(usr, "You can't do that.")
- return
screen=3
updateUsrDialog()
else if(href_list["menu_paper"])
- if(isobserver(usr) && !canGhostWrite(usr,src,""))
- to_chat(usr, "You can't do that.")
- return
screen=8
updateUsrDialog()
else if(href_list["print_paper"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"printed a paper"))
- to_chat(usr, "You can't do that.")
- return
if(!paper_remaining)
screen=21
else
@@ -619,21 +581,12 @@ GLOBAL_LIST_EMPTY(allCasters)
screen = 20
updateUsrDialog()
else if(href_list["menu_censor_story"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"censored a story"))
- to_chat(usr, "You can't do that.")
- return
screen=10
updateUsrDialog()
else if(href_list["menu_censor_channel"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"censored a channel"))
- to_chat(usr, "You can't do that.")
- return
screen=11
updateUsrDialog()
else if(href_list["menu_wanted"])
- if(isobserver(usr) && !canGhostWrite(usr,src,""))
- to_chat(usr, "You can't do that.")
- return
var/already_wanted = 0
if(GLOB.news_network.wanted_issue.active)
already_wanted = 1
@@ -643,21 +596,12 @@ GLOBAL_LIST_EMPTY(allCasters)
screen = 14
updateUsrDialog()
else if(href_list["set_wanted_name"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the name of a wanted person"))
- to_chat(usr, "You can't do that.")
- return
channel_name = stripped_input(usr, "Provide the name of the Wanted person", "Network Security Handler")
updateUsrDialog()
else if(href_list["set_wanted_desc"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set the description of a wanted person"))
- to_chat(usr, "You can't do that.")
- return
msg = stripped_input(usr, "Provide a description of the Wanted person and any other details you deem important", "Network Security Handler")
updateUsrDialog()
else if(href_list["submit_wanted"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"submitted a wanted poster"))
- to_chat(usr, "You can't do that.")
- return
var/input_param = text2num(href_list["submit_wanted"])
if(msg == "" || channel_name == "" || scanned_user == "Unknown")
screen = 16
@@ -688,9 +632,6 @@ GLOBAL_LIST_EMPTY(allCasters)
screen=18
updateUsrDialog()
else if(href_list["censor_channel_author"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor an author"))
- to_chat(usr, "You can't do that.")
- return
var/datum/newscaster/feed_channel/FC = locate(href_list["censor_channel_author"])
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
@@ -698,9 +639,6 @@ GLOBAL_LIST_EMPTY(allCasters)
FC.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_author"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story's author"))
- to_chat(usr, "You can't do that.")
- return
var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_author"])
if(MSG.is_admin_message)
alert("This message was created by a Nanotrasen Officer. You cannot censor its author.","Ok")
@@ -708,9 +646,6 @@ GLOBAL_LIST_EMPTY(allCasters)
MSG.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_body"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story"))
- to_chat(usr, "You can't do that.")
- return
var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_body"])
if(MSG.is_admin_message)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
@@ -718,17 +653,11 @@ GLOBAL_LIST_EMPTY(allCasters)
MSG.toggleCensorBody()
updateUsrDialog()
else if(href_list["pick_d_notice"])
- if(isobserver(usr) && !canGhostWrite(usr,src,""))
- to_chat(usr, "You can't do that.")
- return
var/datum/newscaster/feed_channel/FC = locate(href_list["pick_d_notice"])
viewing_channel = FC
screen=13
updateUsrDialog()
else if(href_list["toggle_d_notice"])
- if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set a D-notice"))
- to_chat(usr, "You can't do that.")
- return
var/datum/newscaster/feed_channel/FC = locate(href_list["toggle_d_notice"])
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok")
@@ -876,12 +805,6 @@ GLOBAL_LIST_EMPTY(allCasters)
picture = selection
/obj/machinery/newscaster/proc/scan_user(mob/living/user)
- if(active_user)
- if(active_user != user)
- if(get_dist(active_user,src)<=1)
- if(!isobserver(active_user))
- to_chat(user, "Wait for [active_user] to finish and move away.")
- return
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
if(human_user.wear_id)
@@ -901,14 +824,9 @@ GLOBAL_LIST_EMPTY(allCasters)
else if(issilicon(user))
var/mob/living/silicon/ai_user = user
scanned_user = "[ai_user.name] ([ai_user.job])"
- else if (IsAdminGhost(user))
- scanned_user = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
- else if (isobserver(user))
- scanned_user = "Space-Time Anomaly #[rand(0,9)][rand(0,9)][rand(0,9)]"
else
throw EXCEPTION("Invalid user for this proc")
return
- active_user = user
/obj/machinery/newscaster/proc/print_paper()
SSblackbox.record_feedback("amount", "newspapers_printed", 1)
@@ -941,6 +859,7 @@ GLOBAL_LIST_EMPTY(allCasters)
say("Attention! Wanted issue distributed!")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
+
/obj/item/newspaper
name = "newspaper"
desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations."
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 688e03def3..d8434f986c 100755
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -362,10 +362,8 @@
. = ..()
if(.)
return
- if(!user || !istype(user, /mob/living))
- return FALSE
if(length(src_object.contents()))
- to_chat(user, "You start dumping out the contents...")
+ to_chat(usr, "You start dumping out the contents...")
if(!do_after(usr,20,target=src_object.parent))
return FALSE
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index f128a76da2..5ff1cbceb1 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -129,14 +129,6 @@
choice.forceMove(drop_location())
update_icon()
-/obj/structure/bookcase/attack_ghost(mob/dead/observer/user as mob)
- if(contents.len && in_range(user, src))
- var/obj/item/book/choice = input("Which book would you like to read?") as null|obj in contents
- if(choice)
- if(!istype(choice)) //spellbook, cult tome, or the one weird bible storage
- to_chat(user,"A mysterious force is keeping you from reading that.")
- return
- choice.attack_self(user)
/obj/structure/bookcase/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(loc, 4)
@@ -212,9 +204,8 @@
return
if(dat)
user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
- if(istype(user, /mob/living))
- user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
- SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
+ user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
+ SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
onclose(user, "book")
else
to_chat(user, "This book is completely blank!")
@@ -320,9 +311,6 @@
else
..()
-/obj/item/book/attack_ghost(mob/user)
- attack_self(user)
-
/*
* Barcode Scanner
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 3559edc0fb..439fe491cc 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -796,7 +796,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
update_icon()
/mob/dead/observer/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
- return IsAdminGhost(usr) || (M.ghost_flags & INTERACT_GHOST_READ)
+ return IsAdminGhost(usr)
/mob/dead/observer/is_literate()
return 1
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index d78d23c234..393adb68d2 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -402,18 +402,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
return
return TRUE
-/proc/canGhostWrite(var/mob/A, var/obj/target, var/desc="", var/allow_all=FALSE)
- if(allow_all & TRUE)
- if(!target.GetComponent(/datum/component/anti_magic))
- return 1
- if(IsAdminGhost(A))
- if (desc != "")
- log_admin("GHOST: [key_name(A)] [desc] ([target.name] at [loc_name(target)])")
- else
- log_admin("GHOST: [key_name(A)] fucked with the [target.name] at [loc_name(target)]")
- return 1
- return 0
-
/proc/offer_control(mob/M)
to_chat(M, "Control of your mob has been offered to dead players.")
if(usr)
From 9a4432b3acbcea08d384c78793324b8754cdc013 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:03:17 -0700
Subject: [PATCH 02/11] initial commit
---
code/modules/library/lib_items.dm | 22 ++-
code/modules/newscaster/feed_channel.dm | 34 ++++
code/modules/newscaster/feed_comment.dm | 4 +
code/modules/newscaster/feed_message.dm | 47 +++++
code/modules/newscaster/feed_network.dm | 71 ++++++++
code/modules/newscaster/news_datum.dm | 1 +
.../newscaster}/newscaster.dm | 171 ------------------
code/modules/newscaster/wanted_message.dm | 8 +
8 files changed, 183 insertions(+), 175 deletions(-)
create mode 100644 code/modules/newscaster/feed_channel.dm
create mode 100644 code/modules/newscaster/feed_comment.dm
create mode 100644 code/modules/newscaster/feed_message.dm
create mode 100644 code/modules/newscaster/feed_network.dm
create mode 100644 code/modules/newscaster/news_datum.dm
rename code/{game/machinery => modules/newscaster}/newscaster.dm (88%)
create mode 100644 code/modules/newscaster/wanted_message.dm
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 5ff1cbceb1..459212aad0 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -112,7 +112,6 @@
else
return ..()
-
/obj/structure/bookcase/attack_hand(mob/user)
. = ..()
if(.)
@@ -129,6 +128,17 @@
choice.forceMove(drop_location())
update_icon()
+/obj/structure/bookcase/attack_ghost(mob/dead/observer/user)
+ . = ..()
+ if(!length(contents))
+ to_chat(user, "It's empty!")
+ return
+ var/obj/item/book/choice = input("Which book would you like to read?") as null|obj in contents
+ if(choice)
+ if(!istype(choice)) //spellbook, cult tome, or the one weird bible storage
+ to_chat(user,"A mysterious force is keeping you from reading that.")
+ return
+ choice.attack_ghost(user)
/obj/structure/bookcase/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(loc, 4)
@@ -203,13 +213,17 @@
to_chat(user, "You skim through the book but can't comprehend any of it.")
return
if(dat)
- user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
+ show_to(user)
user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
- SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "book_nerd", /datum/mood_event/book_nerd)
- onclose(user, "book")
else
to_chat(user, "This book is completely blank!")
+/obj/item/book/attack_ghost(mob/dead/observer/O)
+ . = ..()
+ show_to(O)
+
+/obj/item/book/proc/show_to(mob/user)
+ user << browse("Penned by [author].
" + "[dat]", "window=book[window_size != null ? ";size=[window_size]" : ""]")
/obj/item/book/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/pen))
diff --git a/code/modules/newscaster/feed_channel.dm b/code/modules/newscaster/feed_channel.dm
new file mode 100644
index 0000000000..98c8d35493
--- /dev/null
+++ b/code/modules/newscaster/feed_channel.dm
@@ -0,0 +1,34 @@
+/datum/newscaster/feed_channel
+ var/channel_name = ""
+ var/list/datum/newscaster/feed_message/messages = list()
+ var/locked = FALSE
+ var/author = ""
+ var/censored = 0
+ var/list/authorCensorTime = list()
+ var/list/DclassCensorTime = list()
+ var/authorCensor
+ var/is_admin_channel = 0
+
+/datum/newscaster/feed_channel/proc/returnAuthor(censor)
+ if(censor == -1)
+ censor = authorCensor
+ var/txt = "[GLOB.news_network.redactedText]"
+ if(!censor)
+ txt = author
+ return txt
+
+/datum/newscaster/feed_channel/proc/toggleCensorDclass()
+ if(censored)
+ DclassCensorTime.Add(GLOB.news_network.lastAction*-1)
+ else
+ DclassCensorTime.Add(GLOB.news_network.lastAction)
+ censored = !censored
+ GLOB.news_network.lastAction ++
+
+/datum/newscaster/feed_channel/proc/toggleCensorAuthor()
+ if(authorCensor)
+ authorCensorTime.Add(GLOB.news_network.lastAction*-1)
+ else
+ authorCensorTime.Add(GLOB.news_network.lastAction)
+ authorCensor = !authorCensor
+ GLOB.news_network.lastAction ++
diff --git a/code/modules/newscaster/feed_comment.dm b/code/modules/newscaster/feed_comment.dm
new file mode 100644
index 0000000000..f5f847ab8e
--- /dev/null
+++ b/code/modules/newscaster/feed_comment.dm
@@ -0,0 +1,4 @@
+/datum/newscaster/feed_comment
+ var/author = ""
+ var/body = ""
+ var/time_stamp = ""
diff --git a/code/modules/newscaster/feed_message.dm b/code/modules/newscaster/feed_message.dm
new file mode 100644
index 0000000000..1930177555
--- /dev/null
+++ b/code/modules/newscaster/feed_message.dm
@@ -0,0 +1,47 @@
+/datum/newscaster/feed_message
+ var/author =""
+ var/body =""
+ var/list/authorCensorTime = list()
+ var/list/bodyCensorTime = list()
+ var/is_admin_message = 0
+ var/icon/img = null
+ var/time_stamp = ""
+ var/list/datum/newscaster/feed_comment/comments = list()
+ var/locked = FALSE
+ var/caption = ""
+ var/creationTime
+ var/authorCensor
+ var/bodyCensor
+ var/photo_file
+
+/datum/newscaster/feed_message/proc/returnAuthor(censor)
+ if(censor == -1)
+ censor = authorCensor
+ var/txt = "[GLOB.news_network.redactedText]"
+ if(!censor)
+ txt = author
+ return txt
+
+/datum/newscaster/feed_message/proc/returnBody(censor)
+ if(censor == -1)
+ censor = bodyCensor
+ var/txt = "[GLOB.news_network.redactedText]"
+ if(!censor)
+ txt = body
+ return txt
+
+/datum/newscaster/feed_message/proc/toggleCensorAuthor()
+ if(authorCensor)
+ authorCensorTime.Add(GLOB.news_network.lastAction*-1)
+ else
+ authorCensorTime.Add(GLOB.news_network.lastAction)
+ authorCensor = !authorCensor
+ GLOB.news_network.lastAction ++
+
+/datum/newscaster/feed_message/proc/toggleCensorBody()
+ if(bodyCensor)
+ bodyCensorTime.Add(GLOB.news_network.lastAction*-1)
+ else
+ bodyCensorTime.Add(GLOB.news_network.lastAction)
+ bodyCensor = !bodyCensor
+ GLOB.news_network.lastAction ++
diff --git a/code/modules/newscaster/feed_network.dm b/code/modules/newscaster/feed_network.dm
new file mode 100644
index 0000000000..12a211891e
--- /dev/null
+++ b/code/modules/newscaster/feed_network.dm
@@ -0,0 +1,71 @@
+GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
+
+/datum/newscaster/feed_network
+ var/list/datum/newscaster/feed_channel/network_channels = list()
+ var/datum/newscaster/wanted_message/wanted_issue
+ var/lastAction
+ var/redactedText = "\[REDACTED\]"
+
+/datum/newscaster/feed_network/New()
+ CreateFeedChannel("Station Announcements", "SS13", 1)
+ wanted_issue = new /datum/newscaster/wanted_message
+
+/datum/newscaster/feed_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
+ var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
+ newChannel.channel_name = channel_name
+ newChannel.author = author
+ newChannel.locked = locked
+ newChannel.is_admin_channel = adminChannel
+ network_channels += newChannel
+
+/datum/newscaster/feed_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
+ var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
+ newMsg.author = author
+ newMsg.body = msg
+ newMsg.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
+ newMsg.is_admin_message = adminMessage
+ newMsg.locked = !allow_comments
+ if(picture)
+ newMsg.img = picture.picture_image
+ newMsg.caption = picture.caption
+ newMsg.photo_file = save_photo(picture.picture_image)
+ for(var/datum/newscaster/feed_channel/FC in network_channels)
+ if(FC.channel_name == channel_name)
+ FC.messages += newMsg
+ break
+ for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
+ NEWSCASTER.newsAlert(channel_name)
+ lastAction ++
+ newMsg.creationTime = lastAction
+
+/datum/newscaster/feed_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
+ wanted_issue.active = 1
+ wanted_issue.criminal = criminal
+ wanted_issue.body = body
+ wanted_issue.scannedUser = scanned_user
+ wanted_issue.isAdminMsg = adminMsg
+ if(picture)
+ wanted_issue.img = picture.picture_image
+ wanted_issue.photo_file = save_photo(picture.picture_image)
+ if(newMessage)
+ for(var/obj/machinery/newscaster/N in GLOB.allCasters)
+ N.newsAlert()
+ N.update_icon()
+
+/datum/newscaster/feed_network/proc/deleteWanted()
+ wanted_issue.active = 0
+ wanted_issue.criminal = null
+ wanted_issue.body = null
+ wanted_issue.scannedUser = null
+ wanted_issue.img = null
+ for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
+ NEWSCASTER.update_icon()
+
+/datum/newscaster/feed_network/proc/save_photo(icon/photo)
+ var/photo_file = copytext_char(md5("\icon[photo]"), 1, 6)
+ if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
+ //Clean up repeated frames
+ var/icon/clean = new /icon()
+ clean.Insert(photo, "", SOUTH, 1, 0)
+ fcopy(clean, "[GLOB.log_directory]/photos/[photo_file].png")
+ return photo_file
diff --git a/code/modules/newscaster/news_datum.dm b/code/modules/newscaster/news_datum.dm
new file mode 100644
index 0000000000..3c42d04734
--- /dev/null
+++ b/code/modules/newscaster/news_datum.dm
@@ -0,0 +1 @@
+/datum/newscaster
diff --git a/code/game/machinery/newscaster.dm b/code/modules/newscaster/newscaster.dm
similarity index 88%
rename from code/game/machinery/newscaster.dm
rename to code/modules/newscaster/newscaster.dm
index a9b4461085..e9458666f3 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/modules/newscaster/newscaster.dm
@@ -1,175 +1,5 @@
-GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
GLOBAL_LIST_EMPTY(allCasters)
-/datum/newscaster
-
-/datum/newscaster/feed_comment
- var/author = ""
- var/body = ""
- var/time_stamp = ""
-
-/datum/newscaster/feed_message
- var/author =""
- var/body =""
- var/list/authorCensorTime = list()
- var/list/bodyCensorTime = list()
- var/is_admin_message = 0
- var/icon/img = null
- var/time_stamp = ""
- var/list/datum/newscaster/feed_comment/comments = list()
- var/locked = FALSE
- var/caption = ""
- var/creationTime
- var/authorCensor
- var/bodyCensor
- var/photo_file
-
-/datum/newscaster/feed_message/proc/returnAuthor(censor)
- if(censor == -1)
- censor = authorCensor
- var/txt = "[GLOB.news_network.redactedText]"
- if(!censor)
- txt = author
- return txt
-
-/datum/newscaster/feed_message/proc/returnBody(censor)
- if(censor == -1)
- censor = bodyCensor
- var/txt = "[GLOB.news_network.redactedText]"
- if(!censor)
- txt = body
- return txt
-
-/datum/newscaster/feed_message/proc/toggleCensorAuthor()
- if(authorCensor)
- authorCensorTime.Add(GLOB.news_network.lastAction*-1)
- else
- authorCensorTime.Add(GLOB.news_network.lastAction)
- authorCensor = !authorCensor
- GLOB.news_network.lastAction ++
-
-/datum/newscaster/feed_message/proc/toggleCensorBody()
- if(bodyCensor)
- bodyCensorTime.Add(GLOB.news_network.lastAction*-1)
- else
- bodyCensorTime.Add(GLOB.news_network.lastAction)
- bodyCensor = !bodyCensor
- GLOB.news_network.lastAction ++
-
-/datum/newscaster/feed_channel
- var/channel_name = ""
- var/list/datum/newscaster/feed_message/messages = list()
- var/locked = FALSE
- var/author = ""
- var/censored = 0
- var/list/authorCensorTime = list()
- var/list/DclassCensorTime = list()
- var/authorCensor
- var/is_admin_channel = 0
-
-/datum/newscaster/feed_channel/proc/returnAuthor(censor)
- if(censor == -1)
- censor = authorCensor
- var/txt = "[GLOB.news_network.redactedText]"
- if(!censor)
- txt = author
- return txt
-
-/datum/newscaster/feed_channel/proc/toggleCensorDclass()
- if(censored)
- DclassCensorTime.Add(GLOB.news_network.lastAction*-1)
- else
- DclassCensorTime.Add(GLOB.news_network.lastAction)
- censored = !censored
- GLOB.news_network.lastAction ++
-
-/datum/newscaster/feed_channel/proc/toggleCensorAuthor()
- if(authorCensor)
- authorCensorTime.Add(GLOB.news_network.lastAction*-1)
- else
- authorCensorTime.Add(GLOB.news_network.lastAction)
- authorCensor = !authorCensor
- GLOB.news_network.lastAction ++
-
-/datum/newscaster/wanted_message
- var/active
- var/criminal
- var/body
- var/scannedUser
- var/isAdminMsg
- var/icon/img
- var/photo_file
-
-/datum/newscaster/feed_network
- var/list/datum/newscaster/feed_channel/network_channels = list()
- var/datum/newscaster/wanted_message/wanted_issue
- var/lastAction
- var/redactedText = "\[REDACTED\]"
-
-/datum/newscaster/feed_network/New()
- CreateFeedChannel("Station Announcements", "SS13", 1)
- wanted_issue = new /datum/newscaster/wanted_message
-
-/datum/newscaster/feed_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
- var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
- newChannel.channel_name = channel_name
- newChannel.author = author
- newChannel.locked = locked
- newChannel.is_admin_channel = adminChannel
- network_channels += newChannel
-
-/datum/newscaster/feed_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
- var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
- newMsg.author = author
- newMsg.body = msg
- newMsg.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
- newMsg.is_admin_message = adminMessage
- newMsg.locked = !allow_comments
- if(picture)
- newMsg.img = picture.picture_image
- newMsg.caption = picture.caption
- newMsg.photo_file = save_photo(picture.picture_image)
- for(var/datum/newscaster/feed_channel/FC in network_channels)
- if(FC.channel_name == channel_name)
- FC.messages += newMsg
- break
- for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
- NEWSCASTER.newsAlert(channel_name)
- lastAction ++
- newMsg.creationTime = lastAction
-
-/datum/newscaster/feed_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
- wanted_issue.active = 1
- wanted_issue.criminal = criminal
- wanted_issue.body = body
- wanted_issue.scannedUser = scanned_user
- wanted_issue.isAdminMsg = adminMsg
- if(picture)
- wanted_issue.img = picture.picture_image
- wanted_issue.photo_file = save_photo(picture.picture_image)
- if(newMessage)
- for(var/obj/machinery/newscaster/N in GLOB.allCasters)
- N.newsAlert()
- N.update_icon()
-
-/datum/newscaster/feed_network/proc/deleteWanted()
- wanted_issue.active = 0
- wanted_issue.criminal = null
- wanted_issue.body = null
- wanted_issue.scannedUser = null
- wanted_issue.img = null
- for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
- NEWSCASTER.update_icon()
-
-/datum/newscaster/feed_network/proc/save_photo(icon/photo)
- var/photo_file = copytext_char(md5("\icon[photo]"), 1, 6)
- if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
- //Clean up repeated frames
- var/icon/clean = new /icon()
- clean.Insert(photo, "", SOUTH, 1, 0)
- fcopy(clean, "[GLOB.log_directory]/photos/[photo_file].png")
- return photo_file
-
/obj/item/wallframe/newscaster
name = "newscaster frame"
desc = "Used to build newscasters, just secure to the wall."
@@ -177,7 +7,6 @@ GLOBAL_LIST_EMPTY(allCasters)
materials = list(MAT_METAL=14000, MAT_GLASS=8000)
result_path = /obj/machinery/newscaster
-
/obj/machinery/newscaster
name = "newscaster"
desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!"
diff --git a/code/modules/newscaster/wanted_message.dm b/code/modules/newscaster/wanted_message.dm
new file mode 100644
index 0000000000..de67bbeaf5
--- /dev/null
+++ b/code/modules/newscaster/wanted_message.dm
@@ -0,0 +1,8 @@
+/datum/newscaster/wanted_message
+ var/active
+ var/criminal
+ var/body
+ var/scannedUser
+ var/isAdminMsg
+ var/icon/img
+ var/photo_file
From 134b7b811d95acad395043d5ee33481e71628c97 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:04:11 -0700
Subject: [PATCH 03/11] repath that
---
code/modules/newscaster/feed_network.dm | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/code/modules/newscaster/feed_network.dm b/code/modules/newscaster/feed_network.dm
index 12a211891e..b1e8ad19ae 100644
--- a/code/modules/newscaster/feed_network.dm
+++ b/code/modules/newscaster/feed_network.dm
@@ -1,16 +1,17 @@
-GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
+GLOBAL_DATUM_INIT(news_network, /datum/news_network, new)
-/datum/newscaster/feed_network
+/// Contains all the news datum of a newscaster system.
+/datum/news_network
var/list/datum/newscaster/feed_channel/network_channels = list()
var/datum/newscaster/wanted_message/wanted_issue
var/lastAction
var/redactedText = "\[REDACTED\]"
-/datum/newscaster/feed_network/New()
+/datum/news_network/New()
CreateFeedChannel("Station Announcements", "SS13", 1)
wanted_issue = new /datum/newscaster/wanted_message
-/datum/newscaster/feed_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
+/datum/news_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
newChannel.channel_name = channel_name
newChannel.author = author
@@ -18,7 +19,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
newChannel.is_admin_channel = adminChannel
network_channels += newChannel
-/datum/newscaster/feed_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
+/datum/news_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
newMsg.author = author
newMsg.body = msg
@@ -38,7 +39,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
lastAction ++
newMsg.creationTime = lastAction
-/datum/newscaster/feed_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
+/datum/news_network/proc/submitWanted(criminal, body, scanned_user, datum/picture/picture, adminMsg = 0, newMessage = 0)
wanted_issue.active = 1
wanted_issue.criminal = criminal
wanted_issue.body = body
@@ -52,7 +53,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
N.newsAlert()
N.update_icon()
-/datum/newscaster/feed_network/proc/deleteWanted()
+/datum/news_network/proc/deleteWanted()
wanted_issue.active = 0
wanted_issue.criminal = null
wanted_issue.body = null
@@ -61,7 +62,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new)
for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters)
NEWSCASTER.update_icon()
-/datum/newscaster/feed_network/proc/save_photo(icon/photo)
+/datum/news_network/proc/save_photo(icon/photo)
var/photo_file = copytext_char(md5("\icon[photo]"), 1, 6)
if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
//Clean up repeated frames
From 38536cd02d5b7c7c2278d31b3afec3169ef3937a Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:05:07 -0700
Subject: [PATCH 04/11] repath that
---
code/__HELPERS/roundend.dm | 6 +-
code/game/objects/items/devices/PDA/cart.dm | 12 ++--
code/modules/admin/admin.dm | 18 +++---
code/modules/admin/holder2.dm | 6 +-
code/modules/admin/topic.dm | 30 ++++-----
code/modules/library/lib_machines.dm | 2 +-
code/modules/newscaster/feed_channel.dm | 10 +--
code/modules/newscaster/feed_comment.dm | 2 +-
code/modules/newscaster/feed_message.dm | 12 ++--
code/modules/newscaster/feed_network.dm | 12 ++--
code/modules/newscaster/news_datum.dm | 2 +-
code/modules/newscaster/newscaster.dm | 70 ++++++++++-----------
code/modules/newscaster/wanted_message.dm | 2 +-
13 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm
index 19ee2b2a5a..3f33214668 100644
--- a/code/__HELPERS/roundend.dm
+++ b/code/__HELPERS/roundend.dm
@@ -139,19 +139,19 @@
var/list/file_data = list()
var/pos = 1
for(var/V in GLOB.news_network.network_channels)
- var/datum/newscaster/feed_channel/channel = V
+ var/datum/news/feed_channel/channel = V
if(!istype(channel))
stack_trace("Non-channel in newscaster channel list")
continue
file_data["[pos]"] = list("channel name" = "[channel.channel_name]", "author" = "[channel.author]", "censored" = channel.censored ? 1 : 0, "author censored" = channel.authorCensor ? 1 : 0, "messages" = list())
for(var/M in channel.messages)
- var/datum/newscaster/feed_message/message = M
+ var/datum/news/feed_message/message = M
if(!istype(message))
stack_trace("Non-message in newscaster channel messages list")
continue
var/list/comment_data = list()
for(var/C in message.comments)
- var/datum/newscaster/feed_comment/comment = C
+ var/datum/news/feed_comment/comment = C
if(!istype(comment))
stack_trace("Non-message in newscaster message comments list")
continue
diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm
index b186c29539..7b66f68a79 100644
--- a/code/game/objects/items/devices/PDA/cart.dm
+++ b/code/game/objects/items/devices/PDA/cart.dm
@@ -562,22 +562,22 @@ Code:
if (53) // Newscaster
menu = "
[PDAIMG(notes)] Newscaster Access
"
menu += "
Current Newsfeed: [current_channel ? current_channel : "None"]
"
- var/datum/newscaster/feed_channel/current
- for(var/datum/newscaster/feed_channel/chan in GLOB.news_network.network_channels)
+ var/datum/news/feed_channel/current
+ for(var/datum/news/feed_channel/chan in GLOB.news_network.network_channels)
if (chan.channel_name == current_channel)
current = chan
if(!current)
menu += " ERROR : NO CHANNEL FOUND
"
return
var/i = 1
- for(var/datum/newscaster/feed_message/msg in current.messages)
+ for(var/datum/news/feed_message/msg in current.messages)
menu +="-[msg.returnBody(-1)]
\[Story by [msg.returnAuthor(-1)]\]
"
menu +="[msg.comments.len] comment[msg.comments.len > 1 ? "s" : ""]
"
if(msg.img)
user << browse_rsc(msg.img, "tmp_photo[i].png")
menu +="
"
i++
- for(var/datum/newscaster/feed_comment/comment in msg.comments)
+ for(var/datum/news/feed_comment/comment in msg.comments)
menu +="[comment.body]
[comment.author] [comment.time_stamp]
"
menu += "
Post Message"
@@ -681,8 +681,8 @@ Code:
if("Newscaster Message")
var/host_pda_owner_name = host_pda.id ? "[host_pda.id.registered_name] ([host_pda.id.assignment])" : "Unknown"
var/message = host_pda.msg_input()
- var/datum/newscaster/feed_channel/current
- for(var/datum/newscaster/feed_channel/chan in GLOB.news_network.network_channels)
+ var/datum/news/feed_channel/current
+ for(var/datum/news/feed_channel/chan in GLOB.news_network.network_channels)
if (chan.channel_name == current_channel)
current = chan
if(current.locked && current.author != host_pda_owner_name)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 372902e8d6..bb0224bbfc 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -240,7 +240,7 @@
if( isemptylist(GLOB.news_network.network_channels) )
dat+="No active channels found..."
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
if(CHANNEL.is_admin_channel)
dat+="[CHANNEL.channel_name]
"
else
@@ -277,7 +277,7 @@
if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]")
dat+="•Invalid channel name.
"
var/check = 0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
check = 1
break
@@ -294,7 +294,7 @@
dat+="No feed messages found in channel...
"
else
var/i = 0
- for(var/datum/newscaster/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
i++
dat+="-[MESSAGE.returnBody(-1)]
"
if(MESSAGE.img)
@@ -302,7 +302,7 @@
dat+="
"
dat+="\[Story by [MESSAGE.returnAuthor(-1)]\]
"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]:
"
- for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
+ for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body]
[comment.author] [comment.time_stamp]
"
dat+="
"
dat+="
Refresh"
@@ -315,7 +315,7 @@
if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Cancel"
if(11)
@@ -326,7 +326,7 @@
if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Back"
@@ -337,11 +337,11 @@
if( isemptylist(src.admincaster_feed_channel.messages) )
dat+="No feed messages found in channel...
"
else
- for(var/datum/newscaster/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
dat+="-[MESSAGE.returnBody(-1)]
\[Story by [MESSAGE.returnAuthor(-1)]\]
"
dat+="[(MESSAGE.bodyCensor) ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.authorCensor) ? ("Undo Author Censorship") : ("Censor message Author")]
"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]: [MESSAGE.locked ? "Unlock" : "Lock"]
"
- for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
+ for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body] X
[comment.author] [comment.time_stamp]
"
dat+="
Back"
if(13)
@@ -354,7 +354,7 @@
if( isemptylist(src.admincaster_feed_channel.messages) )
dat+="No feed messages found in channel...
"
else
- for(var/datum/newscaster/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
dat+="-[MESSAGE.returnBody(-1)]
\[Story by [MESSAGE.returnAuthor(-1)]\]
"
dat+="
Back"
if(14)
diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm
index 43360ad714..37fe2a41fc 100644
--- a/code/modules/admin/holder2.dm
+++ b/code/modules/admin/holder2.dm
@@ -19,9 +19,9 @@ GLOBAL_PROTECT(href_token)
var/spamcooldown = 0
var/admincaster_screen = 0 //TODO: remove all these 5 variables, they are completly unacceptable
- var/datum/newscaster/feed_message/admincaster_feed_message = new /datum/newscaster/feed_message
- var/datum/newscaster/wanted_message/admincaster_wanted_message = new /datum/newscaster/wanted_message
- var/datum/newscaster/feed_channel/admincaster_feed_channel = new /datum/newscaster/feed_channel
+ var/datum/news/feed_message/admincaster_feed_message = new /datum/news/feed_message
+ var/datum/news/wanted_message/admincaster_wanted_message = new /datum/news/wanted_message
+ var/datum/news/feed_channel/admincaster_feed_channel = new /datum/news/feed_channel
var/admin_signature
var/href_token
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 70b25bebdd..6abf2d3f1b 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -2481,7 +2481,7 @@
if(!check_rights(R_ADMIN))
return
var/check = 0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == src.admincaster_feed_channel.channel_name)
check = 1
break
@@ -2500,7 +2500,7 @@
if(!check_rights(R_ADMIN))
return
var/list/available_channels = list()
- for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/F in GLOB.news_network.network_channels)
available_channels += F.channel_name
src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel.", "Network Channel Handler") in available_channels )
src.access_news_network()
@@ -2606,28 +2606,28 @@
else if(href_list["ac_censor_channel_author"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_channel/FC = locate(href_list["ac_censor_channel_author"])
+ var/datum/news/feed_channel/FC = locate(href_list["ac_censor_channel_author"])
FC.toggleCensorAuthor()
src.access_news_network()
else if(href_list["ac_censor_channel_story_author"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"])
+ var/datum/news/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"])
MSG.toggleCensorAuthor()
src.access_news_network()
else if(href_list["ac_censor_channel_story_body"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"])
+ var/datum/news/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"])
MSG.toggleCensorBody()
src.access_news_network()
else if(href_list["ac_pick_d_notice"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_channel/FC = locate(href_list["ac_pick_d_notice"])
+ var/datum/news/feed_channel/FC = locate(href_list["ac_pick_d_notice"])
src.admincaster_feed_channel = FC
src.admincaster_screen=13
src.access_news_network()
@@ -2635,7 +2635,7 @@
else if(href_list["ac_toggle_d_notice"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_channel/FC = locate(href_list["ac_toggle_d_notice"])
+ var/datum/news/feed_channel/FC = locate(href_list["ac_toggle_d_notice"])
FC.toggleCensorDclass()
src.access_news_network()
@@ -2651,17 +2651,17 @@
src.admincaster_screen = text2num(href_list["ac_setScreen"])
if (src.admincaster_screen == 0)
if(src.admincaster_feed_channel)
- src.admincaster_feed_channel = new /datum/newscaster/feed_channel
+ src.admincaster_feed_channel = new /datum/news/feed_channel
if(src.admincaster_feed_message)
- src.admincaster_feed_message = new /datum/newscaster/feed_message
+ src.admincaster_feed_message = new /datum/news/feed_message
if(admincaster_wanted_message)
- admincaster_wanted_message = new /datum/newscaster/wanted_message
+ admincaster_wanted_message = new /datum/news/wanted_message
src.access_news_network()
else if(href_list["ac_show_channel"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_channel/FC = locate(href_list["ac_show_channel"])
+ var/datum/news/feed_channel/FC = locate(href_list["ac_show_channel"])
src.admincaster_feed_channel = FC
src.admincaster_screen = 9
src.access_news_network()
@@ -2669,7 +2669,7 @@
else if(href_list["ac_pick_censor_channel"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_channel/FC = locate(href_list["ac_pick_censor_channel"])
+ var/datum/news/feed_channel/FC = locate(href_list["ac_pick_censor_channel"])
src.admincaster_feed_channel = FC
src.admincaster_screen = 12
src.access_news_network()
@@ -2688,8 +2688,8 @@
else if(href_list["ac_del_comment"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_comment/FC = locate(href_list["ac_del_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["ac_del_comment_msg"])
+ var/datum/news/feed_comment/FC = locate(href_list["ac_del_comment"])
+ var/datum/news/feed_message/FM = locate(href_list["ac_del_comment_msg"])
FM.comments -= FC
qdel(FC)
src.access_news_network()
@@ -2697,7 +2697,7 @@
else if(href_list["ac_lock_comment"])
if(!check_rights(R_ADMIN))
return
- var/datum/newscaster/feed_message/FM = locate(href_list["ac_lock_comment"])
+ var/datum/news/feed_message/FM = locate(href_list["ac_lock_comment"])
FM.locked ^= 1
src.access_news_network()
diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm
index 204a2de9a6..008724b10f 100644
--- a/code/modules/library/lib_machines.dm
+++ b/code/modules/library/lib_machines.dm
@@ -441,7 +441,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
if(!GLOB.news_network)
alert("No news network found on station. Aborting.")
var/channelexists = 0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == "Nanotrasen Book Club")
channelexists = 1
break
diff --git a/code/modules/newscaster/feed_channel.dm b/code/modules/newscaster/feed_channel.dm
index 98c8d35493..8bd639b3dc 100644
--- a/code/modules/newscaster/feed_channel.dm
+++ b/code/modules/newscaster/feed_channel.dm
@@ -1,6 +1,6 @@
-/datum/newscaster/feed_channel
+/datum/news/feed_channel
var/channel_name = ""
- var/list/datum/newscaster/feed_message/messages = list()
+ var/list/datum/news/feed_message/messages = list()
var/locked = FALSE
var/author = ""
var/censored = 0
@@ -9,7 +9,7 @@
var/authorCensor
var/is_admin_channel = 0
-/datum/newscaster/feed_channel/proc/returnAuthor(censor)
+/datum/news/feed_channel/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
@@ -17,7 +17,7 @@
txt = author
return txt
-/datum/newscaster/feed_channel/proc/toggleCensorDclass()
+/datum/news/feed_channel/proc/toggleCensorDclass()
if(censored)
DclassCensorTime.Add(GLOB.news_network.lastAction*-1)
else
@@ -25,7 +25,7 @@
censored = !censored
GLOB.news_network.lastAction ++
-/datum/newscaster/feed_channel/proc/toggleCensorAuthor()
+/datum/news/feed_channel/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
diff --git a/code/modules/newscaster/feed_comment.dm b/code/modules/newscaster/feed_comment.dm
index f5f847ab8e..9eba2d73dc 100644
--- a/code/modules/newscaster/feed_comment.dm
+++ b/code/modules/newscaster/feed_comment.dm
@@ -1,4 +1,4 @@
-/datum/newscaster/feed_comment
+/datum/news/feed_comment
var/author = ""
var/body = ""
var/time_stamp = ""
diff --git a/code/modules/newscaster/feed_message.dm b/code/modules/newscaster/feed_message.dm
index 1930177555..f9c3da554e 100644
--- a/code/modules/newscaster/feed_message.dm
+++ b/code/modules/newscaster/feed_message.dm
@@ -1,4 +1,4 @@
-/datum/newscaster/feed_message
+/datum/news/feed_message
var/author =""
var/body =""
var/list/authorCensorTime = list()
@@ -6,7 +6,7 @@
var/is_admin_message = 0
var/icon/img = null
var/time_stamp = ""
- var/list/datum/newscaster/feed_comment/comments = list()
+ var/list/datum/news/feed_comment/comments = list()
var/locked = FALSE
var/caption = ""
var/creationTime
@@ -14,7 +14,7 @@
var/bodyCensor
var/photo_file
-/datum/newscaster/feed_message/proc/returnAuthor(censor)
+/datum/news/feed_message/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
@@ -22,7 +22,7 @@
txt = author
return txt
-/datum/newscaster/feed_message/proc/returnBody(censor)
+/datum/news/feed_message/proc/returnBody(censor)
if(censor == -1)
censor = bodyCensor
var/txt = "[GLOB.news_network.redactedText]"
@@ -30,7 +30,7 @@
txt = body
return txt
-/datum/newscaster/feed_message/proc/toggleCensorAuthor()
+/datum/news/feed_message/proc/toggleCensorAuthor()
if(authorCensor)
authorCensorTime.Add(GLOB.news_network.lastAction*-1)
else
@@ -38,7 +38,7 @@
authorCensor = !authorCensor
GLOB.news_network.lastAction ++
-/datum/newscaster/feed_message/proc/toggleCensorBody()
+/datum/news/feed_message/proc/toggleCensorBody()
if(bodyCensor)
bodyCensorTime.Add(GLOB.news_network.lastAction*-1)
else
diff --git a/code/modules/newscaster/feed_network.dm b/code/modules/newscaster/feed_network.dm
index b1e8ad19ae..5e056addee 100644
--- a/code/modules/newscaster/feed_network.dm
+++ b/code/modules/newscaster/feed_network.dm
@@ -2,17 +2,17 @@ GLOBAL_DATUM_INIT(news_network, /datum/news_network, new)
/// Contains all the news datum of a newscaster system.
/datum/news_network
- var/list/datum/newscaster/feed_channel/network_channels = list()
- var/datum/newscaster/wanted_message/wanted_issue
+ var/list/datum/news/feed_channel/network_channels = list()
+ var/datum/news/wanted_message/wanted_issue
var/lastAction
var/redactedText = "\[REDACTED\]"
/datum/news_network/New()
CreateFeedChannel("Station Announcements", "SS13", 1)
- wanted_issue = new /datum/newscaster/wanted_message
+ wanted_issue = new /datum/news/wanted_message
/datum/news_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
- var/datum/newscaster/feed_channel/newChannel = new /datum/newscaster/feed_channel
+ var/datum/news/feed_channel/newChannel = new /datum/news/feed_channel
newChannel.channel_name = channel_name
newChannel.author = author
newChannel.locked = locked
@@ -20,7 +20,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/news_network, new)
network_channels += newChannel
/datum/news_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
- var/datum/newscaster/feed_message/newMsg = new /datum/newscaster/feed_message
+ var/datum/news/feed_message/newMsg = new /datum/news/feed_message
newMsg.author = author
newMsg.body = msg
newMsg.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
@@ -30,7 +30,7 @@ GLOBAL_DATUM_INIT(news_network, /datum/news_network, new)
newMsg.img = picture.picture_image
newMsg.caption = picture.caption
newMsg.photo_file = save_photo(picture.picture_image)
- for(var/datum/newscaster/feed_channel/FC in network_channels)
+ for(var/datum/news/feed_channel/FC in network_channels)
if(FC.channel_name == channel_name)
FC.messages += newMsg
break
diff --git a/code/modules/newscaster/news_datum.dm b/code/modules/newscaster/news_datum.dm
index 3c42d04734..5fcf3b4551 100644
--- a/code/modules/newscaster/news_datum.dm
+++ b/code/modules/newscaster/news_datum.dm
@@ -1 +1 @@
-/datum/newscaster
+/datum/news
diff --git a/code/modules/newscaster/newscaster.dm b/code/modules/newscaster/newscaster.dm
index e9458666f3..88379efcf8 100644
--- a/code/modules/newscaster/newscaster.dm
+++ b/code/modules/newscaster/newscaster.dm
@@ -29,7 +29,7 @@ GLOBAL_LIST_EMPTY(allCasters)
var/datum/picture/picture
var/channel_name = ""
var/c_locked=0
- var/datum/newscaster/feed_channel/viewing_channel = null
+ var/datum/news/feed_channel/viewing_channel = null
var/allow_comments = 1
/obj/machinery/newscaster/security_unit
@@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if( isemptylist(GLOB.news_network.network_channels) )
dat+="No active channels found..."
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
if(CHANNEL.is_admin_channel)
dat+="[CHANNEL.channel_name]
"
else
@@ -162,7 +162,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(7)
dat+="ERROR: Could not submit Feed Channel to Network.
"
var/list/existing_authors = list()
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.authorCensor)
existing_authors += GLOB.news_network.redactedText
else
@@ -172,7 +172,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="Invalid channel name.
"
var/check = 0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == channel_name)
check = 1
break
@@ -185,7 +185,7 @@ GLOBAL_LIST_EMPTY(allCasters)
var/total_num=length(GLOB.news_network.network_channels)
var/active_num=total_num
var/message_num=0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(!FC.censored)
message_num += length(FC.messages)
else
@@ -204,7 +204,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="No feed messages found in channel...
"
else
var/i = 0
- for(var/datum/newscaster/feed_message/MESSAGE in viewing_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in viewing_channel.messages)
i++
dat+="-[MESSAGE.returnBody(-1)]
"
if(MESSAGE.img)
@@ -215,7 +215,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="
"
dat+="\[Story by [MESSAGE.returnAuthor(-1)] \] - ([MESSAGE.time_stamp])
"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]
"
- for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
+ for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body]
[comment.author] [comment.time_stamp]
"
if(MESSAGE.locked)
dat+="Comments locked
"
@@ -231,7 +231,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Cancel"
if(11)
@@ -242,7 +242,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(GLOB.news_network.network_channels))
dat+="No feed channels found active...
"
else
- for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ""]
"
dat+="
Back"
if(12)
@@ -251,11 +251,11 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(viewing_channel.messages))
dat+="No feed messages found in channel...
"
else
- for(var/datum/newscaster/feed_message/MESSAGE in viewing_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in viewing_channel.messages)
dat+="-[MESSAGE.returnBody(-1)]
\[Story by [MESSAGE.returnAuthor(-1)]\]
"
dat+="[(MESSAGE.bodyCensor) ? ("Undo story censorship") : ("Censor story")] - [(MESSAGE.authorCensor) ? ("Undo Author Censorship") : ("Censor message Author")]
"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]: [MESSAGE.locked ? "Unlock" : "Lock"]
"
- for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
+ for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body] X
[comment.author] [comment.time_stamp]
"
dat+="
Back"
if(13)
@@ -268,7 +268,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(viewing_channel.messages))
dat+="No feed messages found in channel...
"
else
- for(var/datum/newscaster/feed_message/MESSAGE in viewing_channel.messages)
+ for(var/datum/news/feed_message/MESSAGE in viewing_channel.messages)
dat+="-[MESSAGE.returnBody(-1)]
\[Story by [MESSAGE.returnAuthor(-1)]\]
"
dat+="
Back"
if(14)
@@ -349,13 +349,13 @@ GLOBAL_LIST_EMPTY(allCasters)
updateUsrDialog()
else if(href_list["submit_new_channel"])
var/list/existing_authors = list()
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.authorCensor)
existing_authors += GLOB.news_network.redactedText
else
existing_authors += FC.author
var/check = 0
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
if(FC.channel_name == channel_name)
check = 1
break
@@ -371,7 +371,7 @@ GLOBAL_LIST_EMPTY(allCasters)
updateUsrDialog()
else if(href_list["set_channel_receiving"])
var/list/available_channels = list()
- for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/F in GLOB.news_network.network_channels)
if( (!F.locked || F.author == scanned_user) && !F.censored)
available_channels += F.channel_name
channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels
@@ -461,33 +461,33 @@ GLOBAL_LIST_EMPTY(allCasters)
screen=18
updateUsrDialog()
else if(href_list["censor_channel_author"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["censor_channel_author"])
+ var/datum/news/feed_channel/FC = locate(href_list["censor_channel_author"])
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
return
FC.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_author"])
- var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_author"])
+ var/datum/news/feed_message/MSG = locate(href_list["censor_channel_story_author"])
if(MSG.is_admin_message)
alert("This message was created by a Nanotrasen Officer. You cannot censor its author.","Ok")
return
MSG.toggleCensorAuthor()
updateUsrDialog()
else if(href_list["censor_channel_story_body"])
- var/datum/newscaster/feed_message/MSG = locate(href_list["censor_channel_story_body"])
+ var/datum/news/feed_message/MSG = locate(href_list["censor_channel_story_body"])
if(MSG.is_admin_message)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
return
MSG.toggleCensorBody()
updateUsrDialog()
else if(href_list["pick_d_notice"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["pick_d_notice"])
+ var/datum/news/feed_channel/FC = locate(href_list["pick_d_notice"])
viewing_channel = FC
screen=13
updateUsrDialog()
else if(href_list["toggle_d_notice"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["toggle_d_notice"])
+ var/datum/news/feed_channel/FC = locate(href_list["toggle_d_notice"])
if(FC.is_admin_channel)
alert("This channel was created by a Nanotrasen Officer. You cannot place a D-Notice upon it.","Ok")
return
@@ -506,21 +506,21 @@ GLOBAL_LIST_EMPTY(allCasters)
viewing_channel = null
updateUsrDialog()
else if(href_list["show_channel"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["show_channel"])
+ var/datum/news/feed_channel/FC = locate(href_list["show_channel"])
viewing_channel = FC
screen = 9
updateUsrDialog()
else if(href_list["pick_censor_channel"])
- var/datum/newscaster/feed_channel/FC = locate(href_list["pick_censor_channel"])
+ var/datum/news/feed_channel/FC = locate(href_list["pick_censor_channel"])
viewing_channel = FC
screen = 12
updateUsrDialog()
else if(href_list["new_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["new_comment"])
+ var/datum/news/feed_message/FM = locate(href_list["new_comment"])
var/cominput = copytext_char(stripped_input(usr, "Write your message:", "New comment", null), 140)
if(cominput)
scan_user(usr)
- var/datum/newscaster/feed_comment/FC = new/datum/newscaster/feed_comment
+ var/datum/news/feed_comment/FC = new/datum/news/feed_comment
FC.author = scanned_user
FC.body = cominput
FC.time_stamp = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
@@ -528,14 +528,14 @@ GLOBAL_LIST_EMPTY(allCasters)
usr.log_message("(as [scanned_user]) commented on message [FM.returnBody(-1)] -- [FC.body]", LOG_COMMENT)
updateUsrDialog()
else if(href_list["del_comment"])
- var/datum/newscaster/feed_comment/FC = locate(href_list["del_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["del_comment_msg"])
+ var/datum/news/feed_comment/FC = locate(href_list["del_comment"])
+ var/datum/news/feed_message/FM = locate(href_list["del_comment_msg"])
if(istype(FC) && istype(FM))
FM.comments -= FC
qdel(FC)
updateUsrDialog()
else if(href_list["lock_comment"])
- var/datum/newscaster/feed_message/FM = locate(href_list["lock_comment"])
+ var/datum/news/feed_message/FM = locate(href_list["lock_comment"])
FM.locked ^= 1
updateUsrDialog()
else if(href_list["set_comment"])
@@ -660,7 +660,7 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/machinery/newscaster/proc/print_paper()
SSblackbox.record_feedback("amount", "newspapers_printed", 1)
var/obj/item/newspaper/NEWSPAPER = new /obj/item/newspaper
- for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels)
+ for(var/datum/news/feed_channel/FC in GLOB.news_network.network_channels)
NEWSPAPER.news_content += FC
if(GLOB.news_network.wanted_issue.active)
NEWSPAPER.wantedAuthor = GLOB.news_network.wanted_issue.scannedUser
@@ -701,7 +701,7 @@ GLOBAL_LIST_EMPTY(allCasters)
var/screen = 0
var/pages = 0
var/curr_page = 0
- var/list/datum/newscaster/feed_channel/news_content = list()
+ var/list/datum/news/feed_channel/news_content = list()
var/scribble=""
var/scribble_page = null
var/wantedAuthor
@@ -737,12 +737,12 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="Other than the title, the rest of the newspaper is unprinted..."
else
dat+="Contents:
"
- for(var/datum/newscaster/feed_channel/NP in news_content)
+ for(var/datum/news/feed_channel/NP in news_content)
pages++
if(wantedAuthor)
dat+="**Important Security Announcement** \[page [pages+2]\]
"
var/temp_page=0
- for(var/datum/newscaster/feed_channel/NP in news_content)
+ for(var/datum/news/feed_channel/NP in news_content)
temp_page++
dat+="[NP.channel_name] \[page [temp_page+1]\]
"
dat+="
"
@@ -750,9 +750,9 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
dat+= "
"
if(1) // X channel pages inbetween.
- for(var/datum/newscaster/feed_channel/NP in news_content)
+ for(var/datum/news/feed_channel/NP in news_content)
pages++
- var/datum/newscaster/feed_channel/C = news_content[curr_page]
+ var/datum/news/feed_channel/C = news_content[curr_page]
dat += "[C.channel_name] \[created by: [C.returnAuthor(notContent(C.authorCensorTime))]\]
"
if(notContent(C.DclassCensorTime))
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing."
@@ -761,7 +761,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="No Feed stories stem from this channel..."
else
var/i = 0
- for(var/datum/newscaster/feed_message/MESSAGE in C.messages)
+ for(var/datum/news/feed_message/MESSAGE in C.messages)
if(MESSAGE.creationTime > creationTime)
if(i == 0)
dat+="No Feed stories stem from this channel..."
@@ -779,7 +779,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
dat+= "
"
if(2) //Last page
- for(var/datum/newscaster/feed_channel/NP in news_content)
+ for(var/datum/news/feed_channel/NP in news_content)
pages++
if(wantedAuthor!=null)
dat+="Wanted Issue:
"
diff --git a/code/modules/newscaster/wanted_message.dm b/code/modules/newscaster/wanted_message.dm
index de67bbeaf5..58eb234f02 100644
--- a/code/modules/newscaster/wanted_message.dm
+++ b/code/modules/newscaster/wanted_message.dm
@@ -1,4 +1,4 @@
-/datum/newscaster/wanted_message
+/datum/news/wanted_message
var/active
var/criminal
var/body
From 7921013f560053c11fde274c9e284fb2772e7693 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:24:55 -0700
Subject: [PATCH 05/11] news reading
---
code/modules/newscaster/_news.dm | 2 +
code/modules/newscaster/feed_channel.dm | 1 -
code/modules/newscaster/feed_comment.dm | 1 -
code/modules/newscaster/feed_message.dm | 1 -
code/modules/newscaster/ghostread.dm | 49 +++++
code/modules/newscaster/news_datum.dm | 1 -
.../{feed_network.dm => news_network.dm} | 0
.../{newscaster.dm => newscaster_machine.dm} | 176 ------------------
code/modules/newscaster/newspaper.dm | 173 +++++++++++++++++
tgstation.dme | 10 +-
10 files changed, 233 insertions(+), 181 deletions(-)
create mode 100644 code/modules/newscaster/_news.dm
create mode 100644 code/modules/newscaster/ghostread.dm
delete mode 100644 code/modules/newscaster/news_datum.dm
rename code/modules/newscaster/{feed_network.dm => news_network.dm} (100%)
rename code/modules/newscaster/{newscaster.dm => newscaster_machine.dm} (81%)
create mode 100644 code/modules/newscaster/newspaper.dm
diff --git a/code/modules/newscaster/_news.dm b/code/modules/newscaster/_news.dm
new file mode 100644
index 0000000000..6c6f10fdcc
--- /dev/null
+++ b/code/modules/newscaster/_news.dm
@@ -0,0 +1,2 @@
+/datum/news
+ var/author = ""
diff --git a/code/modules/newscaster/feed_channel.dm b/code/modules/newscaster/feed_channel.dm
index 8bd639b3dc..278c9c7ad1 100644
--- a/code/modules/newscaster/feed_channel.dm
+++ b/code/modules/newscaster/feed_channel.dm
@@ -2,7 +2,6 @@
var/channel_name = ""
var/list/datum/news/feed_message/messages = list()
var/locked = FALSE
- var/author = ""
var/censored = 0
var/list/authorCensorTime = list()
var/list/DclassCensorTime = list()
diff --git a/code/modules/newscaster/feed_comment.dm b/code/modules/newscaster/feed_comment.dm
index 9eba2d73dc..ff5ebac028 100644
--- a/code/modules/newscaster/feed_comment.dm
+++ b/code/modules/newscaster/feed_comment.dm
@@ -1,4 +1,3 @@
/datum/news/feed_comment
- var/author = ""
var/body = ""
var/time_stamp = ""
diff --git a/code/modules/newscaster/feed_message.dm b/code/modules/newscaster/feed_message.dm
index f9c3da554e..573b3f772d 100644
--- a/code/modules/newscaster/feed_message.dm
+++ b/code/modules/newscaster/feed_message.dm
@@ -1,5 +1,4 @@
/datum/news/feed_message
- var/author =""
var/body =""
var/list/authorCensorTime = list()
var/list/bodyCensorTime = list()
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
new file mode 100644
index 0000000000..5cf36e1164
--- /dev/null
+++ b/code/modules/newscaster/ghostread.dm
@@ -0,0 +1,49 @@
+/mob/dead/observer/verb/read_news()
+ var/datum/browser/popup = new(user, "ghost_news_list", 450, 600)
+ popup.set_content(render_news_channel_list())
+ popup.open()
+
+/mob/dead/observer/Topic(href, href_list)
+ . = ..()
+ if(href_list["show_news_channel"])
+ var/datum/D = locate(href_list["show_news_channel"])
+ if(istype(D, /datum/news/feed_channel)) //safety
+ render_news_channel(D)
+
+/mob/dead/observer/proc/render_news_channel_list()
+ var/datum/news_network = GLOB.news_network()
+ var/list/content = list()
+ for(var/i in news_network.network_channels)
+ var/datum/news/feed_channel/FC = i
+ content += "[FC.name] ([length(FC.messages)] messages)[FC.locked? " (LOCKED)":""][FC.censored? " (CENSORED)":""][FC.is_admin_channel? " (ADMIN)":""]"
+ return content.Join("
")
+
+/mob/dead/observer/proc/render_news_channel(datum/news/feed_channel/FC)
+ var/list/content = list()
+ content += "[viewing_channel.channel_name]: \[created by: [viewing_channel.returnAuthor(-1)]\]
"
+ if(FC.censored)
+ content += "ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
"
+ content += "No further feed story additions are allowed while the D-Notice is in effect.
"
+ if(!length(FC.messages))
+ content += "This channel is empty.
"
+ for(var/i in FC.messages)
+ var/datum/feed_message/FM = i
+ content += "
+ content += "-[FM.returnBody(-1)]
"
+ if(FM.img)
+ src << browse_rsc(FM.img, "tmp_photo[i].png")
+ content += "
"
+ if(FC.caption)
+ content += "[FM.caption]
"
+ content += "
"
+ content += "\[Story by [FM.returnAuthor(-1)] \] - ([FM.time_stamp])
"
+ content += "[FM.comments.len] comment[FM.comments.len > 1 ? "s" : ""]
"
+ for(var/i in FM.comments)
+ var/datum/news/feed_comment/FC = i
+ content += "[FC.body]
[FC.author] [FC.time_stamp]
"
+ if(FM.locked)
+ content += "Comments locked
"
+ var/datum/browser/popup = new(src, "ghost_news_channel", 450, 900)
+ popup.set_content(content.Join(""))
+ popup.open()
+
diff --git a/code/modules/newscaster/news_datum.dm b/code/modules/newscaster/news_datum.dm
deleted file mode 100644
index 5fcf3b4551..0000000000
--- a/code/modules/newscaster/news_datum.dm
+++ /dev/null
@@ -1 +0,0 @@
-/datum/news
diff --git a/code/modules/newscaster/feed_network.dm b/code/modules/newscaster/news_network.dm
similarity index 100%
rename from code/modules/newscaster/feed_network.dm
rename to code/modules/newscaster/news_network.dm
diff --git a/code/modules/newscaster/newscaster.dm b/code/modules/newscaster/newscaster_machine.dm
similarity index 81%
rename from code/modules/newscaster/newscaster.dm
rename to code/modules/newscaster/newscaster_machine.dm
index 88379efcf8..6328087491 100644
--- a/code/modules/newscaster/newscaster.dm
+++ b/code/modules/newscaster/newscaster_machine.dm
@@ -672,7 +672,6 @@ GLOBAL_LIST_EMPTY(allCasters)
NEWSPAPER.creationTime = GLOB.news_network.lastAction
paper_remaining--
-
/obj/machinery/newscaster/proc/remove_alert()
alert = FALSE
update_icon()
@@ -687,178 +686,3 @@ GLOBAL_LIST_EMPTY(allCasters)
else
say("Attention! Wanted issue distributed!")
playsound(loc, 'sound/machines/warning-buzzer.ogg', 75, 1)
-
-
-/obj/item/newspaper
- name = "newspaper"
- desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations."
- icon = 'icons/obj/bureaucracy.dmi'
- icon_state = "newspaper"
- lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
- righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
- w_class = WEIGHT_CLASS_SMALL
- attack_verb = list("bapped")
- var/screen = 0
- var/pages = 0
- var/curr_page = 0
- var/list/datum/news/feed_channel/news_content = list()
- var/scribble=""
- var/scribble_page = null
- var/wantedAuthor
- var/wantedCriminal
- var/wantedBody
- var/wantedPhoto
- var/creationTime
-
-/obj/item/newspaper/suicide_act(mob/user)
- user.visible_message("[user] is focusing intently on [src]! It looks like [user.p_theyre()] trying to commit sudoku... until [user.p_their()] eyes light up with realization!")
- user.say(";JOURNALISM IS MY CALLING! EVERYBODY APPRECIATES UNBIASED REPORTI-GLORF", forced="newspaper suicide")
- var/mob/living/carbon/human/H = user
- var/obj/W = new /obj/item/reagent_containers/food/drinks/bottle/whiskey(H.loc)
- playsound(H.loc, 'sound/items/drink.ogg', rand(10,50), 1)
- W.reagents.trans_to(H, W.reagents.total_volume)
- user.visible_message("[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!")
-
- return(TOXLOSS)
-
-/obj/item/newspaper/attack_self(mob/user)
- if(ishuman(user))
- var/mob/living/carbon/human/human_user = user
- var/dat
- pages = 0
- switch(screen)
- if(0) //Cover
- dat+="The Griffon
"
- dat+="Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities
"
- if(isemptylist(news_content))
- if(wantedAuthor)
- dat+="Contents:
**Important Security Announcement** \[page [pages+2]\]
"
- else
- dat+="Other than the title, the rest of the newspaper is unprinted..."
- else
- dat+="Contents:
"
- for(var/datum/news/feed_channel/NP in news_content)
- pages++
- if(wantedAuthor)
- dat+="**Important Security Announcement** \[page [pages+2]\]
"
- var/temp_page=0
- for(var/datum/news/feed_channel/NP in news_content)
- temp_page++
- dat+="[NP.channel_name] \[page [temp_page+1]\]
"
- dat+="
"
- if(scribble_page==curr_page)
- dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
- dat+= "
"
- if(1) // X channel pages inbetween.
- for(var/datum/news/feed_channel/NP in news_content)
- pages++
- var/datum/news/feed_channel/C = news_content[curr_page]
- dat += "[C.channel_name] \[created by: [C.returnAuthor(notContent(C.authorCensorTime))]\]
"
- if(notContent(C.DclassCensorTime))
- dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing."
- else
- if(isemptylist(C.messages))
- dat+="No Feed stories stem from this channel..."
- else
- var/i = 0
- for(var/datum/news/feed_message/MESSAGE in C.messages)
- if(MESSAGE.creationTime > creationTime)
- if(i == 0)
- dat+="No Feed stories stem from this channel..."
- break
- if(i == 0)
- dat+=""
- i++
- dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))]
"
- if(MESSAGE.img)
- user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
- dat+="
"
- dat+="\[Story by [MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]\]
"
- dat+="
"
- if(scribble_page==curr_page)
- dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
- dat+= "
"
- if(2) //Last page
- for(var/datum/news/feed_channel/NP in news_content)
- pages++
- if(wantedAuthor!=null)
- dat+="Wanted Issue:
"
- dat+="Criminal name: [wantedCriminal]
"
- dat+="Description: [wantedBody]
"
- dat+="Photo:: "
- if(wantedPhoto)
- user << browse_rsc(wantedPhoto, "tmp_photow.png")
- dat+="
"
- else
- dat+="None"
- else
- dat+="Apart from some uninteresting classified ads, there's nothing on this page..."
- if(scribble_page==curr_page)
- dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
- dat+= "
"
- dat+="
[curr_page+1]
"
- human_user << browse(dat, "window=newspaper_main;size=300x400")
- onclose(human_user, "newspaper_main")
- else
- to_chat(user, "The paper is full of unintelligible symbols!")
-
-/obj/item/newspaper/proc/notContent(list/L)
- if(!L.len)
- return 0
- for(var/i=L.len;i>0;i--)
- var/num = abs(L[i])
- if(creationTime <= num)
- continue
- else
- if(L[i] > 0)
- return 1
- else
- return 0
- return 0
-
-/obj/item/newspaper/Topic(href, href_list)
- var/mob/living/U = usr
- ..()
- if((src in U.contents) || (isturf(loc) && in_range(src, U)))
- U.set_machine(src)
- if(href_list["next_page"])
- if(curr_page == pages+1)
- return //Don't need that at all, but anyway.
- if(curr_page == pages) //We're at the middle, get to the end
- screen = 2
- else
- if(curr_page == 0) //We're at the start, get to the middle
- screen=1
- curr_page++
- playsound(loc, "pageturn", 50, 1)
- else if(href_list["prev_page"])
- if(curr_page == 0)
- return
- if(curr_page == 1)
- screen = 0
- else
- if(curr_page == pages+1) //we're at the end, let's go back to the middle.
- screen = 1
- curr_page--
- playsound(loc, "pageturn", 50, 1)
- if(ismob(loc))
- attack_self(loc)
-
-/obj/item/newspaper/attackby(obj/item/W, mob/user, params)
- if(istype(W, /obj/item/pen))
- if(!user.is_literate())
- to_chat(user, "You scribble illegibly on [src]!")
- return
- if(scribble_page == curr_page)
- to_chat(user, "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?")
- else
- var/s = stripped_input(user, "Write something", "Newspaper")
- if (!s)
- return
- if(!user.canUseTopic(src, BE_CLOSE))
- return
- scribble_page = curr_page
- scribble = s
- attack_self(user)
- else
- return ..()
diff --git a/code/modules/newscaster/newspaper.dm b/code/modules/newscaster/newspaper.dm
new file mode 100644
index 0000000000..0afb36a7e7
--- /dev/null
+++ b/code/modules/newscaster/newspaper.dm
@@ -0,0 +1,173 @@
+/obj/item/newspaper
+ name = "newspaper"
+ desc = "An issue of The Griffon, the newspaper circulating aboard Nanotrasen Space Stations."
+ icon = 'icons/obj/bureaucracy.dmi'
+ icon_state = "newspaper"
+ lefthand_file = 'icons/mob/inhands/misc/books_lefthand.dmi'
+ righthand_file = 'icons/mob/inhands/misc/books_righthand.dmi'
+ w_class = WEIGHT_CLASS_SMALL
+ attack_verb = list("bapped")
+ var/screen = 0
+ var/pages = 0
+ var/curr_page = 0
+ var/list/datum/news/feed_channel/news_content = list()
+ var/scribble=""
+ var/scribble_page = null
+ var/wantedAuthor
+ var/wantedCriminal
+ var/wantedBody
+ var/wantedPhoto
+ var/creationTime
+
+/obj/item/newspaper/suicide_act(mob/user)
+ user.visible_message("[user] is focusing intently on [src]! It looks like [user.p_theyre()] trying to commit sudoku... until [user.p_their()] eyes light up with realization!")
+ user.say(";JOURNALISM IS MY CALLING! EVERYBODY APPRECIATES UNBIASED REPORTI-GLORF", forced="newspaper suicide")
+ var/mob/living/carbon/human/H = user
+ var/obj/W = new /obj/item/reagent_containers/food/drinks/bottle/whiskey(H.loc)
+ playsound(H.loc, 'sound/items/drink.ogg', rand(10,50), 1)
+ W.reagents.trans_to(H, W.reagents.total_volume)
+ user.visible_message("[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!")
+
+ return(TOXLOSS)
+
+/obj/item/newspaper/attack_self(mob/user)
+ if(ishuman(user))
+ var/mob/living/carbon/human/human_user = user
+ var/dat
+ pages = 0
+ switch(screen)
+ if(0) //Cover
+ dat+="The Griffon
"
+ dat+="Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities
"
+ if(isemptylist(news_content))
+ if(wantedAuthor)
+ dat+="Contents:
**Important Security Announcement** \[page [pages+2]\]
"
+ else
+ dat+="Other than the title, the rest of the newspaper is unprinted..."
+ else
+ dat+="Contents:
"
+ for(var/datum/news/feed_channel/NP in news_content)
+ pages++
+ if(wantedAuthor)
+ dat+="**Important Security Announcement** \[page [pages+2]\]
"
+ var/temp_page=0
+ for(var/datum/news/feed_channel/NP in news_content)
+ temp_page++
+ dat+="[NP.channel_name] \[page [temp_page+1]\]
"
+ dat+="
"
+ if(scribble_page==curr_page)
+ dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
+ dat+= "
"
+ if(1) // X channel pages inbetween.
+ for(var/datum/news/feed_channel/NP in news_content)
+ pages++
+ var/datum/news/feed_channel/C = news_content[curr_page]
+ dat += "[C.channel_name] \[created by: [C.returnAuthor(notContent(C.authorCensorTime))]\]
"
+ if(notContent(C.DclassCensorTime))
+ dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a D-Notice. Its contents were not transferred to the newspaper at the time of printing."
+ else
+ if(isemptylist(C.messages))
+ dat+="No Feed stories stem from this channel..."
+ else
+ var/i = 0
+ for(var/datum/news/feed_message/MESSAGE in C.messages)
+ if(MESSAGE.creationTime > creationTime)
+ if(i == 0)
+ dat+="No Feed stories stem from this channel..."
+ break
+ if(i == 0)
+ dat+=""
+ i++
+ dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))]
"
+ if(MESSAGE.img)
+ user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
+ dat+="
"
+ dat+="\[Story by [MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]\]
"
+ dat+="
"
+ if(scribble_page==curr_page)
+ dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
+ dat+= "
"
+ if(2) //Last page
+ for(var/datum/news/feed_channel/NP in news_content)
+ pages++
+ if(wantedAuthor!=null)
+ dat+="Wanted Issue:
"
+ dat+="Criminal name: [wantedCriminal]
"
+ dat+="Description: [wantedBody]
"
+ dat+="Photo:: "
+ if(wantedPhoto)
+ user << browse_rsc(wantedPhoto, "tmp_photow.png")
+ dat+="
"
+ else
+ dat+="None"
+ else
+ dat+="Apart from some uninteresting classified ads, there's nothing on this page..."
+ if(scribble_page==curr_page)
+ dat+="
There is a small scribble near the end of this page... It reads: \"[scribble]\""
+ dat+= "
"
+ dat+="
[curr_page+1]
"
+ human_user << browse(dat, "window=newspaper_main;size=300x400")
+ onclose(human_user, "newspaper_main")
+ else
+ to_chat(user, "The paper is full of unintelligible symbols!")
+
+/obj/item/newspaper/proc/notContent(list/L)
+ if(!L.len)
+ return 0
+ for(var/i=L.len;i>0;i--)
+ var/num = abs(L[i])
+ if(creationTime <= num)
+ continue
+ else
+ if(L[i] > 0)
+ return 1
+ else
+ return 0
+ return 0
+
+/obj/item/newspaper/Topic(href, href_list)
+ var/mob/living/U = usr
+ ..()
+ if((src in U.contents) || (isturf(loc) && in_range(src, U)))
+ U.set_machine(src)
+ if(href_list["next_page"])
+ if(curr_page == pages+1)
+ return //Don't need that at all, but anyway.
+ if(curr_page == pages) //We're at the middle, get to the end
+ screen = 2
+ else
+ if(curr_page == 0) //We're at the start, get to the middle
+ screen=1
+ curr_page++
+ playsound(loc, "pageturn", 50, 1)
+ else if(href_list["prev_page"])
+ if(curr_page == 0)
+ return
+ if(curr_page == 1)
+ screen = 0
+ else
+ if(curr_page == pages+1) //we're at the end, let's go back to the middle.
+ screen = 1
+ curr_page--
+ playsound(loc, "pageturn", 50, 1)
+ if(ismob(loc))
+ attack_self(loc)
+
+/obj/item/newspaper/attackby(obj/item/W, mob/user, params)
+ if(istype(W, /obj/item/pen))
+ if(!user.is_literate())
+ to_chat(user, "You scribble illegibly on [src]!")
+ return
+ if(scribble_page == curr_page)
+ to_chat(user, "There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?")
+ else
+ var/s = stripped_input(user, "Write something", "Newspaper")
+ if (!s)
+ return
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
+ scribble_page = curr_page
+ scribble = s
+ attack_self(user)
+ else
+ return ..()
diff --git a/tgstation.dme b/tgstation.dme
index 8c578e70f0..caf364d42f 100755
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -663,7 +663,6 @@
#include "code\game\machinery\magnet.dm"
#include "code\game\machinery\mass_driver.dm"
#include "code\game\machinery\navbeacon.dm"
-#include "code\game\machinery\newscaster.dm"
#include "code\game\machinery\PDApainter.dm"
#include "code\game\machinery\quantum_pad.dm"
#include "code\game\machinery\recharger.dm"
@@ -2461,6 +2460,15 @@
#include "code\modules\modular_computers\hardware\printer.dm"
#include "code\modules\modular_computers\hardware\recharger.dm"
#include "code\modules\modular_computers\NTNet\NTNRC\conversation.dm"
+#include "code\modules\newscaster\_news.dm"
+#include "code\modules\newscaster\feed_channel.dm"
+#include "code\modules\newscaster\feed_comment.dm"
+#include "code\modules\newscaster\feed_message.dm"
+#include "code\modules\newscaster\ghostread.dm"
+#include "code\modules\newscaster\news_network.dm"
+#include "code\modules\newscaster\newscaster_machine.dm"
+#include "code\modules\newscaster\newspaper.dm"
+#include "code\modules\newscaster\wanted_message.dm"
#include "code\modules\ninja\__ninjaDefines.dm"
#include "code\modules\ninja\energy_katana.dm"
#include "code\modules\ninja\ninja_event.dm"
From 6eae30cb660efd18341ea659878f9c20a23c87bf Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:25:27 -0700
Subject: [PATCH 06/11] whoops
---
code/modules/newscaster/ghostread.dm | 1 -
1 file changed, 1 deletion(-)
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
index 5cf36e1164..d62bf1bb4e 100644
--- a/code/modules/newscaster/ghostread.dm
+++ b/code/modules/newscaster/ghostread.dm
@@ -28,7 +28,6 @@
content += "This channel is empty.
"
for(var/i in FC.messages)
var/datum/feed_message/FM = i
- content += "
content += "-[FM.returnBody(-1)]
"
if(FM.img)
src << browse_rsc(FM.img, "tmp_photo[i].png")
From 3019f0d0fcde50863ccce8a6446ee58ad5a83574 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:29:36 -0700
Subject: [PATCH 07/11] path
---
code/modules/newscaster/ghostread.dm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
index d62bf1bb4e..4a7dbf9f22 100644
--- a/code/modules/newscaster/ghostread.dm
+++ b/code/modules/newscaster/ghostread.dm
@@ -1,4 +1,8 @@
/mob/dead/observer/verb/read_news()
+ set name = "Read Newscaster"
+ set desc = "Open a list of available news channels"
+ set category = "Ghost"
+
var/datum/browser/popup = new(user, "ghost_news_list", 450, 600)
popup.set_content(render_news_channel_list())
popup.open()
@@ -11,7 +15,7 @@
render_news_channel(D)
/mob/dead/observer/proc/render_news_channel_list()
- var/datum/news_network = GLOB.news_network()
+ var/datum/news_network = GLOB.news_network
var/list/content = list()
for(var/i in news_network.network_channels)
var/datum/news/feed_channel/FC = i
@@ -27,7 +31,7 @@
if(!length(FC.messages))
content += "This channel is empty.
"
for(var/i in FC.messages)
- var/datum/feed_message/FM = i
+ var/datum/news/feed_message/FM = i
content += "-[FM.returnBody(-1)]
"
if(FM.img)
src << browse_rsc(FM.img, "tmp_photo[i].png")
From db4a0ebb3f819a6fe029a540304b594a76dbae27 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:32:19 -0700
Subject: [PATCH 08/11] pathing
---
code/modules/newscaster/ghostread.dm | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
index 4a7dbf9f22..42b2033080 100644
--- a/code/modules/newscaster/ghostread.dm
+++ b/code/modules/newscaster/ghostread.dm
@@ -3,7 +3,7 @@
set desc = "Open a list of available news channels"
set category = "Ghost"
- var/datum/browser/popup = new(user, "ghost_news_list", 450, 600)
+ var/datum/browser/popup = new(user, "ghost_news_list", "Chanenl List", 450, 600)
popup.set_content(render_news_channel_list())
popup.open()
@@ -19,12 +19,12 @@
var/list/content = list()
for(var/i in news_network.network_channels)
var/datum/news/feed_channel/FC = i
- content += "[FC.name] ([length(FC.messages)] messages)[FC.locked? " (LOCKED)":""][FC.censored? " (CENSORED)":""][FC.is_admin_channel? " (ADMIN)":""]"
+ content += "[FC.channel_name] ([length(FC.messages)] messages)[FC.locked? " (LOCKED)":""][FC.censored? " (CENSORED)":""][FC.is_admin_channel? " (ADMIN)":""]"
return content.Join("
")
/mob/dead/observer/proc/render_news_channel(datum/news/feed_channel/FC)
var/list/content = list()
- content += "[viewing_channel.channel_name]: \[created by: [viewing_channel.returnAuthor(-1)]\]
"
+ content += "[FC.channel_name]: \[created by: [FC.returnAuthor(-1)]\]
"
if(FC.censored)
content += "ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
"
content += "No further feed story additions are allowed while the D-Notice is in effect.
"
@@ -42,11 +42,10 @@
content += "\[Story by [FM.returnAuthor(-1)] \] - ([FM.time_stamp])
"
content += "[FM.comments.len] comment[FM.comments.len > 1 ? "s" : ""]
"
for(var/i in FM.comments)
- var/datum/news/feed_comment/FC = i
- content += "[FC.body]
[FC.author] [FC.time_stamp]
"
+ var/datum/news/feed_comment/comment = i
+ content += "[comment.body]
[comment.author] [comment.time_stamp]
"
if(FM.locked)
content += "Comments locked
"
var/datum/browser/popup = new(src, "ghost_news_channel", 450, 900)
popup.set_content(content.Join(""))
popup.open()
-
From 842a5cccf38fb742e2ddc96e5f945d53ba4a0a73 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:34:24 -0700
Subject: [PATCH 09/11] varnames
---
code/modules/newscaster/ghostread.dm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
index 42b2033080..c9a44b8f58 100644
--- a/code/modules/newscaster/ghostread.dm
+++ b/code/modules/newscaster/ghostread.dm
@@ -3,9 +3,9 @@
set desc = "Open a list of available news channels"
set category = "Ghost"
- var/datum/browser/popup = new(user, "ghost_news_list", "Chanenl List", 450, 600)
- popup.set_content(render_news_channel_list())
- popup.open()
+ var/datum/browser/B = new(src, "ghost_news_list", "Chanenl List", 450, 600)
+ B.set_content(render_news_channel_list())
+ B.open()
/mob/dead/observer/Topic(href, href_list)
. = ..()
@@ -15,7 +15,7 @@
render_news_channel(D)
/mob/dead/observer/proc/render_news_channel_list()
- var/datum/news_network = GLOB.news_network
+ var/datum/news_network/news_network = GLOB.news_network
var/list/content = list()
for(var/i in news_network.network_channels)
var/datum/news/feed_channel/FC = i
@@ -29,7 +29,8 @@
content += "ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.
"
content += "No further feed story additions are allowed while the D-Notice is in effect.
"
if(!length(FC.messages))
- content += "This channel is empty.
"
+ content += "This channel is empty.
"
+ else
for(var/i in FC.messages)
var/datum/news/feed_message/FM = i
content += "-[FM.returnBody(-1)]
"
@@ -41,8 +42,8 @@
content += "
"
content += "\[Story by [FM.returnAuthor(-1)] \] - ([FM.time_stamp])
"
content += "[FM.comments.len] comment[FM.comments.len > 1 ? "s" : ""]
"
- for(var/i in FM.comments)
- var/datum/news/feed_comment/comment = i
+ for(var/c in FM.comments)
+ var/datum/news/feed_comment/comment = c
content += "[comment.body]
[comment.author] [comment.time_stamp]
"
if(FM.locked)
content += "Comments locked
"
From 3cd35787617485f86e2944bdf0ecee563896badb Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Thu, 6 Feb 2020 00:44:28 -0700
Subject: [PATCH 10/11] wrong var
---
code/modules/newscaster/ghostread.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/newscaster/ghostread.dm b/code/modules/newscaster/ghostread.dm
index c9a44b8f58..77cb1a03c8 100644
--- a/code/modules/newscaster/ghostread.dm
+++ b/code/modules/newscaster/ghostread.dm
@@ -37,7 +37,7 @@
if(FM.img)
src << browse_rsc(FM.img, "tmp_photo[i].png")
content += "
"
- if(FC.caption)
+ if(FM.caption)
content += "[FM.caption]
"
content += "
"
content += "\[Story by [FM.returnAuthor(-1)] \] - ([FM.time_stamp])
"
From 32a5957c183478864f44d7ab3318aaa020d1bddf Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Mon, 10 Feb 2020 04:30:07 -0700
Subject: [PATCH 11/11] usr
---
code/game/turfs/turf.dm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index d8434f986c..e8f53f551d 100755
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -363,13 +363,13 @@
if(.)
return
if(length(src_object.contents()))
- to_chat(usr, "You start dumping out the contents...")
- if(!do_after(usr,20,target=src_object.parent))
+ to_chat(user, "You start dumping out the contents...")
+ if(!do_after(user,20,target=src_object.parent))
return FALSE
var/list/things = src_object.contents()
var/datum/progressbar/progress = new(user, things.len, src)
- while (do_after(usr, 10, TRUE, src, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress)))
+ while (do_after(user, 10, TRUE, src, FALSE, CALLBACK(src_object, /datum/component/storage.proc/mass_remove_from_storage, src, things, progress)))
stoplag(1)
qdel(progress)