Conversation
microlith57
left a comment
There was a problem hiding this comment.
a few stylistic concerns but looks good!
| /// Mark this renderer as a custom <see cref="ScreenWipe"/> with an identifier.<br/> | ||
| /// If there is no match, then the full type name of the Screen Wipe is checked for. | ||
| /// </summary> | ||
| /// <param name="ids">A list of unique identifiers for this Screen Wipe.</param> |
There was a problem hiding this comment.
nitpick: might be good to note that this follows the ID[=MethodName] pattern!
There was a problem hiding this comment.
should we do the same for the other attributes too?
There was a problem hiding this comment.
oh, i guess i neglected to check those :p
yea if you can add wording to their docs too that'd be good!
| namespace Celeste { | ||
| public class patch_AreaData : AreaData { | ||
|
|
||
| public static readonly Dictionary<string, Action<Scene, bool, Action>> WipeLoaders = new(); |
There was a problem hiding this comment.
suggestion: can the Action<Scene, bool, Action> be a named delegate type instead?
There was a problem hiding this comment.
may just be my experience, but getting an Action and a delegate to work together like this is kind of tricky.
so I thought just using an Action would be easier
Celeste.Mod.mm/Mod/Meta/MapMeta.cs
Outdated
| if (Everest.Events.MapMeta.ParseWipe(wipeStr) is { } wipeLoader | ||
| || (patch_AreaData.WipeLoaders.TryGetValue(wipeStr, out wipeLoader) && wipeLoader is not null)) |
There was a problem hiding this comment.
suggestion: can this be split into an if/else if? it feels a bit cramped as a single condition
this PR adds some alternative ways for modders to apply their Screen Wipes to a map.
this mainly serves to give unique identifiers to the Screen Wipes, so that the game doesn't have to check for their full type names, and their classes can be freely reorganised if needed.
Everest.Events.MapMeta.OnParseWipeaccepts a method that returns anAction<Scene, bool, Action>and takes the argumentstring wipe, which is the value of the current Wipe metadata being parsed.the parameters of the returned
Actionare similar to the constructor for a Screen Wipe:(Scene scene, bool wipeIn, Action onComplete).the
[CustomWipe]attribute should be placed on a class that extendsScreenWipe, and is used to give it a unique identifier. the class requires one of the following in order to be registered as a custom wipe:public staticgenerator method (calledLoadby default) that returnsScreenWipeand has the signature(Scene scene, bool wipeIn, Action onComplete), or...(Scene scene, bool wipeIn, Action onComplete).