cleanup _HELPERS/_lists.dm and all the necessary files (#61827)

Bring _HELPERS/_lists.dm to latest standards by:
-Adding proper documentation and fixing existing one
-Giving vars proper names
-Procs now use snake case as per standard (many files that use those procs will be affected)
This commit is contained in:
Ghilker
2021-10-12 14:48:51 +01:00
committed by GitHub
parent 56d21164d0
commit 95c8e00af7
207 changed files with 551 additions and 522 deletions
+2 -2
View File
@@ -1215,7 +1215,7 @@ GLOBAL_LIST_EMPTY(PDAs)
plist[avoid_assoc_duplicate_keys(pda.owner, namecounts)] = pda
var/choice = tgui_input_list(user, "Please select a PDA", "PDA Messenger", sortList(plist))
var/choice = tgui_input_list(user, "Please select a PDA", "PDA Messenger", sort_list(plist))
if (!choice)
return
@@ -1264,7 +1264,7 @@ GLOBAL_LIST_EMPTY(PDAs)
else
sortmode = /proc/cmp_pdaname_asc
for(var/obj/item/pda/P in sortList(GLOB.PDAs, sortmode))
for(var/obj/item/pda/P in sort_list(GLOB.PDAs, sortmode))
if(!P.owner || P.toff || P.hidden)
continue
. += P
+3 -3
View File
@@ -297,7 +297,7 @@ Code:
if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working.
menu = "<h4>[PDAIMG(medical)] Medical Record List</h4>"
if(GLOB.data_core.general)
for(var/datum/data/record/R in sortRecord(GLOB.data_core.general))
for(var/datum/data/record/R in sort_record(GLOB.data_core.general))
menu += "<a href='byond://?src=[REF(src)];choice=Medical Records;target=[R.fields["id"]]'>[R.fields["id"]]: [R.fields["name"]]<br>"
menu += "<br>"
if(441)
@@ -340,7 +340,7 @@ Code:
if (45) //security records
menu = "<h4>[PDAIMG(cuffs)] Security Record List</h4>"
if(GLOB.data_core.general)
for (var/datum/data/record/R in sortRecord(GLOB.data_core.general))
for (var/datum/data/record/R in sort_record(GLOB.data_core.general))
menu += "<a href='byond://?src=[REF(src)];choice=Security Records;target=[R.fields["id"]]'>[R.fields["id"]]: [R.fields["name"]]<br>"
menu += "<br>"
@@ -530,7 +530,7 @@ Code:
if(!emoji_table)
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
var/list/collate = list("<br><table>")
for(var/emoji in sortList(icon_states(icon(EMOJI_SET))))
for(var/emoji in sort_list(icon_states(icon(EMOJI_SET))))
var/tag = sheet.icon_tag("emoji-[emoji]")
collate += "<tr><td>[emoji]</td><td>[tag]</td></tr>"
collate += "</table><br>"
@@ -87,7 +87,7 @@
if(!camera_ref || !camera.c_tag)
continue
bugged_cameras[camera.c_tag] = camera_ref
return sortList(bugged_cameras)
return sort_list(bugged_cameras)
/obj/item/camera_bug/proc/menu(list/cameras)
+1 -1
View File
@@ -844,7 +844,7 @@ GENE SCANNER
for(var/A in buffer)
options += get_display_name(A)
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sortList(options)
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in sort_list(options)
if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
var/sequence
for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list