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 15:48:51 +02:00
committed by GitHub
parent 56d21164d0
commit 95c8e00af7
207 changed files with 551 additions and 522 deletions
+1 -1
View File
@@ -123,7 +123,7 @@
/obj/structure/sign/barsign/proc/pick_sign(mob/user)
var/picked_name = input(user, "Available Signage", "Bar Sign", name) as null|anything in sortList(get_bar_names())
var/picked_name = input(user, "Available Signage", "Bar Sign", name) as null|anything in sort_list(get_bar_names())
if(!picked_name)
return
chosen_sign = set_sign_by_name(picked_name)
+1 -1
View File
@@ -268,7 +268,7 @@ LINEN BINS
/obj/item/bedsheet/dorms/Initialize(mapload)
..()
var/type = pickweight(list("Colors" = 80, "Special" = 20))
var/type = pick_weight(list("Colors" = 80, "Special" = 20))
switch(type)
if("Colors")
type = pick(list(/obj/item/bedsheet,
@@ -234,7 +234,7 @@
for(var/atom/movable/AM in L)
if(AM != src && insert(AM) == LOCKER_FULL) // limit reached
break
for(var/i in reverseRange(L.get_all_contents()))
for(var/i in reverse_range(L.get_all_contents()))
var/atom/movable/thing = i
SEND_SIGNAL(thing, COMSIG_TRY_STORAGE_HIDE_ALL)
@@ -26,7 +26,7 @@
if (prob(40))
new /obj/item/storage/toolbox/emergency(src)
switch (pickweight(list("small" = 35, "aid" = 30, "tank" = 20, "both" = 10, "nothing" = 4, "delete" = 1)))
switch (pick_weight(list("small" = 35, "aid" = 30, "tank" = 20, "both" = 10, "nothing" = 4, "delete" = 1)))
if ("small")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/tank/internals/emergency_oxygen(src)
+1 -1
View File
@@ -115,7 +115,7 @@
if(!length(items))
return
items = sortList(items)
items = sort_list(items)
var/pick = show_radial_menu(user, src, items, custom_check = CALLBACK(src, .proc/check_menu, user), radius = 38, require_near = TRUE)
if(!pick)
return
+1 -1
View File
@@ -32,7 +32,7 @@ at the cost of risking a vicious bite.**/
if(prob(40))
critter_infested = FALSE
if(prob(75))
var/picked_item = pickweight(loot)
var/picked_item = pick_weight(loot)
hidden_item = new picked_item(src)
loot = null
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOIST, CELL_VIRUS_TABLE_GENERIC, rand(2,4), 20)
+1 -1
View File
@@ -146,7 +146,7 @@
var/datum/species/S = speciestype
if(initial(S.changesource_flags) & MIRROR_MAGIC)
choosable_races += initial(S.id)
choosable_races = sortList(choosable_races)
choosable_races = sort_list(choosable_races)
/obj/structure/mirror/magic/lesser/Initialize(mapload)
choosable_races = get_selectable_species().Copy()
+1 -1
View File
@@ -65,7 +65,7 @@
if(!initial(potential_sign.is_editable))
continue
output[initial(potential_sign.sign_change_name)] = potential_sign
output = sortList(output) //Alphabetizes the results.
output = sort_list(output) //Alphabetizes the results.
return output
/obj/structure/sign/wrench_act(mob/living/user, obj/item/wrench/I)