Esempio n. 1
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     contentPack.identifier = identifier;
     LoadStaticContentAsyncActions(args);
     args.ReportProgress(1f);
     yield break;
 }
        System.Collections.IEnumerator IContentPackProvider.LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            contentPack = new ContentPack();

            DisabledSkill           = ScriptableObject.CreateInstance <SkillDef>();
            DisabledSkill.skillName = "Disabled";
            ((ScriptableObject)DisabledSkill).name = DisabledSkill.skillName;
            DisabledSkill.skillNameToken           = LanguageConsts.EXTENDED_LOADOUT_SKILL_DISABLED_NAME;
            DisabledSkill.skillDescriptionToken    = LanguageConsts.EXTENDED_LOADOUT_SKILL_DISABLED_DESCRIPTION;
            DisabledSkill.icon = Sprite.Create(Texture2D.blackTexture, new Rect(0, 0, 1, 1), new Vector2(0, 0));// LoadoutAPI.CreateSkinIcon(Color.black, Color.black, Color.black, Color.black, Color.red);
            DisabledSkill.activationStateMachineName = "Weapon";
            DisabledSkill.activationState            = new EntityStates.SerializableEntityStateType(typeof(EntityStates.Idle));
            DisabledSkill.interruptPriority          = EntityStates.InterruptPriority.Any;
            DisabledSkill.baseRechargeInterval       = 0;
            DisabledSkill.baseMaxStock  = 1;
            DisabledSkill.rechargeStock = 0;
            DisabledSkill.beginSkillCooldownOnSkillEnd = false;
            DisabledSkill.rechargeStock  = 1;
            DisabledSkill.stockToConsume = 2;
            DisabledSkill.isCombatSkill  = false;

            contentPack.skillDefs.Add(new[] { DisabledSkill });

            args.ReportProgress(0.90F);

            //Early load of language to get display names
            Language.collectLanguageRootFolders += CollectRoRLanguageFolder;
            Language.BuildLanguagesFromFolders();
            english = Language.GetOrCreateLanguage("en");
            english.LoadStrings();
            Language.collectLanguageRootFolders -= CollectRoRLanguageFolder;

            args.ReportProgress(0.99F);
            yield break;
        }
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            assetBundle = AssetBundle.LoadFromMemory(Properties.Resources.lunarscrap);

            LanguageTokens.Add("ITEM_SCRAPLUNAR_NAME", "Item Scrap, Lunar");
            LanguageTokens.Add("ITEM_SCRAPLUNAR_LORE", "No notes found.");
            LanguageTokens.Add("ITEM_SCRAPLUNAR_DESC", "Does nothing. Prioritized when used with 3D printers.");
            LanguageTokens.Add("ITEM_SCRAPLUNAR_PICKUP", "Does nothing. Prioritized when used with 3D printers.");

            LunarScrapDef = ScriptableObject.CreateInstance <ItemDef>();

            LunarScrapDef.canRemove         = true;
            LunarScrapDef.descriptionToken  = "ITEM_SCRAPLUNAR_DESC";
            LunarScrapDef.hidden            = false;
            LunarScrapDef.loreToken         = "ITEM_SCRAPLUNAR_LORE";
            LunarScrapDef.name              = "ScrapLunar";
            LunarScrapDef.nameToken         = "ITEM_SCRAPLUNAR_NAME";
            LunarScrapDef.pickupIconSprite  = assetBundle.LoadAsset <Sprite>("Assets/LunarScrap.png");
            LunarScrapDef.pickupModelPrefab = Resources.Load <GameObject>("Prefabs/PickupModels/PickupScrap");
            LunarScrapDef.pickupToken       = "ITEM_SCRAPLUNAR_PICKUP";
            LunarScrapDef.tier              = ItemTier.Lunar;
            LunarScrapDef.tags              = new ItemTag[] { ItemTag.Scrap, ItemTag.WorldUnique };
            LunarScrapDef.unlockableDef     = null;

            ContentPack.itemDefs.Add(new ItemDef[] { LunarScrapDef });

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 4
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     CreateBuffs();
     //CreateObjects();
     contentPack.buffDefs.Add(buffDefs.ToArray());
     contentPack.networkedObjectPrefabs.Add(networkedObjectPrefabs.ToArray());
     yield break;
 }
Esempio n. 5
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            EnabledTexture = LoadSprite(Properties.Resources.enabled);
            args.ReportProgress(0.5f);
            yield return(null);

            DisabledTexture = LoadSprite(Properties.Resources.disabled);
            args.ReportProgress(1f);
        }
Esempio n. 6
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            Catalog.OnContentLoadStart();

            contentPack.buffDefs.Add(buffDefs.ToArray());
            contentPack.itemDefs.Add(itemDefs.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 7
0
        public System.Collections.IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            this.contentPack.identifier = this.identifier;
            contentPack.buffDefs.Add(TEBuffs.buffDefs.ToArray());
            contentPack.equipmentDefs.Add(TEEquipments.instance.EquipmentDefs.ToArray());
            contentPack.itemDefs.Add(TEItems.instance.ItemDefs.ToArray());
            contentPack.artifactDefs.Add(TEArtifacts.instance.ArtifactDefs.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            Artifacts.Create();
            Elites.Create();

            contentPack.artifactDefs.Add(Artifacts.artifactDefs.ToArray());
            contentPack.eliteDefs.Add(Elites.eliteDefs.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 9
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            ContentPacks.contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());

            ContentPacks.contentPack.skillDefs.Add(Loader.skillDefs.ToArray());
            ContentPacks.contentPack.skillFamilies.Add(Loader.skillFamilies.ToArray());
            ContentPacks.contentPack.survivorDefs.Add(Loader.survivorDefs.ToArray());
            ContentPacks.contentPack.bodyPrefabs.Add(Loader.bodyPrefabs.ToArray());
            ContentPacks.contentPack.masterPrefabs.Add(Loader.masterPrefabs.ToArray());
            ContentPacks.contentPack.projectilePrefabs.Add(Loader.projectilePrefabs.ToArray());
            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 10
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
     contentPack.buffDefs.Add(buffDefs.ToArray());
     contentPack.effectDefs.Add(effectDefs.ToArray());
     contentPack.entityStateTypes.Add(entityStates.ToArray());
     contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
     contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
     contentPack.skillDefs.Add(skillDefs.ToArray());
     contentPack.skillFamilies.Add(skillFamilies.ToArray());
     contentPack.survivorDefs.Add(survivorDefs.ToArray());
     contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
     yield break;
 }
Esempio n. 11
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            //we do a CONSIDERABLE amount of trolling.
            contentPack.artifactDefs.Add(Artifacts.DumpContent());
            //args.ReportProgress(1f);
            contentPack.bodyPrefabs.Add(Bodies.DumpContent());
            //args.ReportProgress(1f);
            contentPack.buffDefs.Add(Buffs.DumpContent());
            //args.ReportProgress(1f);
            contentPack.effectDefs.Add(Effects.DumpContent());
            //args.ReportProgress(1f);
            contentPack.eliteDefs.Add(Elites.DumpContent());
            //args.ReportProgress(1f);
            contentPack.gameEndingDefs.Add(GameEndings.DumpContent());
            //args.ReportProgress(1f);
            contentPack.entityStateConfigurations.Add(Loadouts.DumpConfigs());
            //args.ReportProgress(1f);
            contentPack.entityStateTypes.Add(Loadouts.DumpEntityStates());
            //args.ReportProgress(1f);
            contentPack.skillFamilies.Add(Loadouts.DumpContentSkillFamilies());
            //args.ReportProgress(1f);
            contentPack.skillDefs.Add(Loadouts.DumpContentSkillDefs());
            //args.ReportProgress(1f);
            contentPack.survivorDefs.Add(Loadouts.DumpSurvivorDefs());
            //args.ReportProgress(1f);
            contentPack.masterPrefabs.Add(Masters.DumpContent());
            //args.ReportProgress(1f);
            contentPack.musicTrackDefs.Add(MusicTracks.DumpContent());
            //args.ReportProgress(1f);
            contentPack.networkedObjectPrefabs.Add(NetworkPrefabs.DumpContent());
            //args.ReportProgress(1f);
            contentPack.networkSoundEventDefs.Add(NetworkSoundEvents.DumpContent());
            //args.ReportProgress(1f);
            contentPack.itemDefs.Add(Pickups.DumpContentItems());
            //args.ReportProgress(1f);
            contentPack.equipmentDefs.Add(Pickups.DumpContentEquipment());
            //args.ReportProgress(1f);
            contentPack.projectilePrefabs.Add(Projectiles.DumpContent());
            //args.ReportProgress(1f);
            contentPack.gameModePrefabs.Add(Runs.DumpContent());
            //args.ReportProgress(1f);
            contentPack.sceneDefs.Add(Scenes.DumpContent());
            //args.ReportProgress(1f);
            contentPack.surfaceDefs.Add(SurfaceDefinitions.DumpContent());
            args.ReportProgress(1f);

            yield break;
        }
Esempio n. 12
0
        public System.Collections.IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            this.contentPack.identifier = this.identifier;
            contentPack.bodyPrefabs.Add(Prefabs.bodyPrefabs.ToArray());
            contentPack.buffDefs.Add(Buffs.buffDefs.ToArray());
            contentPack.effectDefs.Add(Assets.effectDefs.ToArray());
            contentPack.entityStateTypes.Add(States.entityStates.ToArray());
            contentPack.masterPrefabs.Add(Prefabs.masterPrefabs.ToArray());
            contentPack.networkSoundEventDefs.Add(Assets.networkSoundEventDefs.ToArray());
            contentPack.projectilePrefabs.Add(Prefabs.projectilePrefabs.ToArray());
            contentPack.skillDefs.Add(Skills.skillDefs.ToArray());
            contentPack.skillFamilies.Add(Skills.skillFamilies.ToArray());
            contentPack.survivorDefs.Add(Prefabs.survivorDefinitions.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 13
0
        public System.Collections.IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            this.contentPack.identifier = this.identifier;
            contentPack.bodyPrefabs.Add(UrsaPlugin.characterBodies.ToArray());
            contentPack.buffDefs.Add(UrsaPlugin.buffDefs.ToArray());
            contentPack.effectDefs.Add(UrsaPlugin.effectDefs.ToArray());
            contentPack.entityStateTypes.Add(UrsaPlugin.entityStateTypes.ToArray());
            contentPack.masterPrefabs.Add(UrsaPlugin.characterMasters.ToArray());
            contentPack.networkSoundEventDefs.Add(UrsaPlugin.networkSoundEventDefs.ToArray());
            contentPack.projectilePrefabs.Add(UrsaPlugin.projectilePrefabs.ToArray());
            contentPack.skillDefs.Add(UrsaPlugin.skillDefs.ToArray());
            contentPack.skillFamilies.Add(UrsaPlugin.skillFamilies.ToArray());
            contentPack.survivorDefs.Add(UrsaPlugin.survivorDefs.ToArray());
            contentPack.unlockableDefs.Add(UrsaPlugin.unlockableDefs.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 14
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     this.contentPack.identifier = this.identifier;
     contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
     contentPack.buffDefs.Add(buffDefs.ToArray());
     contentPack.effectDefs.Add(effectDefs.ToArray());
     contentPack.entityStateTypes.Add(entityStates.ToArray());
     contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
     contentPack.networkedObjectPrefabs.Add(networkPrefabs.ToArray());
     contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray());
     contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
     contentPack.skillDefs.Add(skillDefs.ToArray());
     contentPack.skillFamilies.Add(skillFamilies.ToArray());
     contentPack.survivorDefs.Add(survivorDefinitions.ToArray());
     contentPack.unlockableDefs.Add(unlockableDefs.ToArray());
     contentPack.sceneDefs.Add(sceneDefs.ToArray());
     args.ReportProgress(1f);
     yield break;
 }
Esempio n. 15
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            DebrisBundle = AssetBundle.LoadFromMemory(Properties.Resources.debrisartifact);

            DebrisArtifact = ScriptableObject.CreateInstance <ArtifactDef>();

            LanguageTokens.Add("DEB_NAME_TOKEN", "Artifact of Debris");
            LanguageTokens.Add("DEB_DESC_TOKEN", "All items turn to scrap to be printed.");

            DebrisArtifact.nameToken                 = "DEB_NAME_TOKEN";
            DebrisArtifact.descriptionToken          = "DEB_DESC_TOKEN";
            DebrisArtifact.smallIconDeselectedSprite = DebrisBundle.LoadAsset <Sprite>("Assets/Scrap_Dim.png");
            DebrisArtifact.smallIconSelectedSprite   = DebrisBundle.LoadAsset <Sprite>("Assets/Scrap.png");

            ContentPack.artifactDefs.Add(new ArtifactDef[] { DebrisArtifact });

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 16
0
        public System.Collections.IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            // Apparently R2API has it's own content pack and any of the "Add" methods in the various modules also add those assets to
            // R2API's content pack. Much of this was unneeded. Sigh.

            this.contentPack.identifier = this.identifier;
            contentPack.bodyPrefabs.Add(StanWorshipperPlugin.characterBodies.ToArray());
            contentPack.buffDefs.Add(StanWorshipperPlugin.buffDefs.ToArray());
            contentPack.effectDefs.Add(StanWorshipperPlugin.effectDefs.ToArray());
            contentPack.entityStateTypes.Add(StanWorshipperPlugin.entityStateTypes.ToArray());
            contentPack.masterPrefabs.Add(StanWorshipperPlugin.characterMasters.ToArray());
            contentPack.networkSoundEventDefs.Add(StanWorshipperPlugin.networkSoundEventDefs.ToArray());
            contentPack.projectilePrefabs.Add(StanWorshipperPlugin.projectilePrefabs.ToArray());
            contentPack.skillDefs.Add(StanWorshipperPlugin.skillDefs.ToArray());
            contentPack.skillFamilies.Add(StanWorshipperPlugin.skillFamilies.ToArray());
            contentPack.survivorDefs.Add(StanWorshipperPlugin.survivorDefs.ToArray());
            contentPack.unlockableDefs.Add(StanWorshipperPlugin.unlockableDefs.ToArray());

            args.ReportProgress(1f);
            yield break;
        }
Esempio n. 17
0
            public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
            {
                this.contentPack.identifier = this.identifier;
                contentPack.artifactDefs.Add(artifactDefs.ToArray());
                contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray());
                contentPack.buffDefs.Add(buffDefs.ToArray());
                contentPack.equipmentDefs.Add(equipmentDefs.ToArray());
                contentPack.itemDefs.Add(itemDefs.ToArray());
                contentPack.masterPrefabs.Add(masterPrefabs.ToArray());
                contentPack.networkedObjectPrefabs.Add(networkedPrefabs.ToArray());
                contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray());
                contentPack.skillDefs.Add(skillDefs.ToArray());
                contentPack.skillFamilies.Add(skillFamilies.ToArray());
                contentPack.survivorDefs.Add(survivorDefs.ToArray());
                contentPack.unlockableDefs.Add(unlockableDefs.ToArray());



                args.ReportProgress(1f);
                yield break;
            }
 protected override void LoadStaticContentAsyncActions(LoadStaticContentAsyncArgs args)
 {
     contentPack.bodyPrefabs.Add(bodyObjects.ToArray());
     contentPack.masterPrefabs.Add(masterObjects.ToArray());
 }
Esempio n. 19
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     content.bodyPrefabs.Add(new GameObject[] { ClayMen.clayObject });
     content.masterPrefabs.Add(new GameObject[] { ClayMen.clayMaster });
     yield break;
 }
Esempio n. 20
0
 public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
 {
     args.ReportProgress(1f);
     yield break;
 }
Esempio n. 21
0
 /// <summary>
 /// The actions where new content can be added.
 /// </summary>
 /// <param name="args">Useful for declaring progress for content additions.</param>
 protected abstract void LoadStaticContentAsyncActions(LoadStaticContentAsyncArgs args);
Esempio n. 22
0
        public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
        {
            contentPack.identifier = identifier;
            MysticsRisky2Utils.ContentManagement.ContentLoadHelper contentLoadHelper = new MysticsRisky2Utils.ContentManagement.ContentLoadHelper();

            // Add content loading dispatchers to the content load helper
            System.Action[] loadDispatchers = new System.Action[]
            {
                () => contentLoadHelper.DispatchLoad <ItemDef>(Main.executingAssembly, typeof(MysticsRisky2Utils.BaseAssetTypes.BaseItem), x => contentPack.itemDefs.Add(x)),
                () => contentLoadHelper.DispatchLoad <EquipmentDef>(Main.executingAssembly, typeof(MysticsRisky2Utils.BaseAssetTypes.BaseEquipment), x => contentPack.equipmentDefs.Add(x)),
                () => contentLoadHelper.DispatchLoad <BuffDef>(Main.executingAssembly, typeof(MysticsRisky2Utils.BaseAssetTypes.BaseBuff), x => contentPack.buffDefs.Add(x)),
                () => contentLoadHelper.DispatchLoad <GameObject>(Main.executingAssembly, typeof(MysticsRisky2Utils.BaseAssetTypes.BaseInteractable), null)
            };
            int num = 0;

            for (int i = 0; i < loadDispatchers.Length; i = num)
            {
                loadDispatchers[i]();
                args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)loadDispatchers.Length, 0f, 0.05f));
                yield return(null);

                num = i + 1;
            }

            // Start loading content. Longest part of the loading process, so we will dedicate most of the progress bar to it
            while (contentLoadHelper.coroutine.MoveNext())
            {
                args.ReportProgress(Util.Remap(contentLoadHelper.progress.value, 0f, 1f, 0.05f, 0.9f));
                yield return(contentLoadHelper.coroutine.Current);
            }

            // Populate static content pack fields and add various prefabs and scriptable objects generated during the content loading part to the content pack
            loadDispatchers = new System.Action[]
            {
                () => ContentLoadHelper.PopulateTypeFields <ItemDef>(typeof(Items), contentPack.itemDefs),
                () => ContentLoadHelper.PopulateTypeFields <EquipmentDef>(typeof(Equipment), contentPack.equipmentDefs),
                () => ContentLoadHelper.PopulateTypeFields <BuffDef>(typeof(Buffs), contentPack.buffDefs),
                () => contentPack.bodyPrefabs.Add(Resources.bodyPrefabs.ToArray()),
                () => contentPack.masterPrefabs.Add(Resources.masterPrefabs.ToArray()),
                () => contentPack.projectilePrefabs.Add(Resources.projectilePrefabs.ToArray()),
                () => contentPack.effectDefs.Add(Resources.effectPrefabs.ConvertAll(x => new EffectDef(x)).ToArray()),
                () => contentPack.networkSoundEventDefs.Add(Resources.networkSoundEventDefs.ToArray()),
                () => contentPack.unlockableDefs.Add(Resources.unlockableDefs.ToArray()),
                () => contentPack.entityStateTypes.Add(Resources.entityStateTypes.ToArray()),
                () => contentPack.skillDefs.Add(Resources.skillDefs.ToArray()),
                () => contentPack.skillFamilies.Add(Resources.skillFamilies.ToArray())
            };
            for (int i = 0; i < loadDispatchers.Length; i = num)
            {
                loadDispatchers[i]();
                args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)loadDispatchers.Length, 0.9f, 0.95f));
                yield return(null);

                num = i + 1;
            }

            // Call "AfterContentPackLoaded" methods
            loadDispatchers = new System.Action[]
            {
                () => MysticsRisky2Utils.ContentManagement.ContentLoadHelper.InvokeAfterContentPackLoaded <MysticsRisky2Utils.BaseAssetTypes.BaseItem>(Main.executingAssembly),
                () => MysticsRisky2Utils.ContentManagement.ContentLoadHelper.InvokeAfterContentPackLoaded <MysticsRisky2Utils.BaseAssetTypes.BaseEquipment>(Main.executingAssembly),
                () => MysticsRisky2Utils.ContentManagement.ContentLoadHelper.InvokeAfterContentPackLoaded <MysticsRisky2Utils.BaseAssetTypes.BaseBuff>(Main.executingAssembly),
                () => MysticsRisky2Utils.ContentManagement.ContentLoadHelper.InvokeAfterContentPackLoaded <MysticsRisky2Utils.BaseAssetTypes.BaseInteractable>(Main.executingAssembly)
            };
            for (int i = 0; i < loadDispatchers.Length; i = num)
            {
                loadDispatchers[i]();
                args.ReportProgress(Util.Remap((float)(i + 1), 0f, (float)loadDispatchers.Length, 0.95f, 0.99f));
                yield return(null);

                num = i + 1;
            }

            loadDispatchers = null;
            yield break;
        }
Esempio n. 23
0
        private static System.Collections.IEnumerator LoadOnlyOnce(On.RoR2.RoR2Content.orig_LoadStaticContentAsync orig, RoR2Content self, LoadStaticContentAsyncArgs args)
        {
            if (!_ror2ContentLoaded)
            {
                yield return(orig(self, args));
            }

            yield break;
        }