Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify OnLoadLevel and OnLoadingThread events' docs #859

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Celeste.Mod.mm/Mod/Everest/Everest.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using _Decal = Celeste.Decal;
using _EventTrigger = Celeste.EventTrigger;
using _LevelLoader = Celeste.LevelLoader;
using _Level = Celeste.Level;
using _Session = Celeste.Session;
using _OuiJournal = Celeste.OuiJournal;
Expand Down Expand Up @@ -96,8 +97,10 @@ internal static void CreateButtons(_OuiMainMenu menu, List<MenuButton> buttons)
public static class LevelLoader {
public delegate void LoadingThreadHandler(_Level level);
/// <summary>
/// Called at the end of the map loading thread.
/// Called at the end of the map loading thread, <see cref="_LevelLoader.LoadingThread()"/>.<br/>
/// This event is invoked <b>only once</b>, when entering a map from the chapter select screen or from Save and Quit.
/// </summary>
/// <seealso cref="Level.OnLoadLevel"/>
public static event LoadingThreadHandler OnLoadingThread;
internal static void LoadingThread(_Level level)
=> OnLoadingThread?.Invoke(level);
Expand Down Expand Up @@ -161,6 +164,11 @@ internal static Backdrop LoadBackdrop(MapData map, BinaryPacker.Element child, B
=> OnLoadBackdrop?.InvokeWhileNull<Backdrop>(map, child, above);

public delegate void LoadLevelHandler(_Level level, _Player.IntroTypes playerIntro, bool isFromLoader);
/// <summary>
/// Called after <see cref="_Level.LoadLevel"/>.<br/>
/// This event is invoked <b>every time</b> a room is entered - transition, respawn, teleport, etc.
/// </summary>
/// <seealso cref="LevelLoader.OnLoadingThread"/>
public static event LoadLevelHandler OnLoadLevel;
internal static void LoadLevel(_Level level, _Player.IntroTypes playerIntro, bool isFromLoader)
=> OnLoadLevel?.Invoke(level, playerIntro, isFromLoader);
Expand Down