|
|
|
@@ -93,6 +93,8 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
|
|
|
|
|
var/underline_flag = TRUE //flag for underline
|
|
|
|
|
|
|
|
|
|
var/list/blocked_pdas
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/suicide_act(mob/living/carbon/user)
|
|
|
|
|
var/deathMessage = msg_input(user)
|
|
|
|
|
if (!deathMessage)
|
|
|
|
@@ -387,7 +389,10 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
for (var/obj/item/pda/P in sortNames(get_viewable_pdas()))
|
|
|
|
|
if (P == src)
|
|
|
|
|
continue
|
|
|
|
|
dat += "<li><a href='byond://?src=[REF(src)];choice=Message;target=[REF(P)]'>[P]</a>"
|
|
|
|
|
if(P.owner in blocked_pdas)
|
|
|
|
|
dat += "<li><a href='byond://?src=[REF(src)];choice=unblock_pda;target=[P.owner]'>(BLOCKED - CLICK TO UNBLOCK) [P]</a>"
|
|
|
|
|
else
|
|
|
|
|
dat += "<li><a href='byond://?src=[REF(src)];choice=Message;target=[REF(P)]'>[P]</a>"
|
|
|
|
|
if(cartridge)
|
|
|
|
|
dat += cartridge.message_special(P)
|
|
|
|
|
dat += "</li>"
|
|
|
|
@@ -646,6 +651,15 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
if("MessageAll")
|
|
|
|
|
send_to_all(U)
|
|
|
|
|
|
|
|
|
|
if("toggle_block")
|
|
|
|
|
toggle_blocking(usr, href_list["target"])
|
|
|
|
|
|
|
|
|
|
if("block_pda")
|
|
|
|
|
block_pda(usr, href_list["target"])
|
|
|
|
|
|
|
|
|
|
if("unblock_pda")
|
|
|
|
|
unblock_pda(usr, href_list["target"])
|
|
|
|
|
|
|
|
|
|
if("cart")
|
|
|
|
|
if(cartridge)
|
|
|
|
|
cartridge.special(U, href_list)
|
|
|
|
@@ -744,9 +758,16 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
message += "\nSent from my PDA"
|
|
|
|
|
// Send the signal
|
|
|
|
|
var/list/string_targets = list()
|
|
|
|
|
for (var/obj/item/pda/P in targets)
|
|
|
|
|
if (P.owner && P.ownjob) // != src is checked by the UI
|
|
|
|
|
var/list/string_blocked
|
|
|
|
|
for(var/obj/item/pda/P in targets)
|
|
|
|
|
if(owner in P.blocked_pdas)
|
|
|
|
|
LAZYADD(string_blocked, P.owner)
|
|
|
|
|
continue
|
|
|
|
|
if(P.owner && P.ownjob) // != src is checked by the UI
|
|
|
|
|
string_targets += "[P.owner] ([P.ownjob])"
|
|
|
|
|
if(string_blocked)
|
|
|
|
|
string_blocked = english_list(string_blocked)
|
|
|
|
|
to_chat(user, "<span class='warning'>[icon2html(src, user)] The following recipients have blocked your message: [string_blocked].</span>")
|
|
|
|
|
for (var/obj/machinery/computer/message_monitor/M in targets)
|
|
|
|
|
// In case of "Reply" to a message from a console, this will make the
|
|
|
|
|
// message be logged successfully. If the console is impersonating
|
|
|
|
@@ -779,12 +800,13 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
tnote += "<i><b>→ To [target_text]:</b></i><br>[signal.format_message()]<br>"
|
|
|
|
|
// Show it to ghosts
|
|
|
|
|
var/ghost_message = "<span class='name'>[owner] </span><span class='game say'>PDA Message</span> --> <span class='name'>[target_text]</span>: <span class='message'>[signal.format_message(TRUE)]</span>"
|
|
|
|
|
for(var/mob/M in GLOB.player_list)
|
|
|
|
|
if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA))
|
|
|
|
|
for(var/i in GLOB.dead_mob_list)
|
|
|
|
|
var/mob/M = i
|
|
|
|
|
if(M?.client.prefs.chat_toggles & CHAT_GHOSTPDA)
|
|
|
|
|
to_chat(M, "[FOLLOW_LINK(M, user)] [ghost_message]")
|
|
|
|
|
// Log in the talk log
|
|
|
|
|
user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text]")
|
|
|
|
|
to_chat(user, "<span class='info'>Message sent to [target_text]: \"[emoji_message]\"</span>")
|
|
|
|
|
// Log in the talk log
|
|
|
|
|
user.log_talk(message, LOG_PDA, tag="PDA: [initial(name)] to [target_text] (BLOCKED:[string_blocked])")
|
|
|
|
|
if (!silent)
|
|
|
|
|
playsound(src, 'sound/machines/terminal_success.ogg', 15, 1)
|
|
|
|
|
// Reset the photo
|
|
|
|
@@ -794,8 +816,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
last_everyone = world.time
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/proc/receive_message(datum/signal/subspace/pda/signal)
|
|
|
|
|
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i><br>[signal.format_message()]<br>"
|
|
|
|
|
|
|
|
|
|
tnote += "<i><b>← From <a href='byond://?src=[REF(src)];choice=Message;target=[REF(signal.source)]'>[signal.data["name"]]</a> ([signal.data["job"]]):</b></i> <a href='byond://?src=[REF(src)];choice=toggle_block;target=[signal.data["name"]]'>(BLOCK/UNBLOCK)</a><br>[signal.format_message()]<br>"
|
|
|
|
|
if (!silent)
|
|
|
|
|
playsound(src, 'sound/machines/twobeep.ogg', 50, 1)
|
|
|
|
|
audible_message("[icon2html(src, hearers(src))] *[ttone]*", null, 3)
|
|
|
|
@@ -814,7 +835,7 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
hrefstart = "<a href='?src=[REF(L)];track=[html_encode(signal.data["name"])]'>"
|
|
|
|
|
hrefend = "</a>"
|
|
|
|
|
|
|
|
|
|
to_chat(L, "[icon2html(src)] <b>Message from [hrefstart][signal.data["name"]] ([signal.data["job"]])[hrefend], </b>[signal.format_message(TRUE)] (<a href='byond://?src=[REF(src)];choice=Message;skiprefresh=1;target=[REF(signal.source)]'>Reply</a>)")
|
|
|
|
|
to_chat(L, "[icon2html(src)] <b>Message from [hrefstart][signal.data["name"]] ([signal.data["job"]])[hrefend], </b>[signal.format_message(TRUE)] (<a href='byond://?src=[REF(src)];choice=Message;skiprefresh=1;target=[REF(signal.source)]'>Reply</a>) <a href='byond://?src=[REF(src)];choice=toggle_block;target=[signal.data["name"]]'>(BLOCK/UNBLOCK)</a>")
|
|
|
|
|
|
|
|
|
|
update_icon(TRUE)
|
|
|
|
|
|
|
|
|
@@ -827,6 +848,20 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
/obj/item/pda/proc/create_message(mob/living/U, obj/item/pda/P)
|
|
|
|
|
send_message(U,list(P))
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/proc/toggle_blocking(mob/user, target)
|
|
|
|
|
if(target in blocked_pdas)
|
|
|
|
|
unblock_pda(user, target)
|
|
|
|
|
else
|
|
|
|
|
block_pda(user, target)
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/proc/block_pda(mob/user, target)
|
|
|
|
|
to_chat(user, "<span class='notice'>[icon2html(src, user)] [target] blocked from messages. Use the messenger PDA list to unblock.</span>")
|
|
|
|
|
LAZYOR(blocked_pdas, target)
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/proc/unblock_pda(mob/user, target)
|
|
|
|
|
to_chat(user, "<span class='notice'>[icon2html(src, user)] [target] unblocked from messages.</span>")
|
|
|
|
|
LAZYREMOVE(blocked_pdas, target)
|
|
|
|
|
|
|
|
|
|
/obj/item/pda/AltClick(mob/user)
|
|
|
|
|
. = ..()
|
|
|
|
|
if(id)
|
|
|
|
@@ -1172,4 +1207,4 @@ GLOBAL_LIST_EMPTY(PDAs)
|
|
|
|
|
#undef PDA_OVERLAY_ID
|
|
|
|
|
#undef PDA_OVERLAY_ITEM
|
|
|
|
|
#undef PDA_OVERLAY_LIGHT
|
|
|
|
|
#undef PDA_OVERLAY_PAI
|
|
|
|
|
#undef PDA_OVERLAY_PAI
|
|
|
|
|