This commit is contained in:
Putnam
2021-03-02 01:44:58 -08:00
477 changed files with 6805 additions and 1201 deletions
+29 -1
View File
@@ -66,7 +66,7 @@
} while(FALSE)
//Returns a list in plain english as a string
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "")
var/total = length(input)
switch(total)
if (0)
@@ -87,6 +87,34 @@
return "[output][and_text][input[index]]"
/**
* English_list but associative supporting. Higher overhead.
*/
/proc/english_list_assoc(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "")
var/total = length(input)
switch(total)
if (0)
return "[nothing_text]"
if (1)
var/assoc = input[input[1]] == null? "" : " = [input[input[1]]]"
return "[input[1]][assoc]"
if (2)
var/assoc = input[input[1]] == null? "" : " = [input[input[1]]]"
var/assoc2 = input[input[2]] == null? "" : " = [input[input[2]]]"
return "[input[1]][assoc][and_text][input[2]][assoc2]"
else
var/output = ""
var/index = 1
var/assoc
while (index < total)
if (index == total - 1)
comma_text = final_comma_text
assoc = input[input[index]] == null? "" : " = [input[input[index]]]"
output += "[input[index]][assoc][comma_text]"
++index
assoc = input[input[index]] == null? "" : " = [input[input[index]]]"
return "[output][and_text][input[index]]"
//Returns list element or null. Should prevent "index out of bounds" error.
/proc/listgetindex(list/L, index)
if(LAZYLEN(L))
+2 -2
View File
@@ -231,10 +231,10 @@
src_object = window.locked_by.src_object
// Insert src_object info
if(src_object)
entry += "\nUsing: [src_object.type] [REF(src_object)]"
entry += "Using: [src_object.type] [REF(src_object)]"
// Insert message
if(message)
entry += "\n[message]"
entry += "[message]"
WRITE_LOG(GLOB.tgui_log, entry)
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
+1 -1
View File
@@ -10,7 +10,7 @@
announcement += "<br><h2 class='alert'>[html_encode(title)]</h2>"
else if(type == "Captain")
announcement += "<h1 class='alert'>Captain Announces</h1>"
GLOB.news_network.SubmitArticle(text, "Captain's Announcement", "Station Announcements", null)
GLOB.news_network.SubmitArticle(html_encode(text), "Captain's Announcement", "Station Announcements", null)
else
if(!sender_override)
+2
View File
@@ -242,6 +242,8 @@
SSpersistence.station_was_destroyed = TRUE
if(!mode.allow_persistence_save)
SSpersistence.station_persistence_save_disabled = TRUE
else
SSpersistence.SaveTCGCards()
SSpersistence.CollectData()
//stop collecting feedback during grifftime
+2 -2
View File
@@ -263,7 +263,7 @@ Turf and target are separate in case you want to teleport some distance from a t
return .
//Returns a list of all items of interest with their name
/proc/getpois(mobs_only=0,skip_mindless=0)
/proc/getpois(mobs_only = FALSE, skip_mindless = FALSE, specify_dead_role = TRUE)
var/list/mobs = sortmobs()
var/list/namecounts = list()
var/list/pois = list()
@@ -277,7 +277,7 @@ Turf and target are separate in case you want to teleport some distance from a t
if(M.real_name && M.real_name != M.name)
name += " \[[M.real_name]\]"
if(M.stat == DEAD)
if(M.stat == DEAD && specify_dead_role)
if(isobserver(M))
name += " \[ghost\]"
else