Request Console cleanup.

Changes screen and departmentType to use defines and bitflags instead of magic numbers.
Moves code from the message sender to send_rc_message().
One console's destruction no longer prevents the entire department from receiving messages.
This commit is contained in:
Techhead0
2015-06-03 17:04:07 -04:00
parent b144a00ddc
commit 0195c179ff
4 changed files with 125 additions and 218 deletions

View File

@@ -108,6 +108,34 @@ var/global/list/obj/machinery/message_server/message_servers = list()
/obj/machinery/message_server/proc/send_rc_message(var/recipient = "",var/sender = "",var/message = "",var/stamp = "", var/id_auth = "", var/priority = 1)
rc_msgs += new/datum/data_rc_msg(recipient,sender,message,stamp,id_auth)
var/authmsg = "[message]<br>"
if (id_auth)
authmsg += "[id_auth]<br>"
if (stamp)
authmsg += "[stamp]<br>"
for (var/obj/machinery/requests_console/Console in allConsoles)
if (ckey(Console.department) == ckey(recipient))
if(Console.newmessagepriority < priority)
Console.newmessagepriority = priority
Console.icon_state = "req_comp[priority]"
switch(priority)
if(2)
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'PRIORITY Alert in [sender]'"),,5)
Console.messages += "<B><FONT color='red'>High Priority message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></FONT></B><BR>[authmsg]"
if(3)
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 70, 1)
Console.audible_message(text("\icon[Console] *The Requests Console yells: 'EXTREME PRIORITY alert in [sender]'"),,7)
Console.messages += "<B><FONT color='red'>Extreme Priority message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></FONT></B><BR>[authmsg]"
else
if(!Console.silent)
playsound(Console.loc, 'sound/machines/twobeep.ogg', 50, 1)
Console.audible_message(text("\icon[Console] *The Requests Console beeps: 'Message from [sender]'"),,4)
Console.messages += "<B>Message from <A href='?src=\ref[Console];write=[ckey(sender)]'>[sender]</A></B><BR>[authmsg]"
Console.set_light(2)
/obj/machinery/message_server/attack_hand(user as mob)
// user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."