Merge pull request #10934 from kevinz000/actual_ghost_newscasters

Ok that last merge was a complete mistake so I kind of redid the feature myself (book/newscaster ghost reading)
This commit is contained in:
Ghom
2020-02-14 19:21:48 +01:00
committed by GitHub
23 changed files with 493 additions and 539 deletions
-2
View File
@@ -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)
+3 -3
View File
@@ -146,19 +146,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
-1
View File
@@ -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.
+1 -1
View File
@@ -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
+6 -6
View File
@@ -563,22 +563,22 @@ Code:
if (53) // Newscaster
menu = "<h4>[PDAIMG(notes)] Newscaster Access</h4>"
menu += "<br> Current Newsfeed: <A href='byond://?src=[REF(src)];choice=Newscaster Switch Channel'>[current_channel ? current_channel : "None"]</a> <br>"
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 += "<h5> ERROR : NO CHANNEL FOUND </h5>"
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)] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[msg.returnAuthor(-1)]</FONT>\]</FONT><BR>"
menu +="<b><font size=1>[msg.comments.len] comment[msg.comments.len > 1 ? "s" : ""]</font></b><br>"
if(msg.img)
user << browse_rsc(msg.img, "tmp_photo[i].png")
menu +="<img src='tmp_photo[i].png' width = '180'><BR>"
i++
for(var/datum/newscaster/feed_comment/comment in msg.comments)
for(var/datum/news/feed_comment/comment in msg.comments)
menu +="<font size=1><small>[comment.body]</font><br><font size=1><small><small><small>[comment.author] [comment.time_stamp]</small></small></small></small></font><br>"
menu += "<br> <A href='byond://?src=[REF(src)];choice=Newscaster Message'>Post Message</a>"
@@ -682,8 +682,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)
+2 -4
View File
@@ -362,16 +362,14 @@
. = ..()
if(.)
return
if(!user || !istype(user, /mob/living))
return FALSE
if(length(src_object.contents()))
to_chat(user, "<span class='notice'>You start dumping out the contents...</span>")
if(!do_after(usr,20,target=src_object.parent))
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)
+9 -9
View File
@@ -240,7 +240,7 @@
if( isemptylist(GLOB.news_network.network_channels) )
dat+="<I>No active channels found...</I>"
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+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=[REF(src)];ac_show_channel=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
else
@@ -277,7 +277,7 @@
if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>•Invalid channel name.</FONT><BR>"
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+="<I>No feed messages found in channel...</I><BR>"
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)] <BR>"
if(MESSAGE.img)
@@ -302,7 +302,7 @@
dat+="<img src='tmp_photo[i].png' width = '180'><BR><BR>"
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)]</FONT>\]</FONT><BR>"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]:<br>"
for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body]<br><font size=1>[comment.author] [comment.time_stamp]</font><br>"
dat+="<br>"
dat+="<BR><HR><A href='?src=[REF(src)];[HrefToken()];ac_refresh=1'>Refresh</A>"
@@ -315,7 +315,7 @@
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
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+="<A href='?src=[REF(src)];[HrefToken()];ac_pick_censor_channel=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[0]'>Cancel</A>"
if(11)
@@ -326,7 +326,7 @@
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
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+="<A href='?src=[REF(src)];[HrefToken()];ac_pick_d_notice=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[0]'>Back</A>"
@@ -337,11 +337,11 @@
if( isemptylist(src.admincaster_feed_channel.messages) )
dat+="<I>No feed messages found in channel...</I><BR>"
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)] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)]</FONT>\]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=[REF(src)];[HrefToken()];ac_censor_channel_story_body=[REF(MESSAGE)]'>[(MESSAGE.bodyCensor) ? ("Undo story censorship") : ("Censor story")]</A> - <A href='?src=[REF(src)];[HrefToken()];ac_censor_channel_story_author=[REF(MESSAGE)]'>[(MESSAGE.authorCensor) ? ("Undo Author Censorship") : ("Censor message Author")]</A></FONT><BR>"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]: <a href='?src=[REF(src)];[HrefToken()];ac_lock_comment=[REF(MESSAGE)]'>[MESSAGE.locked ? "Unlock" : "Lock"]</a><br>"
for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body] <a href='?src=[REF(src)];[HrefToken()];ac_del_comment=[REF(comment)];ac_del_comment_msg=[REF(MESSAGE)]'>X</a><br><font size=1>[comment.author] [comment.time_stamp]</font><br>"
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[10]'>Back</A>"
if(13)
@@ -354,7 +354,7 @@
if( isemptylist(src.admincaster_feed_channel.messages) )
dat+="<I>No feed messages found in channel...</I><BR>"
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)] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)]</FONT>\]</FONT><BR>"
dat+="<BR><A href='?src=[REF(src)];[HrefToken()];ac_setScreen=[11]'>Back</A>"
if(14)
+3 -3
View File
@@ -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
+15 -15
View File
@@ -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()
+19 -17
View File
@@ -112,7 +112,6 @@
else
return ..()
/obj/structure/bookcase/attack_hand(mob/user)
. = ..()
if(.)
@@ -129,14 +128,17 @@
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/attack_ghost(mob/dead/observer/user)
. = ..()
if(!length(contents))
to_chat(user, "<span class='warning'>It's empty!</span>")
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)
@@ -211,14 +213,17 @@
to_chat(user, "<span class='notice'>You skim through the book but can't comprehend any of it.</span>")
return
if(dat)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[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)
onclose(user, "book")
show_to(user)
user.visible_message("[user] opens a book titled \"[title]\" and begins reading intently.")
else
to_chat(user, "<span class='notice'>This book is completely blank!</span>")
/obj/item/book/attack_ghost(mob/dead/observer/O)
. = ..()
show_to(O)
/obj/item/book/proc/show_to(mob/user)
user << browse("<TT><I>Penned by [author].</I></TT> <BR>" + "[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))
@@ -320,9 +325,6 @@
else
..()
/obj/item/book/attack_ghost(mob/user)
attack_self(user)
/*
* Barcode Scanner
+1 -1
View File
@@ -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
+1 -1
View File
@@ -770,7 +770,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
-12
View File
@@ -429,18 +429,6 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
/mob/living/getImplant(type)
return locate(type) in implants
/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)
+2
View File
@@ -0,0 +1,2 @@
/datum/news
var/author = ""
+33
View File
@@ -0,0 +1,33 @@
/datum/news/feed_channel
var/channel_name = ""
var/list/datum/news/feed_message/messages = list()
var/locked = FALSE
var/censored = 0
var/list/authorCensorTime = list()
var/list/DclassCensorTime = list()
var/authorCensor
var/is_admin_channel = 0
/datum/news/feed_channel/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/news/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/news/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 ++
+3
View File
@@ -0,0 +1,3 @@
/datum/news/feed_comment
var/body = ""
var/time_stamp = ""
+46
View File
@@ -0,0 +1,46 @@
/datum/news/feed_message
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/news/feed_comment/comments = list()
var/locked = FALSE
var/caption = ""
var/creationTime
var/authorCensor
var/bodyCensor
var/photo_file
/datum/news/feed_message/proc/returnAuthor(censor)
if(censor == -1)
censor = authorCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = author
return txt
/datum/news/feed_message/proc/returnBody(censor)
if(censor == -1)
censor = bodyCensor
var/txt = "[GLOB.news_network.redactedText]"
if(!censor)
txt = body
return txt
/datum/news/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/news/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 ++
+52
View File
@@ -0,0 +1,52 @@
/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/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)
. = ..()
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/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 += "<b><a href='?_src_=[REF(src)];show_news_channel=[REF(FC)]'>[FC.channel_name] ([length(FC.messages)] messages)[FC.locked? " (LOCKED)":""][FC.censored? " (CENSORED)":""][FC.is_admin_channel? " (ADMIN)":""]</a></b>"
return content.Join("<br>")
/mob/dead/observer/proc/render_news_channel(datum/news/feed_channel/FC)
var/list/content = list()
content += "<B>[FC.channel_name]: </B><FONT SIZE=1>\[created by: <FONT COLOR='maroon'>[FC.returnAuthor(-1)]</FONT>\]</FONT><HR>"
if(FC.censored)
content += "<FONT COLOR='red'><B>ATTENTION: </B></FONT>This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice.<BR>"
content += "No further feed story additions are allowed while the D-Notice is in effect.</FONT><BR><BR>"
if(!length(FC.messages))
content += "<b>This channel is empty.<b><BR>"
else
for(var/i in FC.messages)
var/datum/news/feed_message/FM = i
content += "-[FM.returnBody(-1)] <BR>"
if(FM.img)
src << browse_rsc(FM.img, "tmp_photo[i].png")
content += "<img src='tmp_photo[i].png' width = '180'><BR>"
if(FM.caption)
content += "[FM.caption]<BR>"
content += "<BR>"
content += "<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[FM.returnAuthor(-1)] </FONT>\] - ([FM.time_stamp])</FONT><BR>"
content += "<b><font size=1>[FM.comments.len] comment[FM.comments.len > 1 ? "s" : ""]</font></b><br>"
for(var/c in FM.comments)
var/datum/news/feed_comment/comment = c
content += "<font size=1><small>[comment.body]</font><br><font size=1><small><small><small>[comment.author] [comment.time_stamp]</small></small></small></small></font><br>"
if(FM.locked)
content += "<b>Comments locked</b><br>"
var/datum/browser/popup = new(src, "ghost_news_channel", 450, 900)
popup.set_content(content.Join(""))
popup.open()
+72
View File
@@ -0,0 +1,72 @@
GLOBAL_DATUM_INIT(news_network, /datum/news_network, new)
/// Contains all the news datum of a newscaster system.
/datum/news_network
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/news/wanted_message
/datum/news_network/proc/CreateFeedChannel(channel_name, author, locked, adminChannel = 0)
var/datum/news/feed_channel/newChannel = new /datum/news/feed_channel
newChannel.channel_name = channel_name
newChannel.author = author
newChannel.locked = locked
newChannel.is_admin_channel = adminChannel
network_channels += newChannel
/datum/news_network/proc/SubmitArticle(msg, author, channel_name, datum/picture/picture, adminMessage = 0, allow_comments = 1)
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)
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/news/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/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
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/news_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/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
var/icon/clean = new /icon()
clean.Insert(photo, "", SOUTH, 1, 0)
fcopy(clean, "[GLOB.log_directory]/photos/[photo_file].png")
return photo_file
@@ -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!"
@@ -189,7 +18,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,12 +25,11 @@ 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 = ""
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
@@ -266,10 +93,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].<BR> Interface & News networks Operational."
@@ -281,7 +108,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+= "<BR><A href='?src=[REF(src)];create_feed_story=1'>Submit new Feed story</A>"
dat+= "<BR><A href='?src=[REF(src)];menu_paper=1'>Print newspaper</A>"
dat+= "<BR><A href='?src=[REF(src)];refresh=1'>Re-scan User</A>"
dat+= "<BR><BR><A href='?src=[REF(M)];mach_close=newscaster_main'>Exit</A>"
dat+= "<BR><BR><A href='?src=[REF(human_or_robot_user)];mach_close=newscaster_main'>Exit</A>"
if(securityCaster)
var/wanted_already = 0
if(GLOB.news_network.wanted_issue.active)
@@ -296,7 +123,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if( isemptylist(GLOB.news_network.network_channels) )
dat+="<I>No active channels found...</I>"
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+="<B><FONT style='BACKGROUND-COLOR: LightGreen '><A href='?src=[REF(src)];show_channel=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
else
@@ -335,7 +162,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(7)
dat+="<B><FONT COLOR='maroon'>ERROR: Could not submit Feed Channel to Network.</B></FONT><HR><BR>"
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
@@ -345,7 +172,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(channel_name=="" || channel_name == "\[REDACTED\]")
dat+="<FONT COLOR='maroon'>Invalid channel name.</FONT><BR>"
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
@@ -358,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
@@ -377,7 +204,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="<I>No feed messages found in channel...</I><BR>"
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)] <BR>"
if(MESSAGE.img)
@@ -388,7 +215,7 @@ GLOBAL_LIST_EMPTY(allCasters)
dat+="<BR>"
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)] </FONT>\] - ([MESSAGE.time_stamp])</FONT><BR>"
dat+="<b><font size=1>[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]</font></b><br>"
for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="<font size=1><small>[comment.body]</font><br><font size=1><small><small><small>[comment.author] [comment.time_stamp]</small></small></small></small></font><br>"
if(MESSAGE.locked)
dat+="<b>Comments locked</b><br>"
@@ -404,7 +231,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
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+="<A href='?src=[REF(src)];pick_censor_channel=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[REF(src)];setScreen=[0]'>Cancel</A>"
if(11)
@@ -415,7 +242,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(GLOB.news_network.network_channels))
dat+="<I>No feed channels found active...</I><BR>"
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+="<A href='?src=[REF(src)];pick_d_notice=[REF(CHANNEL)]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ""]<BR>"
dat+="<BR><A href='?src=[REF(src)];setScreen=[0]'>Back</A>"
if(12)
@@ -424,11 +251,11 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(viewing_channel.messages))
dat+="<I>No feed messages found in channel...</I><BR>"
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)] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)]</FONT>\]</FONT><BR>"
dat+="<FONT SIZE=2><A href='?src=[REF(src)];censor_channel_story_body=[REF(MESSAGE)]'>[(MESSAGE.bodyCensor) ? ("Undo story censorship") : ("Censor story")]</A> - <A href='?src=[REF(src)];censor_channel_story_author=[REF(MESSAGE)]'>[(MESSAGE.authorCensor) ? ("Undo Author Censorship") : ("Censor message Author")]</A></FONT><BR>"
dat+="[MESSAGE.comments.len] comment[MESSAGE.comments.len > 1 ? "s" : ""]: <a href='?src=[REF(src)];lock_comment=[REF(MESSAGE)]'>[MESSAGE.locked ? "Unlock" : "Lock"]</a><br>"
for(var/datum/newscaster/feed_comment/comment in MESSAGE.comments)
for(var/datum/news/feed_comment/comment in MESSAGE.comments)
dat+="[comment.body] <a href='?src=[REF(src)];del_comment=[REF(comment)];del_comment_msg=[REF(MESSAGE)]'>X</a><br><font size=1>[comment.author] [comment.time_stamp]</font><br>"
dat+="<BR><A href='?src=[REF(src)];setScreen=[10]'>Back</A>"
if(13)
@@ -441,7 +268,7 @@ GLOBAL_LIST_EMPTY(allCasters)
if(isemptylist(viewing_channel.messages))
dat+="<I>No feed messages found in channel...</I><BR>"
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)] <BR><FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(-1)]</FONT>\]</FONT><BR>"
dat+="<BR><A href='?src=[REF(src)];setScreen=[11]'>Back</A>"
if(14)
@@ -503,44 +330,32 @@ GLOBAL_LIST_EMPTY(allCasters)
if(21)
dat+="<FONT COLOR='maroon'>Unable to print newspaper. Insufficient paper. Please notify maintenance personnel to refill machine storage.</FONT><BR><BR>"
dat+="<A href='?src=[REF(src)];setScreen=[0]'>Return</A>"
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, "<span class='warning'>You must wait for [active_user] to finish and move away.</span>")
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || hasSiliconAccessInArea(usr) || isobserver(usr))
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || hasSiliconAccessInArea(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, "<span class='warning'>You can't do that.</span>")
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, "<span class='warning'>You can't do that.</span>")
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, "<span class='warning'>You can't do that.</span>")
return
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
@@ -555,33 +370,21 @@ 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, "<span class='warning'>You can't do that.</span>")
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)
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
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, "<span class='warning'>You can't do that.</span>")
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, "<span class='warning'>You can't do that.</span>")
return
AttachPhoto(usr)
updateUsrDialog()
else if(href_list["submit_new_message"])
if(isobserver(usr) && !canGhostWrite(usr,src,"added a new story"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "" )
screen=6
else
@@ -591,27 +394,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, "<span class='warning'>You can't do that.</span>")
return
screen=2
updateUsrDialog()
else if(href_list["create_feed_story"])
if(isobserver(usr) && !canGhostWrite(usr,src,"created a feed story"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
screen=3
updateUsrDialog()
else if(href_list["menu_paper"])
if(isobserver(usr) && !canGhostWrite(usr,src,""))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
screen=8
updateUsrDialog()
else if(href_list["print_paper"])
if(isobserver(usr) && !canGhostWrite(usr,src,"printed a paper"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!paper_remaining)
screen=21
else
@@ -619,21 +410,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, "<span class='warning'>You can't do that.</span>")
return
screen=10
updateUsrDialog()
else if(href_list["menu_censor_channel"])
if(isobserver(usr) && !canGhostWrite(usr,src,"censored a channel"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
screen=11
updateUsrDialog()
else if(href_list["menu_wanted"])
if(isobserver(usr) && !canGhostWrite(usr,src,""))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
var/already_wanted = 0
if(GLOB.news_network.wanted_issue.active)
already_wanted = 1
@@ -643,21 +425,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, "<span class='warning'>You can't do that.</span>")
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, "<span class='warning'>You can't do that.</span>")
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, "<span class='warning'>You can't do that.</span>")
return
var/input_param = text2num(href_list["submit_wanted"])
if(msg == "" || channel_name == "" || scanned_user == "Unknown")
screen = 16
@@ -688,48 +461,33 @@ 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, "<span class='warning'>You can't do that.</span>")
return
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"])
if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story's author"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
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"])
if(isobserver(usr) && !canGhostWrite(usr,src,"tried to censor a story"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
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"])
if(isobserver(usr) && !canGhostWrite(usr,src,""))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
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"])
if(isobserver(usr) && !canGhostWrite(usr,src,"tried to set a D-notice"))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
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
@@ -748,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)
@@ -770,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"])
@@ -876,12 +634,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, "<span class='warning'>Wait for [active_user] to finish and move away.</span>")
return
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
if(human_user.wear_id)
@@ -901,19 +653,14 @@ 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)
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
@@ -925,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()
@@ -940,177 +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/newscaster/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("<span class='suicide'>[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!</span>")
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("<span class='suicide'>[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!</span>")
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+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities</FONT></div><HR>"
if(isemptylist(news_content))
if(wantedAuthor)
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
else
dat+="<I>Other than the title, the rest of the newspaper is unprinted...</I>"
else
dat+="Contents:<BR><ul>"
for(var/datum/newscaster/feed_channel/NP in news_content)
pages++
if(wantedAuthor)
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR>"
var/temp_page=0
for(var/datum/newscaster/feed_channel/NP in news_content)
temp_page++
dat+="<B>[NP.channel_name]</B> <FONT SIZE=2>\[page [temp_page+1]\]</FONT><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV> <div style='float:left;'><A href='?src=[REF(human_user)];mach_close=newspaper_main'>Done reading</A></DIV>"
if(1) // X channel pages inbetween.
for(var/datum/newscaster/feed_channel/NP in news_content)
pages++
var/datum/newscaster/feed_channel/C = news_content[curr_page]
dat += "<FONT SIZE=4><B>[C.channel_name]</B></FONT><FONT SIZE=1> \[created by: <FONT COLOR='maroon'>[C.returnAuthor(notContent(C.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
if(notContent(C.DclassCensorTime))
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a <B><FONT COLOR='red'>D-Notice</B></FONT>. Its contents were not transferred to the newspaper at the time of printing."
else
if(isemptylist(C.messages))
dat+="No Feed stories stem from this channel..."
else
var/i = 0
for(var/datum/newscaster/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+="<ul>"
i++
dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))] <BR>"
if(MESSAGE.img)
user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
dat+="<img src='tmp_photo[i].png' width = '180'><BR>"
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<BR><HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV> <DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV>"
if(2) //Last page
for(var/datum/newscaster/feed_channel/NP in news_content)
pages++
if(wantedAuthor!=null)
dat+="<DIV STYLE='float:center;'><FONT SIZE=4><B>Wanted Issue:</B></FONT SIZE></DIV><BR><BR>"
dat+="<B>Criminal name</B>: <FONT COLOR='maroon'>[wantedCriminal]</FONT><BR>"
dat+="<B>Description</B>: [wantedBody]<BR>"
dat+="<B>Photo:</B>: "
if(wantedPhoto)
user << browse_rsc(wantedPhoto, "tmp_photow.png")
dat+="<BR><img src='tmp_photow.png' width = '180'>"
else
dat+="None"
else
dat+="<I>Apart from some uninteresting classified ads, there's nothing on this page...</I>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV>"
dat+="<BR><HR><div align='center'>[curr_page+1]</div>"
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, "<span class='notice'>You scribble illegibly on [src]!</span>")
return
if(scribble_page == curr_page)
to_chat(user, "<span class='notice'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</span>")
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 ..()
+173
View File
@@ -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("<span class='suicide'>[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!</span>")
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("<span class='suicide'>[user] downs the contents of [W.name] in one gulp! Shoulda stuck to sudoku!</span>")
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+="<DIV ALIGN='center'><B><FONT SIZE=6>The Griffon</FONT></B></div>"
dat+="<DIV ALIGN='center'><FONT SIZE=2>Nanotrasen-standard newspaper, for use on Nanotrasen? Space Facilities</FONT></div><HR>"
if(isemptylist(news_content))
if(wantedAuthor)
dat+="Contents:<BR><ul><B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR></ul>"
else
dat+="<I>Other than the title, the rest of the newspaper is unprinted...</I>"
else
dat+="Contents:<BR><ul>"
for(var/datum/news/feed_channel/NP in news_content)
pages++
if(wantedAuthor)
dat+="<B><FONT COLOR='red'>**</FONT>Important Security Announcement<FONT COLOR='red'>**</FONT></B> <FONT SIZE=2>\[page [pages+2]\]</FONT><BR>"
var/temp_page=0
for(var/datum/news/feed_channel/NP in news_content)
temp_page++
dat+="<B>[NP.channel_name]</B> <FONT SIZE=2>\[page [temp_page+1]\]</FONT><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV> <div style='float:left;'><A href='?src=[REF(human_user)];mach_close=newspaper_main'>Done reading</A></DIV>"
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 += "<FONT SIZE=4><B>[C.channel_name]</B></FONT><FONT SIZE=1> \[created by: <FONT COLOR='maroon'>[C.returnAuthor(notContent(C.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
if(notContent(C.DclassCensorTime))
dat+="This channel was deemed dangerous to the general welfare of the station and therefore marked with a <B><FONT COLOR='red'>D-Notice</B></FONT>. Its contents were not transferred to the newspaper at the time of printing."
else
if(isemptylist(C.messages))
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+="<ul>"
i++
dat+="-[MESSAGE.returnBody(notContent(MESSAGE.bodyCensorTime))] <BR>"
if(MESSAGE.img)
user << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
dat+="<img src='tmp_photo[i].png' width = '180'><BR>"
dat+="<FONT SIZE=1>\[Story by <FONT COLOR='maroon'>[MESSAGE.returnAuthor(notContent(MESSAGE.authorCensorTime))]</FONT>\]</FONT><BR><BR>"
dat+="</ul>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<BR><HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV> <DIV STYLE='float:right;'><A href='?src=[REF(src)];next_page=1'>Next Page</A></DIV>"
if(2) //Last page
for(var/datum/news/feed_channel/NP in news_content)
pages++
if(wantedAuthor!=null)
dat+="<DIV STYLE='float:center;'><FONT SIZE=4><B>Wanted Issue:</B></FONT SIZE></DIV><BR><BR>"
dat+="<B>Criminal name</B>: <FONT COLOR='maroon'>[wantedCriminal]</FONT><BR>"
dat+="<B>Description</B>: [wantedBody]<BR>"
dat+="<B>Photo:</B>: "
if(wantedPhoto)
user << browse_rsc(wantedPhoto, "tmp_photow.png")
dat+="<BR><img src='tmp_photow.png' width = '180'>"
else
dat+="None"
else
dat+="<I>Apart from some uninteresting classified ads, there's nothing on this page...</I>"
if(scribble_page==curr_page)
dat+="<BR><I>There is a small scribble near the end of this page... It reads: \"[scribble]\"</I>"
dat+= "<HR><DIV STYLE='float:left;'><A href='?src=[REF(src)];prev_page=1'>Previous Page</A></DIV>"
dat+="<BR><HR><div align='center'>[curr_page+1]</div>"
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, "<span class='notice'>You scribble illegibly on [src]!</span>")
return
if(scribble_page == curr_page)
to_chat(user, "<span class='notice'>There's already a scribble in this page... You wouldn't want to make things too cluttered, would you?</span>")
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 ..()
@@ -0,0 +1,8 @@
/datum/news/wanted_message
var/active
var/criminal
var/body
var/scannedUser
var/isAdminMsg
var/icon/img
var/photo_file
+9 -1
View File
@@ -668,7 +668,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"
@@ -2467,6 +2466,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"