From 8f9161d50639f6a6fd09f84abb27998f4898f5dd Mon Sep 17 00:00:00 2001
From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com>
Date: Sat, 22 Aug 2020 10:23:48 +0100
Subject: [PATCH] Sorts the who verb list by ckey (#9720)
---
code/game/verbs/who.dm | 11 ++++++----
html/changelogs/who_sort.yml | 41 ++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+), 4 deletions(-)
create mode 100644 html/changelogs/who_sort.yml
diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm
index d512c7ddf02..a233d8586c9 100644
--- a/code/game/verbs/who.dm
+++ b/code/game/verbs/who.dm
@@ -3,11 +3,13 @@
set name = "Who"
set category = "OOC"
- var/msg = "Current Players:
"
+ var/header = "Current Players:
"
+ var/count
+ var/msg
var/total_num = 0
if(holder && (R_ADMIN & holder.rights || R_MOD & holder.rights))
- for(var/client/C in clients)
+ for(var/client/C in sortKey(clients))
msg += "\t[C.key]"
if(C.holder && C.holder.fakekey)
msg += " (as [C.holder.fakekey])"
@@ -44,7 +46,7 @@
msg += "
"
total_num++
else
- for(var/client/C in clients)
+ for(var/client/C in sortKey(clients))
if(C.holder && C.holder.fakekey)
msg += C.holder.fakekey
else
@@ -52,7 +54,8 @@
total_num++
msg += "
"
- msg += "Total Players: [total_num]"
+ count = "Total Players: [total_num]
"
+ msg = header + count + msg
var/datum/browser/who_win = new(usr, "who", "Who", 450, 500)
who_win.set_content(msg)
diff --git a/html/changelogs/who_sort.yml b/html/changelogs/who_sort.yml
new file mode 100644
index 00000000000..186e2d31e3b
--- /dev/null
+++ b/html/changelogs/who_sort.yml
@@ -0,0 +1,41 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# wip (For works in progress)
+# tweak
+# soundadd
+# sounddel
+# rscadd (general adding of nice things)
+# rscdel (general deleting of nice things)
+# imageadd
+# imagedel
+# maptweak
+# spellcheck (typo fixes)
+# experiment
+# balance
+# admin
+# backend
+# security
+# refactor
+#################################
+
+# Your name.
+author: mikomyazaki
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
+# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - tweak: "The 'who' verb list is now sorted by ckey. Also moved total count to the top."