Merge remote-tracking branch 'Upstream/master' into TGUI-3.0

This commit is contained in:
Artur
2020-07-13 16:20:54 +03:00
177 changed files with 3628 additions and 2948 deletions
@@ -209,6 +209,8 @@
new_value = new_list
continue_check_value = new_list.len
if(continue_check_value && continue_check_key && ValidateListEntry(new_key, new_value))
new_key = preprocess_key(new_key)
new_value = preprocess_value(new_value)
config_entry_value[new_key] = new_value
return TRUE
return FALSE
@@ -216,6 +218,12 @@
/datum/config_entry/keyed_list/vv_edit_var(var_name, var_value)
return var_name != "splitter" && ..()
/datum/config_entry/keyed_list/proc/preprocess_key(key)
return key
/datum/config_entry/keyed_list/proc/preprocess_value(value)
return value
//snowflake for donator things being on one line smh
/datum/config_entry/multi_keyed_flag
vv_VAS = FALSE
@@ -14,6 +14,7 @@
var/list/modes // allowed modes
var/list/gamemode_cache
var/list/votable_modes // votable modes
// var/list/ic_filter_regex
var/list/storyteller_cache
var/list/mode_names
var/list/mode_reports
@@ -414,3 +415,21 @@
continue
runnable_modes[M] = probabilities[M.config_tag]
return runnable_modes
/*
/datum/controller/configuration/proc/LoadChatFilter()
var/list/in_character_filter = list()
if(!fexists("[directory]/in_character_filter.txt"))
return
log_config("Loading config file in_character_filter.txt...")
for(var/line in world.file2list("[directory]/in_character_filter.txt"))
if(!line)
continue
if(findtextEx(line,"#",1,2))
continue
in_character_filter += REGEX_QUOTE(line)
ic_filter_regex = in_character_filter.len ? regex("\\b([jointext(in_character_filter, "|")])\\b", "i") : null
syncChatRegexes()
*/
@@ -0,0 +1,11 @@
/// Seconds for CMD on defib-with-memory-loss policy config to display instead of defib-intact config
/datum/config_entry/number/defib_cmd_time_limit
config_entry_value = 300
integer = TRUE
/datum/config_entry/keyed_list/policyconfig
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_TEXT
/datum/config_entry/keyed_list/policyconfig/preprocess_key(key)
return uppertext(..())
+87 -54
View File
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(air)
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/cost_turf_reactions = 0
var/cost_turfs = 0
var/cost_groups = 0
var/cost_highpressure = 0
var/cost_hotspots = 0
@@ -14,10 +14,9 @@ SUBSYSTEM_DEF(air)
var/cost_pipenets = 0
var/cost_rebuilds = 0
var/cost_atmos_machinery = 0
var/cost_equalize = 0
var/list/excited_groups = list()
var/list/active_turfs = list()
var/list/turf_react_queue = list()
var/list/hotspots = list()
var/list/networks = list()
var/list/pipenets_needing_rebuilt = list()
@@ -38,20 +37,25 @@ SUBSYSTEM_DEF(air)
var/map_loading = TRUE
var/list/queued_for_activation
var/log_explosive_decompression = TRUE // If things get spammy, admemes can turn this off.
var/monstermos_turf_limit = 10
var/monstermos_hard_turf_limit = 2000
var/monstermos_enabled = TRUE
/datum/controller/subsystem/air/stat_entry(msg)
msg += "C:{"
msg += "RQ:[round(cost_turf_reactions,1)]|"
msg += "EQ:[round(cost_equalize,1)]|"
msg += "AT:[round(cost_turfs,1)]|"
msg += "EG:[round(cost_groups,1)]|"
msg += "HP:[round(cost_highpressure,1)]|"
msg += "HS:[round(cost_hotspots,1)]|"
msg += "SC:[round(cost_superconductivity,1)]|"
msg += "PN:[round(cost_pipenets,1)]|"
msg += "RB:[round(cost_rebuilds,1)]|"
msg += "AM:[round(cost_atmos_machinery,1)]"
msg += "} "
msg += "AT:[active_turfs.len]|"
msg += "RQ:[turf_react_queue.len]|"
msg += "EG:[excited_groups.len]|"
msg += "EG:[get_amt_excited_groups()]|"
msg += "HS:[hotspots.len]|"
msg += "PN:[networks.len]|"
msg += "HP:[high_pressure_delta.len]|"
@@ -59,8 +63,8 @@ SUBSYSTEM_DEF(air)
msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
..(msg)
/datum/controller/subsystem/air/Initialize(timeofday)
extools_update_ssair()
map_loading = FALSE
setup_allturfs()
setup_atmos_machinery()
@@ -68,6 +72,7 @@ SUBSYSTEM_DEF(air)
gas_reactions = init_gas_reactions()
return ..()
/datum/controller/subsystem/air/proc/extools_update_ssair()
/datum/controller/subsystem/air/fire(resumed = 0)
var/timer = TICK_USAGE_REAL
@@ -101,12 +106,21 @@ SUBSYSTEM_DEF(air)
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSAIR_REACTQUEUE
currentpart = monstermos_enabled ? SSAIR_EQUALIZE : SSAIR_ACTIVETURFS
if(currentpart == SSAIR_REACTQUEUE)
if(currentpart == SSAIR_EQUALIZE)
timer = TICK_USAGE_REAL
process_react_queue(resumed)
cost_turf_reactions = MC_AVERAGE(cost_turf_reactions, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
process_turf_equalize(resumed)
cost_equalize = MC_AVERAGE(cost_equalize, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
currentpart = SSAIR_ACTIVETURFS
if(currentpart == SSAIR_ACTIVETURFS)
timer = TICK_USAGE_REAL
process_active_turfs(resumed)
cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
resumed = 0
@@ -148,6 +162,8 @@ SUBSYSTEM_DEF(air)
resumed = 0
currentpart = SSAIR_REBUILD_PIPENETS
/datum/controller/subsystem/air/proc/process_pipenets(resumed = 0)
if (!resumed)
src.currentrun = networks.Copy()
@@ -182,19 +198,6 @@ SUBSYSTEM_DEF(air)
return
/datum/controller/subsystem/air/proc/process_react_queue(resumed = 0)
if(!resumed)
src.currentrun = turf_react_queue.Copy()
var/list/currentrun = src.currentrun
while(currentrun.len)
var/turf/open/T = currentrun[currentrun.len]
currentrun.len--
if(T)
T.process_cell_reaction()
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = 0)
if (!resumed)
src.currentrun = active_super_conductivity.Copy()
@@ -229,10 +232,45 @@ SUBSYSTEM_DEF(air)
high_pressure_delta.len--
T.high_pressure_movements()
T.pressure_difference = 0
T.pressure_specific_target = null
if(MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_turf_equalize(resumed = 0)
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
src.currentrun = active_turfs.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/turf/open/T = currentrun[currentrun.len]
currentrun.len--
if (T)
T.equalize_pressure_in_zone(fire_count)
//equalize_pressure_in_zone(T, fire_count)
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0)
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
src.currentrun = active_turfs.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
var/turf/open/T = currentrun[currentrun.len]
currentrun.len--
if (T)
T.process_cell(fire_count)
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
if(process_excited_groups_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag))
sleep()
/*
if (!resumed)
src.currentrun = excited_groups.Copy()
//cache for sanic speed (lists are references anyways)
@@ -248,29 +286,33 @@ SUBSYSTEM_DEF(air)
EG.dismantle()
if (MC_TICK_CHECK)
return
*/
/datum/controller/subsystem/air/proc/process_excited_groups_extools()
/datum/controller/subsystem/air/proc/get_amt_excited_groups()
/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
active_turfs -= T
SSair_turfs.currentrun -= T
if(currentpart == SSAIR_ACTIVETURFS)
currentrun -= T
#ifdef VISUALIZE_ACTIVE_TURFS
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#00ff00")
#endif
if(istype(T))
T.excited = 0
if(T.excited_group)
T.excited_group.garbage_collect()
remove_from_react_queue(T)
T.set_excited(FALSE)
T.eg_garbage_collect()
/datum/controller/subsystem/air/proc/add_to_active(turf/open/T, blockchanges = 1)
if(istype(T) && T.air)
#ifdef VISUALIZE_ACTIVE_TURFS
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
#endif
T.excited = TRUE
active_turfs[T] = SSair_turfs.currentrun[T] = TRUE
if(blockchanges && T.excited_group)
T.excited_group.garbage_collect()
add_to_react_queue(T)
T.set_excited(TRUE)
active_turfs |= T
if(currentpart == SSAIR_ACTIVETURFS)
currentrun |= T
if(blockchanges)
T.eg_garbage_collect()
else if(T.flags_1 & INITIALIZED_1)
for(var/turf/S in T.atmos_adjacent_turfs)
add_to_active(S)
@@ -281,17 +323,6 @@ SUBSYSTEM_DEF(air)
else
T.requires_activation = TRUE
/datum/controller/subsystem/air/proc/add_to_react_queue(turf/open/T)
if(istype(T) && T.air)
turf_react_queue[T] = TRUE
if(currentpart == SSAIR_REACTQUEUE)
currentrun[T] = TRUE
/datum/controller/subsystem/air/proc/remove_from_react_queue(turf/open/T)
turf_react_queue -= T
if(currentpart == SSAIR_REACTQUEUE)
currentrun -= T
/datum/controller/subsystem/air/StartLoadingMap()
LAZYINITLIST(queued_for_activation)
map_loading = TRUE
@@ -339,11 +370,11 @@ SUBSYSTEM_DEF(air)
while (turfs_to_check.len)
var/ending_ats = active_turfs.len
for(var/thing in excited_groups)
/*for(var/thing in excited_groups)
var/datum/excited_group/EG = thing
EG.self_breakdown(space_is_all_consuming = 1)
EG.dismantle()
CHECK_TICK
//EG.self_breakdown(space_is_all_consuming = 1)
//EG.dismantle()
CHECK_TICK*/
var/msg = "HEY! LISTEN! [DisplayTimeText(world.timeofday - timer)] were wasted processing [starting_ats] turf(s) (connected to [ending_ats] other turfs) with atmos differences at round start."
to_chat(world, "<span class='boldannounce'>[msg]</span>")
@@ -351,6 +382,7 @@ SUBSYSTEM_DEF(air)
/turf/open/proc/resolve_active_graph()
. = list()
/*
var/datum/excited_group/EG = excited_group
if (blocks_air || !air)
return
@@ -371,7 +403,8 @@ SUBSYSTEM_DEF(air)
EG.add_turf(ET)
if (!ET.excited)
ET.excited = 1
. += ET
. += ET*/
/turf/open/space/resolve_active_graph()
return list()
@@ -389,9 +422,8 @@ SUBSYSTEM_DEF(air)
CHECK_TICK
/datum/controller/subsystem/air/proc/setup_template_machinery(list/atmos_machines)
if(!initialized)
return
if(!initialized) // yogs - fixes randomized bars
return // yogs
for(var/A in atmos_machines)
var/obj/machinery/atmospherics/AM = A
AM.atmosinit()
@@ -415,6 +447,7 @@ SUBSYSTEM_DEF(air)
#undef SSAIR_PIPENETS
#undef SSAIR_ATMOSMACHINERY
#undef SSAIR_ACTIVETURFS
#undef SSAIR_EXCITEDGROUPS
#undef SSAIR_HIGHPRESSURE
#undef SSAIR_HOTSPOTS
+2 -1
View File
@@ -1,5 +1,5 @@
//WHAT IF WE TAKE THE ACTIVE TURF PROCESSING AND PUSH IT SOMEWHERE ELSE!!!
/*
SUBSYSTEM_DEF(air_turfs)
name = "Atmospherics - Turfs"
init_order = INIT_ORDER_AIR_TURFS
@@ -24,3 +24,4 @@ SUBSYSTEM_DEF(air_turfs)
return
resumed = 0
return
*/
+5 -4
View File
@@ -4,6 +4,7 @@ SUBSYSTEM_DEF(chat)
wait = 1
priority = FIRE_PRIORITY_CHAT
init_order = INIT_ORDER_CHAT
var/list/payload = list()
@@ -17,7 +18,7 @@ SUBSYSTEM_DEF(chat)
return
/datum/controller/subsystem/chat/proc/queue(target, message, handle_whitespace = TRUE)
/datum/controller/subsystem/chat/proc/queue(target, message, handle_whitespace = TRUE, trailing_newline = TRUE, confidential = TRUE)
if(!target || !message)
return
@@ -35,8 +36,8 @@ SUBSYSTEM_DEF(chat)
if(handle_whitespace)
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[FOURSPACES][FOURSPACES]")
message += "<br>"
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
@@ -47,7 +48,7 @@ SUBSYSTEM_DEF(chat)
var/client/C = CLIENT_FROM_VAR(I) //Grab us a client if possible
if(!C)
return
continue
//Send it to the old style output window.
SEND_TEXT(C, original_message)