mirror of
https://github.com/CHOMPstation/CHOMPstation.git
synced 2026-08-25 04:56:29 +01:00
Merge pull request #6084 from PsiOmegaDelta/MoreNounce
Announcement Refactoring
This commit is contained in:
@@ -43,6 +43,12 @@
|
||||
var/stat_msg1
|
||||
var/stat_msg2
|
||||
|
||||
var/datum/announcement/priority/crew_announcement = new
|
||||
|
||||
New()
|
||||
..()
|
||||
crew_announcement.newscast = 1
|
||||
|
||||
Reset()
|
||||
..()
|
||||
authenticated = 0
|
||||
@@ -68,11 +74,13 @@
|
||||
authenticated = 1
|
||||
if(access_captain in I.GetAccess())
|
||||
authenticated = 2
|
||||
crew_announcement.announcer = GetNameAndAssignmentFromId(I)
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
authenticated = 2
|
||||
computer.emagged = 1
|
||||
if("logout" in href_list)
|
||||
authenticated = 0
|
||||
crew_announcement.announcer = ""
|
||||
|
||||
if("swipeidseclevel" in href_list)
|
||||
var/mob/M = usr
|
||||
@@ -104,13 +112,13 @@
|
||||
usr << "You need to swipe your ID."
|
||||
if("announce" in href_list)
|
||||
if(authenticated==2)
|
||||
if(message_cooldown) return
|
||||
var/input = stripped_input(usr, "Please choose a message to announce to the station crew.", "What?")
|
||||
if(message_cooldown)
|
||||
usr << "Please allow at least one minute to pass between announcements"
|
||||
return
|
||||
var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
|
||||
if(!input || !interactable())
|
||||
return
|
||||
captain_announce(input)//This should really tell who is, IE HoP, CE, HoS, RD, Captain
|
||||
log_say("[key_name(usr)] has made a captain announcement: [input]")
|
||||
message_admins("[key_name_admin(usr)] has made a captain announcement.", 1)
|
||||
crew_announcement.Announce(input)
|
||||
message_cooldown = 1
|
||||
spawn(600)//One minute cooldown
|
||||
message_cooldown = 0
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
author = "NanoTrasen Editor"
|
||||
channel_name = "Nyx Daily"
|
||||
can_be_redacted = 0
|
||||
message_type = "Story"
|
||||
|
||||
revolution_inciting_event
|
||||
|
||||
@@ -128,13 +129,6 @@ proc/check_for_newscaster_updates(type)
|
||||
announce_newscaster_news(news)
|
||||
|
||||
proc/announce_newscaster_news(datum/news_announcement/news)
|
||||
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = news.author
|
||||
newMsg.is_admin_message = !news.can_be_redacted
|
||||
|
||||
newMsg.body = news.message
|
||||
|
||||
var/datum/feed_channel/sendto
|
||||
for(var/datum/feed_channel/FC in news_network.network_channels)
|
||||
if(FC.channel_name == news.channel_name)
|
||||
@@ -149,6 +143,12 @@ proc/announce_newscaster_news(datum/news_announcement/news)
|
||||
sendto.is_admin_channel = 1
|
||||
news_network.network_channels += sendto
|
||||
|
||||
var/datum/feed_message/newMsg = new /datum/feed_message
|
||||
newMsg.author = news.author ? news.author : sendto.author
|
||||
newMsg.is_admin_message = !news.can_be_redacted
|
||||
newMsg.body = news.message
|
||||
newMsg.message_type = news.message_type
|
||||
|
||||
sendto.messages += newMsg
|
||||
|
||||
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
|
||||
|
||||
Reference in New Issue
Block a user