internal static void Postfix(NKMultiConnection __instance) { var messageQueue = __instance.ReceiveQueue; if (messageQueue == null || messageQueue.Count == 0) { return; } for (int i = 0; i < messageQueue.Count; i++) { var message = messageQueue.Dequeue(); bool consumed = false; MelonMain.PerformHook(mod => { consumed |= mod.ActOnMessage(message); }); if (!consumed) { messageQueue.Enqueue(message); } } }
internal static void Postfix() { foreach (var mod in MelonHandler.Mods.OfType <BloonsMod>().OrderByDescending(mod => mod.Priority)) { try { ResourceHandler.LoadEmbeddedTextures(mod); ResourceHandler.LoadEmbeddedBundles(mod); ModContent.LoadModContent(mod); } catch (Exception e) { MelonLogger.Error("Critical failure when loading resources for mod " + mod.Info.Name); MelonLogger.Error(e); } } MelonMain.PerformHook(mod => mod.OnTitleScreen()); foreach (var modParagonTower in ModContent.GetContent <ModVanillaParagon>()) { modParagonTower.AddUpgradesToRealTowers(); } foreach (var modelMod in Game.instance.model.mods) { if (modelMod.name.EndsWith("Only")) { var mutatorModModels = modelMod.mutatorMods.ToList(); mutatorModModels.AddRange(ModContent.GetContent <ModTowerSet>() .Where(set => !set.AllowInRestrictedModes) .Select(set => new LockTowerSetModModel(modelMod.name, set.Id))); modelMod.mutatorMods = mutatorModModels.ToIl2CppReferenceArray(); } } }
internal static void Postfix(ProfileModel __instance) { foreach (var modTower in ModContent.GetContent <ModTower>() .Where(modTower => !(modTower is ModHero) && !__instance.unlockedTowers.Contains(modTower.Id))) { __instance.unlockedTowers.Add(modTower.Id); __instance.acquiredUpgrades.Add(modTower.Id); } foreach (var modUpgrade in ModContent.GetContent <ModUpgrade>() .Where(modUpgrade => !__instance.acquiredUpgrades.Contains(modUpgrade.Id))) { __instance.acquiredUpgrades.Add(modUpgrade.Id); } foreach (var modHero in ModContent.GetContent <ModHero>()) { __instance.unlockedHeroes.Add(modHero.Id); __instance.seenUnlockedHeroes.Add(modHero.Id); __instance.seenNewHeroNotification.Add(modHero.Id); } MelonMain.PerformHook(mod => mod.OnProfileLoaded(__instance)); }
internal static void Postfix(Tower __instance, TowerSaveDataModel towerData) { MelonMain.PerformHook(mod => mod.OnTowerLoaded(__instance, towerData)); }
internal static void Postfix(InGame __instance) { MelonMain.PerformHook(mod => mod.OnMatchStart()); }
internal static void Postfix() { MelonMain.PerformHook(mod => mod.OnMatchEnd()); }
internal static void Postfix(Bloon __instance) { MelonMain.PerformHook(mod => mod.PostBloonLeaked(__instance)); }
internal static void Postfix() { MelonMain.PerformHook(mod => mod.OnDefeat()); }
internal static void Postfix(Tower __instance, float amount) { MelonMain.PerformHook(mod => mod.OnTowerSold(__instance, amount)); }
internal static void Postfix(Tower __instance) { MelonMain.PerformHook(mod => mod.OnTowerSelected(__instance)); }
internal static void Postfix(Tower __instance, TowerSaveDataModel __result) { MelonMain.PerformHook(mod => mod.OnTowerSaved(__instance, __result)); }
internal static void Postfix() { MelonMain.PerformHook(mod => mod.OnRoundStart()); }
internal static void Postfix() { ResetSessionData(); MelonMain.PerformHook(mod => mod.OnMainMenu()); }
internal static void Postfix() { MelonMain.PerformHook(mod => mod.OnVictory()); }
internal static void Postfix(bool value) { MelonMain.PerformHook(mod => mod.OnFastForwardChanged(value)); }
internal static void Postfix(Attack __instance, Entity targetLocal, Model modelToUse) { MelonMain.PerformHook(mod => mod.OnAttackCreated(__instance, targetLocal, modelToUse)); MelonMain.PerformHook(mod => mod.OnAttackModelChanged(__instance, modelToUse)); }
internal static void Postfix(Bloon __instance, Model modelToUse) { MelonMain.PerformHook(mod => mod.OnBloonModelUpdated(__instance, modelToUse)); }
internal static void Postfix(Ability __instance) { MelonMain.PerformHook(mod => mod.OnAbilityCast(__instance)); }
internal static void Postfix(double c, Simulation.CashType from, int cashIndex, Simulation.CashSource source) { MelonMain.PerformHook(mod => mod.OnCashRemoved(c, from, cashIndex, source)); }
internal static void Postfix() { MelonMain.PerformHook(mod => mod.OnRoundEnd()); SessionData.Instance.LeakedBloons.Clear(); SessionData.Instance.DestroyedBloons.Clear(); }
internal static void Postfix(Weapon __instance, Entity target, Model modelToUse) { MelonMain.PerformHook(mod => mod.OnWeaponCreated(__instance, target, modelToUse)); MelonMain.PerformHook(mod => mod.OnWeaponModelChanged(__instance, modelToUse)); }
internal static void Postfix(Projectile __instance, Model modelToUse) { MelonMain.PerformHook(mod => mod.OnProjectileModelChanged(__instance, modelToUse)); }
internal static void Postfix(Tower __instance, Model modelToUse) { MelonMain.PerformHook(mod => mod.OnTowerModelChanged(__instance, modelToUse)); }
public static void Postfix(Weapon __instance) { MelonMain.PerformHook(mod => mod.OnWeaponFire(__instance)); }