Makes examine block HR's format better collapse (#13235)

* Makes examine HR's automatically collapse

* length

* code formatting
This commit is contained in:
Tastyfish
2022-05-02 07:19:16 -04:00
committed by GitHub
parent 3878017e9c
commit 94ca2a95f8
10 changed files with 38 additions and 16 deletions
+7 -2
View File
@@ -493,9 +493,14 @@
//SKYRAT EDIT ADDITION
if(result.len)
for(var/i = 1, i <= result.len, i++)
if(!findtext(result[i], "<hr>"))
for(var/i in 1 to length(result))
if(result[i] != EXAMINE_SECTION_BREAK)
result[i] += "\n"
else
// remove repeated <hr's> and ones on the ends.
if((i == 1) || (i == length(result)) || (result[i - 1] == EXAMINE_SECTION_BREAK))
result.Cut(i, i + 1)
i--
//SKYRAT EDIT END
to_chat(src, "<div class='examine_block'><span class='infoplain'>[result.Join()]</span></div>") //SKYRAT EDIT CHANGE