Update newscaster.dm
This commit is contained in:
@@ -22,6 +22,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
var/creationTime
|
||||
var/authorCensor
|
||||
var/bodyCensor
|
||||
var/photo_file
|
||||
|
||||
/datum/newscaster/feed_message/proc/returnAuthor(censor)
|
||||
if(censor == -1)
|
||||
@@ -97,6 +98,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
var/scannedUser
|
||||
var/isAdminMsg
|
||||
var/icon/img
|
||||
var/photo_file
|
||||
|
||||
/datum/newscaster/feed_network
|
||||
var/list/datum/newscaster/feed_channel/network_channels = list()
|
||||
@@ -126,6 +128,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
if(photo)
|
||||
newMsg.img = photo.img
|
||||
newMsg.caption = photo.scribble
|
||||
newMsg.photo_file = save_photo(photo.img)
|
||||
for(var/datum/newscaster/feed_channel/FC in network_channels)
|
||||
if(FC.channel_name == channel_name)
|
||||
FC.messages += newMsg
|
||||
@@ -143,6 +146,7 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
wanted_issue.isAdminMsg = adminMsg
|
||||
if(photo)
|
||||
wanted_issue.img = photo.img
|
||||
wanted_issue.photo_file = save_photo(photo.img)
|
||||
if(newMessage)
|
||||
for(var/obj/machinery/newscaster/N in GLOB.allCasters)
|
||||
N.newsAlert()
|
||||
@@ -157,7 +161,12 @@ GLOBAL_LIST_EMPTY(allCasters)
|
||||
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(md5("\icon[photo]"), 1, 6)
|
||||
if(!fexists("[GLOB.log_directory]/photos/[photo_file].png"))
|
||||
var/icon/p = icon(photo, frame = 1)
|
||||
fcopy(p, "[GLOB.log_directory]/photos/[photo_file].png")
|
||||
return photo_file
|
||||
|
||||
/obj/item/wallframe/newscaster
|
||||
name = "newscaster frame"
|
||||
|
||||
Reference in New Issue
Block a user