diff --git a/code/__DEFINES/_flags/_flags.dm b/code/__DEFINES/_flags/_flags.dm
index a1d8006dbd..6e018b1eeb 100644
--- a/code/__DEFINES/_flags/_flags.dm
+++ b/code/__DEFINES/_flags/_flags.dm
@@ -162,3 +162,6 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
REMOVE_TRAIT(x, TRAIT_KEEP_TOGETHER, KEEP_TOGETHER_ORIGINAL);\
else if(!HAS_TRAIT(x, TRAIT_KEEP_TOGETHER))\
x.appearance_flags &= ~KEEP_TOGETHER
+
+/// 33554431 (2^24 - 1) is the maximum value our bitflags can reach.
+#define MAX_BITFLAG_DIGITS 8
diff --git a/code/modules/admin/verbs/individual_logging.dm b/code/modules/admin/verbs/individual_logging.dm
index ed5f9af6fe..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]\]"
-
+ //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]"
diff --git a/code/modules/client/verbs/looc.dm b/code/modules/client/verbs/looc.dm
index da39eabc12..67563b99e5 100644
--- a/code/modules/client/verbs/looc.dm
+++ b/code/modules/client/verbs/looc.dm
@@ -50,7 +50,7 @@ GLOBAL_VAR_INIT(normal_looc_colour, "#6699CC")
msg = emoji_parse(msg)
- mob.log_talk(msg,LOG_OOC, tag="(LOOC)")
+ mob.log_talk(msg,LOG_OOC, tag="LOOC")
var/list/heard = get_hearers_in_view(7, get_top_level_mob(src.mob))
for(var/mob/M in heard)
diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm
index d4edb78e2d..7a69026922 100644
--- a/code/modules/mob/mob_helpers.dm
+++ b/code/modules/mob/mob_helpers.dm
@@ -496,8 +496,19 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
colored_message = "[message]"
else
colored_message = "[message]"
-
- var/list/timestamped_message = list("[LAZYLEN(logging[smessage_type]) + 1]\[[TIME_STAMP("hh:mm:ss", FALSE)]\] [key_name(src)] [loc_name(src)]" = colored_message)
+
+ //This makes readability a bit better for admins.
+ switch(message_type)
+ if(LOG_WHISPER)
+ colored_message = "(WHISPER) [colored_message]"
+ if(LOG_OOC)
+ colored_message = "(OOC) [colored_message]"
+ if(LOG_ASAY)
+ colored_message = "(ASAY) [colored_message]"
+ if(LOG_EMOTE)
+ colored_message = "(EMOTE) [colored_message]"
+
+ var/list/timestamped_message = list("\[[TIME_STAMP("hh:mm:ss", FALSE)]\] [key_name(src)] [loc_name(src)]" = colored_message)
logging[smessage_type] += timestamped_message