Clean up subsystem Initialize(), require an explicit result returned, give a formal way to fail (for SSlua) (#69775)

* cleanup SS API, give SSlua a proper way to error out

* New SS_INIT_ system
This commit is contained in:
Tastyfish
2022-09-14 23:52:10 -04:00
committed by GitHub
parent b07cfcf129
commit 4733643f39
72 changed files with 229 additions and 155 deletions
@@ -9,9 +9,9 @@ PROCESSING_SUBSYSTEM_DEF(ai_behaviors)
///List of all ai_behavior singletons, key is the typepath while assigned value is a newly created instance of the typepath. See SetupAIBehaviors()
var/list/ai_behaviors
/datum/controller/subsystem/processing/ai_behaviors/Initialize(timeofday)
/datum/controller/subsystem/processing/ai_behaviors/Initialize()
SetupAIBehaviors()
return ..()
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/ai_behaviors/proc/SetupAIBehaviors()
ai_behaviors = list()
@@ -7,7 +7,7 @@ PROCESSING_SUBSYSTEM_DEF(greyscale)
var/list/datum/greyscale_config/configurations = list()
var/list/datum/greyscale_layer/layer_types = list()
/datum/controller/subsystem/processing/greyscale/Initialize(start_timeofday)
/datum/controller/subsystem/processing/greyscale/Initialize()
for(var/datum/greyscale_layer/fake_type as anything in subtypesof(/datum/greyscale_layer))
layer_types[initial(fake_type.layer_type)] = fake_type
@@ -27,7 +27,7 @@ PROCESSING_SUBSYSTEM_DEF(greyscale)
var/datum/greyscale_config/config = configurations[greyscale_type]
config.CrossVerify()
return ..()
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/greyscale/proc/RefreshConfigsFromFile()
for(var/i in configurations)
@@ -25,7 +25,7 @@ PROCESSING_SUBSYSTEM_DEF(instruments)
/datum/controller/subsystem/processing/instruments/Initialize()
initialize_instrument_data()
synthesizer_instrument_ids = get_allowed_instrument_ids()
return ..()
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/instruments/proc/on_song_new(datum/song/S)
songs += S
@@ -72,7 +72,7 @@ SUBSYSTEM_DEF(networks)
// At round start, fix the network_id's so the station root is on them
initialized = TRUE
// Now when the objects Initialize they will join the right network
return ..()
return SS_INIT_SUCCESS
/*
* Process incoming queued packet and return NAK/ACK signals
@@ -28,9 +28,9 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
list("Extrovert", "Introvert"),
)
/datum/controller/subsystem/processing/quirks/Initialize(timeofday)
/datum/controller/subsystem/processing/quirks/Initialize()
get_quirks()
return ..()
return SS_INIT_SUCCESS
/// Returns the list of possible quirks
/datum/controller/subsystem/processing/quirks/proc/get_quirks()
@@ -11,14 +11,13 @@ PROCESSING_SUBSYSTEM_DEF(reagents)
var/previous_world_time = 0
/datum/controller/subsystem/processing/reagents/Initialize()
. = ..()
//So our first step isn't insane
previous_world_time = world.time
///Blacklists these reagents from being added to the master list. the exact type only. Children are not blacklisted.
GLOB.fake_reagent_blacklist = list(/datum/reagent/medicine/c2, /datum/reagent/medicine, /datum/reagent/reaction_agent)
//Build GLOB lists - see holder.dm
build_chemical_reactions_lists()
return
return SS_INIT_SUCCESS
/datum/controller/subsystem/processing/reagents/fire(resumed = FALSE)
if (!resumed)
@@ -12,7 +12,7 @@ PROCESSING_SUBSYSTEM_DEF(station)
///Currently active announcer. Starts as a type but gets initialized after traits are selected
var/datum/centcom_announcer/announcer = /datum/centcom_announcer/default
/datum/controller/subsystem/processing/station/Initialize(timeofday)
/datum/controller/subsystem/processing/station/Initialize()
//If doing unit tests we don't do none of that trait shit ya know?
// Autowiki also wants consistent outputs, for example making sure the vending machine page always reports the normal products
@@ -22,7 +22,7 @@ PROCESSING_SUBSYSTEM_DEF(station)
announcer = new announcer() //Initialize the station's announcer datum
return ..()
return SS_INIT_SUCCESS
///Rolls for the amount of traits and adds them to the traits list
/datum/controller/subsystem/processing/station/proc/SetupTraits()