/proc/show_individual_logging_panel(mob/M, source = LOGSRC_CLIENT, type = INDIVIDUAL_ATTACK_LOG)
if(!M || !ismob(M))
return
//Add client links
var/dat = ""
if(M.client)
dat += "
Client
"
dat += "Attack log | "
dat += "Say log | "
dat += "Emote log | "
dat += "OOC log | "
dat += "Show all | "
dat += "Refresh"
else
dat += " No client attached to mob
"
dat += "
"
dat += "Mob
"
//Add the links for the mob specific log
dat += "Attack log | "
dat += "Say log | "
dat += "Emote log | "
dat += "OOC log | "
dat += "Show all | "
dat += "Refresh"
dat += "
"
var/log_source = M.logging;
if(source == LOGSRC_CLIENT && M.client) //if client doesn't exist just fall back to the mob log
log_source = M.client.player_details.logging //should exist, if it doesn't that's a bug, don't check for it not existing
if(type == INDIVIDUAL_SHOW_ALL_LOG)
dat += "Displaying all [source] logs of [key_name(M)]
"
for(var/log_type in log_source)
dat += "[log_type]
"
var/list/reversed = log_source[log_type]
if(islist(reversed))
reversed = reverseRange(reversed.Copy())
for(var/entry in reversed)
dat += "[entry]: [reversed[entry]]
"
dat += "
"
else
dat += "[source] [type] of [key_name(M)]
"
var/list/reversed = log_source[type]
if(reversed)
reversed = reverseRange(reversed.Copy())
for(var/entry in reversed)
dat += "[entry]: [reversed[entry]]
"
usr << browse(dat, "window=invidual_logging_[key_name(M)];size=600x480")