-
Notifications
You must be signed in to change notification settings - Fork 7
Everest Events
Everest provides a number of events that can be subscribed to from within your code mod. This guide lists each event, the methods within Celeste that raise it, and any additional notes on it.
To subscribe to an event, use the following format:
Everest.Events.Level.OnLoadLevel += Your_OnLoadLevel_Method;
where Your_OnLoadLevel_Method
is a method with arguments matching those listed in this guide:
private void Your_OnLoadLevel_Method(Level level, Player.IntroTypes playerIntro, bool isFromLoader){
}
- Celeste
- Main Menu
- Level
- LevelLoader
- Player
- Input
- Journal
- Decal
- FileSelectSlot
- EventTrigger
- CustomBirdTutorial
Event | Raised By | Notes |
---|---|---|
OnExiting () |
Celeste.Celeste.OnExiting | Called after the main gameloop has finished running in Microsoft.Xna.Framework.Game.Run |
OnShutdown () |
Celeste.Celeste.Main | Called just before the Main method exits |
Event | Raised By | Notes |
---|---|---|
OnLoadMod (EverestModuleMetadata meta) |
Everest.Loader.LoadMod | Called when a mod finishes loading. |
OnRegisterModule (EverestModule module) |
Everest.Register | Called when a mod is registered. |
Event | Raised By | Notes |
---|---|---|
OnCreateButtons (OuiMainMenu menu, List buttons)
|
Celeste.OuiMainMenu.Added Celeste.OuiMainMenu.RebuildMainAndTitle Celeste.Settings.Reload |
Used for adding new MenuButtons to the OuiMainMenu Ex: Everest.CoreModule 🔗 |
Event | Raised By | Notes |
---|---|---|
OnLoadingThread (Level level) |
Celeste.LevelLoader.LoadingThread |
Event | Raised By | Notes |
---|---|---|
OnPause (Level level, int startIndex, bool minimal, bool quickReset) |
Celeste.Level.Pause | |
OnCreatePauseMenuButtons (Level level, TextMenu menu, bool minimal) |
Celeste.Level.Pause | |
OnUnpause (Level level) |
Celeste.Level.Pause | |
OnTransitionTo (Level level, LevelData next, Vector2 direction) |
Celeste.Level.TransitionTo | |
OnLoadEntity (Level level, LevelData levelData, Vector2 offset, EntityData entityData) |
Celeste.Level.LoadCustomEntity | |
OnLoadBackdrop (MapData map, BinaryPacker.Element child, BinaryPacker.Element above) |
Celeste.Mapdata.LoadCustomBackdrop | |
OnLoadLevel (Level level, Player.IntroTypes playerIntro, bool isFromLoader) |
Celeste.Level.LoadLevel | |
OnEnter (Session session, bool fromSaveData) |
Celeste.LevelEnter.Go | As of Everest 1436, is called on ctrl+f5 |
OnExit (Level level, LevelExit exit, LevelExit.Mode mode, Session session, HiresSnow snow) |
Celeste.LevelExit.LevelExit | |
OnComplete (Level level) |
Celeste.Level.RegisterAreaComplete |
Event | Raised By | Notes |
---|---|---|
OnSpawn (Player player) |
Celeste.Player.Added | |
OnDie (Player player) |
Celeste.Player.Die | |
OnRegisterStates (Player player) |
Celeste.Player.PostCtor |
Event | Raised By | Notes |
---|---|---|
OnRegisterStates (Seeker seeker) |
Celeste.Seeker constructor |
Event | Raised By | Notes |
---|---|---|
OnRegisterStates (AngryOshiro oshiro) |
Celeste.AngryOshiro constructor |
Event | Raised By | Notes |
---|---|---|
OnInitialize |
Celeste.Input.Initialize | |
OnDeregister |
Celeste.Input.Deregister |
Event | Raised By | Notes |
---|---|---|
OnEnter (OuiJournal journal, Oui from) |
Celeste.OuiJournal.Enter |
Event | Raised By | Notes |
---|---|---|
OnHandleDecalRegistry (Decal decal, DecalRegistry.DecalInfo decalInfo) |
Celeste.Decal.Added |
Event | Raised By | Notes |
---|---|---|
OnCreateButtons (List<OuiFileSelectSlot.Button> buttons, OuiFileSelectSlot slot, EverestModuleSaveData modSaveData, bool fileExists) |
Celeste.OuiFileSelectSlot.CreateButtons | Added in Everest 1459 |
Usage example:
// event registering (in the Load() method for example)
Everest.Events.FileSelectSlot.OnCreateButtons += addSilhouetteButton;
private void addSilhouetteButton(List<OuiFileSelectSlot.Button> buttons, OuiFileSelectSlot slot, EverestModuleSaveData saveData, bool fileExists) {
// add a simple toggle button for an option in mod save data (SilhouetteEnabled)
OuiFileSelectSlot.Button button = new OuiFileSelectSlot.Button {
Label = $"Silhouette Mode: {(saveData as MyModuleSaveData).SilhouetteEnabled}",
Scale = 0.7f
};
button.Action = () => {
(saveData as MyModuleSaveData).SilhouetteEnabled = !(saveData as MyModuleSaveData).SilhouetteEnabled;
button.Label = $"Silhouette Mode: {(saveData as MyModuleSaveData).SilhouetteEnabled}";
};
buttons.Add(button);
// add a button opening a OuiFileSelectSlotSubmenu
buttons.Add(new OuiFileSelectSlot.Button {
Label = $"Silhouette Mode Options",
Scale = 0.7f,
Action = () => OuiFileSelectSlotSubmenu.Goto<OuiSilhouetteModeOptions>(slot, saveData, fileExists)
});
}
Submenu implementation example:
using Celeste.Mod.UI;
namespace Celeste.Mod.MyMod {
class OuiSilhouetteModeOptions : OuiFileSelectSlotSubmenu {
public override string MenuName => "SILHOUETTE MODE OPTIONS";
protected override void addOptionsToMenu(TextMenu menu, OuiFileSelectSlot slot, EverestModuleSaveData modSaveData, bool fileExists) {
MyModuleSaveDatacastSaveData = (modSaveData as MyModuleSaveData);
menu.Add(new TextMenu.SubHeader("Toggle"));
menu.Add(new TextMenu.OnOff("Enabled", castSaveData.SilhouetteEnabled).Change(newValue => castSaveData.SilhouetteEnabled = newValue));
}
}
}
Event | Raised By | Notes |
---|---|---|
OnEventTrigger (EventTrigger trigger, Player player, string eventID) |
EventTrigger.OnEnter | Added in Everest 1767 |
Event | Raised By | Notes |
---|---|---|
onParseCommand (string command) |
CustomBirdTutorial constructor | Added in Everest 1925 |
Usage example:
Everest.Events.CustomBirdTutorial.OnParseCommand += onParseCommand;
private object OnParseCommand(string command) {
// this method can return:
// - a MTexture => displays that texture
if (command == "StrawberryIcon") {
return GFX.Gui["collectables/strawberry"];
}
// - a Vector2 representing a direction (x, y) => displays an arrow
if (command == "DownLeft") {
return new Vector2(-1, 1);
}
// - a ButtonBinding or VirtualButton => displays the button it is set to (useful for custom bindings)
if (command == "RandomBinding") {
return (_Settings as MaxHelpingHandModuleSettings).RandomBinding;
}
// - a string => displays that text
if (command == "SayHi") {
return "Hi!";
}
// if your mod doesn't recognize the command, return null to let other mods / Everest handle it instead.
return null;
}
Event | Raised By | Notes |
---|---|---|
OnBeforeReload (bool silent) |
Everest.AssetReloadHelper.Do | |
OnAfterReload (bool silent) |
Everest.AssetReloadHelper.Do | |
OnReloadLevel (Level level) |
Everest.AssetReloadHelper.ReloadLevel | |
OnReloadAllMaps (Level level) |
Everest.AssetReloadHelper.ReloadAllMaps |
The source code for all events can be found here 🔗.
For questions and feedback, please contact @coloursofnoise on the Celeste Discord 🔗.
Home
Contributing
FAQ
Useful Links
Your First Custom Map
Your First Texture Pack
Mod Setup
Custom Maps
Texture Packs
Uploading Mods
Generated Dialog Keys
Reference Code Mod🔗
Vanilla Audio IDs
Character Portraits
Mod Structure
Debug Mode
Command Line Arguments
Environment Variables
Install Issues
Common Crashes
Latency Guide
everest.yaml Setup
Mapping FAQ
Map Metadata
Vanilla Metadata Reference
Adding Custom Dialogue
Overworld Customisation
Entity & Trigger Documentation
Custom Entity List🔗
Camera
Ahorn Scripts
Custom Tilesets
Tileset Format Reference
Stylegrounds
Reskinning Entities
Skinmods
Decal Registry
Chapter Complete Screen
Custom Portraits
Adding Custom Audio
Advanced Custom Audio
Code Mod Setup
Making Code Mods
Mod Settings
Everest Events
Understanding Input
Logging
Cross-Mod Functionality
Recommended Practices
Core Migration Guide
Lönn Integration🔗
Custom Events
Adding Sprites
Adding Preexisting Audio