《密教模拟器 (Cultist Simulator)》

《密教模拟器 (Cultist Simulator)》

The Roost Machine
 此主题已被置顶,因此可能具有重要性
Chelnoque  [开发者] 2022 年 1 月 11 日 上午 7:42
BIRDSONG - Miscellaneous DLL Modding Tools
using Roost;



Birdsong.Sing(message or messages)

Improved logger. Accepts and displays any amount of arguments (including null), can format them as String.Format()[docs.microsoft.com] does. Accepts NoonUtility.VerbosityLevel.

Examples:
Birdsong.Sing("Hello World!"); Birdsong.Sing(1, 2f, null, Vector2.zero, Watchman.Get<Compendium>().GetSingleEntityById<Element>("lantern").icon); Birdsong.Sing("The element {0} uses icon {1}", elementId, Watchman.Get<Compendium>().GetEntityById<Element>(elementId).Icon);




AtTimeOfPower.[Time].Schedule(MyMethod, PatchType)

Quick-access patcher. Allows to schedule an execution of your own method each time when one of the significant game events happen. Allows all the same things that Harmony[harmony.pardeike.net] does since it's essentialy just a wrapper (if this doesn't sound like anything to you, you can just use simple parameterless method).

Currently available Times of Power:
- MainMenuLoaded;
- NewGameStarted;
- TabletopLoaded;
- RecipeRequirementsCheck;
- RecipeExecution, along with: RecipeMutations, RecipeXtriggers, RecipeDeckEffects, RecipeEffects, RecipeVerbManipulations, RecipePurges, RecipePortals, RecipeVfx;

PatchType.Prefix/PatchType.Postfix specify whether your method will be executed before or after the desired Time of Power.

Examples:
void Initialse() { AtTimeOfPower.MainMenuLoaded.Schedule(MyMainMenuMethod, PatchType.Postfix); } void MyMainMenuMethod() { Birdsong.Sing("Main menu has loaded and now I can do all the wonderful things with it"); }
void Initialse() { AtTimeOfPower.RecipeExecution.Schedule(MyChangesToRecipeExecution, PatchType.Prefix); } void MyChangesToRecipeExecution(RecipeCompletionCommand __instance) { ///do something }

最后由 Chelnoque 编辑于; 2022 年 3 月 3 日 上午 6:37