diff --git a/code/modules/admin/verbs/individual_logging.dm b/code/modules/admin/verbs/individual_logging.dm index 7fe4c070d2..9ad07ac1b2 100644 --- a/code/modules/admin/verbs/individual_logging.dm +++ b/code/modules/admin/verbs/individual_logging.dm @@ -5,7 +5,7 @@ var/ntype = text2num(type) //Add client links - var/dat = "" + var/list/dat = list() if(M.client) dat += "

Client

" dat += "
" @@ -46,22 +46,27 @@ 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 - + var/list/concatenated_logs = list() for(var/log_type in log_source) var/nlog_type = text2num(log_type) if(nlog_type & ntype) - var/list/reversed = log_source[log_type] - if(islist(reversed)) - reversed = reverseRange(reversed.Copy()) - for(var/entry in reversed) - dat += "[entry]
[reversed[entry]]

" - dat += "
" + var/list/all_the_entrys = log_source[log_type] + for(var/entry in all_the_entrys) + concatenated_logs += "[entry]
[all_the_entrys[entry]]" + if(length(concatenated_logs)) + sortTim(concatenated_logs, cmp = /proc/cmp_text_dsc) //Sort by timestamp. + dat += "" + dat += concatenated_logs.Join("
") + dat += "
" - usr << browse(dat, "window=invidual_logging_[key_name(M)];size=600x480") + var/datum/browser/popup = new(usr, "invidual_logging_[key_name(M)]", "Individual Logs", 600, 600) + popup.set_content(dat.Join()) + popup.open() /proc/individual_logging_panel_link(mob/M, log_type, log_src, label, selected_src, selected_type) var/slabel = label if(selected_type == log_type && selected_src == log_src) slabel = "\[[label]\]" - - return "[slabel]" \ No newline at end of file + //This is necessary because num2text drops digits and rounds on big numbers. If more defines get added in the future it could break again. + log_type = num2text(log_type, MAX_BITFLAG_DIGITS) + return "[slabel]"