Skip to content

Creating a Standalone Cyclops Status Icon

PrimeSonic edited this page Feb 23, 2022 · 4 revisions

Introduced in the 5.2 update, you can now create status icons just like the Cyclops Chargers without having to make an actual charger.
These will display an icon and text just like the Charger icons but can be used to display all sorts of info to the player.

To start, you will need to create a new class that inherits from CyclopsStatusIcon.

using MoreCyclopsUpgrades.API;
using MoreCyclopsUpgrades.API.StatusIcons;

internal class MySubStatus : CyclopsStatusIcon
{
    public MySubStatus(SubRoot cyclops) : base(cyclops)
    {
    }
}

There are 4 abstract members you will need to implement from here.

abstract Member Type Notes
StatusSprite Method The sprite to use for the status icon. Only displayed when ShowStatusIcon is true.
StatusText Method Any short text to display under the status icon. Only displayed when ShowStatusIcon is true.
StatusTextColor Method The color to use for the text displayed under the status icon. Only displayed when ShowStatusIcon is true.
ShowStatusIcon get Property Indicates if this status icon will be displayed.

There is also a protected constructor that takes a SubRoot parameter which you will need to chain back to.

Once you have your class made, you can then [Register] your Status Icon as part of your main mod patching method.

Clone this wiki locally
  翻译: