MCUServices Overview - PrimeSonic/PrimeSonicSubnauticaMods GitHub Wiki

Originally introduced in the 3.0 update and later refined in the 4.0 overhaul, MoreCyclopsUpgrades can now be used as a public API, allowing other mods to integrate their own cyclops upgrade modules and have them be fully compatible with the Auxiliary Upgrade Console.



MCUServices

The MoreCyclopsUpgrades API offers an easy to use, single point of entry for all the service methods it provides to other mods to use.

// Include this namespace to access to the 'MCUServices' class.
using MoreCyclopsUpgrades.API;

Everything starts with the class MCUServices which then branches off into 3 service collections: CrossMod, Register, and Find.


MCUServices.CrossMod

// Include this namespace to access to the 'MCUServices.CrossMod' methods.
using MoreCyclopsUpgrades.API.General;

Provides a few tools for better cross-compatibility between mods. Useful for mods that all want to affect the Cyclops in similar ways or want to have interactions with other upgrades.
This part of the API will grow over time as new features are added once a need for them is identified.
Currently supported:

  • Apply changes to the Cyclops Engine Efficiency Rating without overwriting changes from other mods.
  • Easily check for installed Cyclops upgrade modules across all upgrade consoles.
  • Gain cross-mod compatibility with VehicleUpgradesInCyclops by ensuring any Cyclops module added to the Cyclops Fabricator is added to the correct tab.

MCUServices.Register

Provides methods to register your own custom code to be used within the framework of MoreCyclopsUpgrades.
Here you can register the following:

UpgradeHandlers

// Include this namespace when using 'MCUServices.Register' methods to register an UpgradeHandler.
using MoreCyclopsUpgrades.API.Upgrades;

Defines how the Cyclops will respond to your new upgrade module.
These provide compatibility with the Auxiliary Upgrade Console along with a bunch of other features.

CyclopsChargers

// Include this namespace when using 'MCUServices.Register' methods to register a CyclopsCharger.
using MoreCyclopsUpgrades.API.Charging;

Defines new ways for the Cyclops to recharge itself.
These provide compatibility with the Power Info Icons.

PdaIconOverlay

// Include this namespace when using 'MCUServices.Register' methods to register a IconOverlay.
using MoreCyclopsUpgrades.API.PDA;

Defines additional text info that can be overlayed on top the upgrade module's icon when viewed in the PDA Equipment screen.
These allow you to display some info about the module's status without having to show it via ErrorMessage text.

AuxCyclopsManagers

// Include this namespace when using 'MCUServices.Register' methods to register an AuxCyclopsManager.
using MoreCyclopsUpgrades.API.General;

Defines a general catch-all class to attach to the Cyclops without it being a MonoBehavior.
Useful if you have lots of different parts involved in your mod and you need a single class to keep everything connected.
Can be used to help link Buildables with their parent Cyclops SubRoot when GetComponentsInParent fails.
See examples of this in CyclopsBioReactor and CyclopsNuclearReactor.



MCUServices.Find

// Depending on what you are searching for,  
// you will need one or more of these namespaces when using the 'MCUServices.Find' methods.
using System.Collections.Generic;
using MoreCyclopsUpgrades.API.Charging;
using MoreCyclopsUpgrades.API.General;
using MoreCyclopsUpgrades.API.Upgrades;

Allows you to find the custom classes you've registered once they've been instantiated.
If you need to do anything with your UpgradeHandler, CyclopsChargers, or AuxCyclopsManagers after they've been created, this is how you can fetch the instance.