Merge remote-tracking branch 'origin/master' into TGUI-4

This commit is contained in:
Letter N
2020-07-30 14:43:52 +08:00
662 changed files with 13844 additions and 6845 deletions
+22 -8
View File
@@ -31,19 +31,13 @@ SUBSYSTEM_DEF(chat)
//Some macros remain in the string even after parsing and fuck up the eventual output
var/original_message = message
message = replacetext(message, "\improper", "")
message = replacetext(message, "\proper", "")
if(handle_whitespace)
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[FOURSPACES][FOURSPACES]")
if (trailing_newline)
message += "<br>"
//url_encode it TWICE, this way any UTF-8 characters are able to be decoded by the Javascript.
//Do the double-encoding here to save nanoseconds
var/twiceEncoded = url_encode(url_encode(message))
var/twiceEncoded
if(islist(target))
var/sanitized_message = FALSE
for(var/I in target)
var/client/C = CLIENT_FROM_VAR(I) //Grab us a client if possible
@@ -55,6 +49,17 @@ SUBSYSTEM_DEF(chat)
if(!C?.chatOutput || C.chatOutput.broken) //A player who hasn't updated his skin file.
continue
if(!sanitized_message)
message = replacetext(message, "\improper", "")
message = replacetext(message, "\proper", "")
if(handle_whitespace)
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[FOURSPACES][FOURSPACES]")
if (trailing_newline)
message += "<br>"
twiceEncoded = url_encode(url_encode(message))
sanitized_message = TRUE
if(!C.chatOutput.loaded) //Client still loading, put their messages in a queue
C.chatOutput.messageQueue += message
@@ -74,6 +79,15 @@ SUBSYSTEM_DEF(chat)
if(!C?.chatOutput || C.chatOutput.broken) //A player who hasn't updated his skin file.
return
message = replacetext(message, "\improper", "")
message = replacetext(message, "\proper", "")
if(handle_whitespace)
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[FOURSPACES][FOURSPACES]")
if (trailing_newline)
message += "<br>"
twiceEncoded = url_encode(url_encode(message))
if(!C.chatOutput.loaded) //Client still loading, put their messages in a queue
C.chatOutput.messageQueue += message
return
+1 -2
View File
@@ -469,11 +469,10 @@ GLOBAL_LIST_EMPTY(the_station_areas)
else
return
possible_options = "Custom"
var/away_name
var/datum/space_level/away_level
var/answer = input("What kind ? ","Away/VR") as null|anything in possible_options
var/answer = input("What kind ? ","Away/VR") as null|anything in list(possible_options + "Custom")
switch(answer)
if(null)
return
+22
View File
@@ -268,6 +268,7 @@ SUBSYSTEM_DEF(persistence)
SaveRandomizedRecipes()
SavePanicBunker()
SavePaintings()
SaveScars()
/datum/controller/subsystem/persistence/proc/LoadPanicBunker()
var/bunker_path = file("data/bunker_passthrough.json")
@@ -547,3 +548,24 @@ SUBSYSTEM_DEF(persistence)
var/json_file = file("data/paintings.json")
fdel(json_file)
WRITE_FILE(json_file, json_encode(paintings))
/datum/controller/subsystem/persistence/proc/SaveScars()
for(var/i in GLOB.joined_player_list)
var/mob/living/carbon/human/ending_human = get_mob_by_ckey(i)
if(!istype(ending_human) || !ending_human.mind || !ending_human.client || !ending_human.client.prefs || !ending_human.client.prefs.persistent_scars)
continue
var/mob/living/carbon/human/original_human = ending_human.mind.original_character
if(!original_human || original_human.stat == DEAD || !original_human.all_scars || !(original_human == ending_human))
if(ending_human.client) // i was told if i don't check this every step of the way byond might decide a client ceases to exist mid proc so here we go
ending_human.client.prefs.scars_list["[ending_human.client.prefs.scars_index]"] = ""
else
for(var/k in ending_human.all_wounds)
var/datum/wound/W = k
W.remove_wound() // so we can get the scars for open wounds
if(!ending_human.client)
return
ending_human.client.prefs.scars_list["[ending_human.client.prefs.scars_index]"] = ending_human.format_scars()
if(!ending_human.client)
return
ending_human.client.prefs.save_character()
@@ -0,0 +1,6 @@
// Smooth HUD updates, but low priority
PROCESSING_SUBSYSTEM_DEF(huds)
name = "HUD updates"
wait = 0.5
priority = FIRE_PRIORITY_HUDS
stat_tag = "HUDS"