Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 private void AddContent(On.RoR2.ContentManager.orig_SetContentPacks orig, List <ContentPack> newContentPacks)
 {
     newContentPacks.Add(contentPack);
     orig(newContentPacks);
 }