private static void AddContent(On.RoR2.ContentManager.orig_SetContentPacks orig, List <ContentPack> newContentPacks) { ContentPack contentPack = new ContentPack(); contentPack.itemDefs = NewDefsList.ToArray(); newContentPacks.Add(contentPack); orig(newContentPacks); }
private void AddContent(On.RoR2.ContentManager.orig_SetContentPacks orig, List <ContentPack> newContentPacks) { preContentPackLoad?.Invoke(); //Modify content pack. foreach (Util.Module module in modules) { LogCore.LogI(module + " is modifying the content pack."); module.ModifyContentPack(internalContentPack); } newContentPacks.Add(internalContentPack); postContentPackLoad?.Invoke(); orig(newContentPacks); }
private static void AddCustomContent(On.RoR2.ContentManager.orig_SetContentPacks orig, System.Collections.Generic.List <ContentPack> newContentPacks) { if (WhenContentPackReady != null) { foreach (Action <ContentPack> @event in WhenContentPackReady.GetInvocationList()) { try { @event(ContentPack); } catch (Exception e) { R2API.Logger.LogError(e); } } } newContentPacks.Add(ContentPack); orig(newContentPacks); }
private void AddContent(On.RoR2.ContentManager.orig_SetContentPacks orig, List <ContentPack> newContentPacks) { newContentPacks.Add(contentPack); orig(newContentPacks); }