Fixed a bug where lists with number-only elements were not displaying (#19962)

Fixed a bug where lists with number-only elements were not displaying in
VV.
Fixed an issue with extended list viewer mishandling special lists and
giving runtimes.
VV list unwrapping is now faster.
Some code comments and cleanup.
This commit is contained in:
Fluffy
2024-09-29 15:25:43 +00:00
committed by GitHub
parent f28c680da2
commit 1a88f63cc3
3 changed files with 97 additions and 9 deletions
+16 -6
View File
@@ -46,13 +46,19 @@
data["listvar"] = list()
var/index = 1
for(var/k in viewed_list)
if(!isnull(viewed_list[k]))
data["listvar"] += list(list("key" = k, "value" = viewed_list[k]))
//Let's just compute it once instead of for every element
var/is_normal_list = IS_NORMAL_LIST(viewed_list)
for(var/index in 1 to length(viewed_list))
var/entry = viewed_list[index]
if(is_normal_list && IS_VALID_ASSOC_KEY(entry))
if(!isnull(viewed_list[entry]))
data["listvar"] += list(list("key" = entry, "value" = viewed_list[entry]))
else
data["listvar"] += list(list("key" = index, "value" = entry))
else
data["listvar"] += list(list("key" = index, "value" = k))
index++
data["listvar"] += list(list("key" = index, "value" = entry))
return data
@@ -84,6 +90,10 @@
to_chat(usr, "No entry found to open!")
return FALSE
if(!isdatum(entry_to_open))
to_chat(usr, "The entry is not a datum!")
return FALSE
user_client.debug_variables_open(entry_to_open)
return TRUE