Background Type - SubnauticaModding/Nautilus GitHub Wiki

How does the game handle background colors for items?

The game has a built-in enum called BackgroundType, which sits in the CraftData class. The possible values for this enum are listed below.

public enum BackgroundType
{
    Normal,
    Blueprint,
    PlantWater,
    PlantWaterSeed,
    PlantAir,
    PlantAirSeed,
    ExosuitArm
}

How can I change an item's background?

To edit an item's background type, you need to call the CraftDataHandler.SetBackgroundType() method sitting in the SMLHelper.V2.Handlers namespace

Overloads

There is only one overload for this method:

CraftDataHandler.SetBackgroundType([TechType] techType, [CraftData.BackgroundType] backgroundColor);

Parameters

  • [TechType] techType is the item that you want to modify the background color for. This can be both an existing and a custom item.

Example: TechType.Titanium

  • [CraftData.BackgroundType] backgroundColor is the background color to set for the item.

Example: CraftData.BackgroundType.PlantAirSeed

Usage

Using this knowledge, if we wanted to make the background color for titanium green, we could do this:

CraftDataHandler.SetBackgroundType(TechType.Titanium, CraftData.BackgroundType.PlantAirSeed);

Congratulations! Now you can easily spot titanium in your inventory!