Skip to content
MegaPiggy edited this page Jun 16, 2021 · 4 revisions

API

SALT has a few tools that you can use to help you make mods easier.


Mods

Methods and classes that have to do with adding Mods, but don't fit in any other category.

SALT.Main

The self created mod that represents SALT. Contains some helpful tools.

StopSave

A way to stop saving from happening.


User Inputs

Classes and methods that have to do with the keybinds.

UserInputService

Class that helps with inputs.

Instance

Gets an instance UserInputService from the static UserInputService.

InputBegan

An event to record when a key has been pressed. Add to it like this UserInputService.Instance.InputBegan += Method;.

InputEnded

An event to record when a key has stopped being pressed. Add to it like this UserInputService.Instance.InputEnded += Method;.


Console

Classes and methods that have to do with the SALT Console. Belongs in the SALT.Console namespace.

Console

The basic class for the SALT Console. Sometimes SALT.Console.Console can get confused with System.Console.

Log

Basic Log Method.

SALT.Console.Console.Log("Debugging")

LogSuccess

Logging but with a green text.

SALT.Console.Console.LogSuccess("Done!")

LogWarning

Logging but with a orange text.

SALT.Console.Console.LogWarning("Oh no!")

LogError

Logging but with a red text.

SALT.Console.Console.LogError("Exception has occurred!")

Events

Callbacks

Class with all the basic events.

OnLevelLoaded

Event for when a level is loaded. Does not run when Main Menu is loaded.

OnMainMenuLoaded

Event for when the Main Menu is loaded.


Enums

Enums in any namespace.

Character

An enum that has all the Characters currently in the game. Belongs in the SALT namespace.

Level

An enum that has all the levels currently in the game. Belongs in the SALT namespace.


Registries

Classes in the SALT.Registries namespace

CharacterRegistry

CharacterRegistry is a registry that helps you create new characters.

CreateCharacterId

CharacterRegistry.CreateCharacterId is a method that creates a new id for a character you want to add.
Can only be run during PreLoad.
Example: Big Amelia's Id is created with BEEG = CharacterRegistry.CreateCharacterId("BEEG").

RegisterCharacterSprite

CharacterRegistry.RegisterCharacterSprite is a method that adds the character sprite to the Character Selection.
Can only be run during PreLoad or Load. Putting it in PreLoad is better.
Example: Big Amelia's does

CharacterRegistry.RegisterCharacterSprite(BEEG, Main.CreateSpriteFromImage("AmeWide.png"));

RegisterCharacterPrefab

CharacterRegistry.RegisterCharacterPrefab is a method that adds the character gameobject to the Character Selection.
Can only be run during Load.
Example: Big Amelia's does

GameObject gameObject = PrefabUtils.CopyPrefab(CharacterRegistry.GetCharacter(Character.AMELIA));
gameObject.name = "beegAmePack";
gameObject.GetComponent<CharacterIdentifiable>().Id = BEEG;
CharacterRegistry.RegisterCharacterPrefab(gameObject);

Utils

Classes in the SALT.Utils namespace


Extensions

Extension Methods in the SALT.Extensions namespace