public static int GetMaxCategoryPage(ItemSpawnerCategoryDefinitions.Category category)
        {
            int numCats = 0;

            foreach (ItemSpawnerCategoryDefinitions.SubCategory sub in category.Subcats)
            {
                bool displayCategory = sub.DoesDisplay_Sandbox;
                if (GM.CurrentSceneSettings.UsesUnlockSystem)
                {
                    displayCategory = sub.DoesDisplay_Unlocks;
                }

                if (displayCategory)
                {
                    numCats += 1;
                }
            }

            return((numCats - 1) / 10);
        }
        public static List <ItemSpawnerCategoryDefinitions.SubCategory> GetVisibleSubCategories(ItemSpawnerCategoryDefinitions.Category category)
        {
            List <ItemSpawnerCategoryDefinitions.SubCategory> visible = new List <ItemSpawnerCategoryDefinitions.SubCategory>();

            foreach (ItemSpawnerCategoryDefinitions.SubCategory sub in category.Subcats)
            {
                bool displayCategory = sub.DoesDisplay_Sandbox;
                if (GM.CurrentSceneSettings.UsesUnlockSystem)
                {
                    displayCategory = sub.DoesDisplay_Unlocks;
                }

                if (displayCategory)
                {
                    visible.Add(sub);
                }
            }

            return(visible);
        }
Esempio n. 3
0
        private void SpawnerRefreshElements(string firstMatch = "")
        {
#if !UNITY_EDITOR && !UNITY_STANDALONE
            if (ItemInfo == null || ItemImage == null)
            {
                return;
            }

            if (m_currentFVRObj != null)
            {
                string output = "";
                output += $"{m_currentFVRObj.DisplayName} ({m_currentFVRObj.ItemID}) - {m_currentFVRObj.Category}, {m_currentFVRObj.TagEra}, {m_currentFVRObj.TagSet}";
                output += $"\nSpawned From: {m_currentFVRObj.SpawnedFromId}";
                output += $"\nMass: {m_currentFVRObj.Mass}, Mag Cap: {m_currentFVRObj.MagazineCapacity}, Requires Picatinny Sight: {m_currentFVRObj.RequiresPicatinnySight}";
                output += $"\n   Firearm Tags: {m_currentFVRObj.TagFirearmSize}, {m_currentFVRObj.TagFirearmAction}, {m_currentFVRObj.TagFirearmRoundPower}";
                output += $"\n       Firing Modes - ";
                if (m_currentFVRObj.TagFirearmFiringModes.Count > 0)
                {
                    output += string.Join(", ", m_currentFVRObj.TagFirearmFiringModes.ConvertAll(x => x.ToString()).ToArray());
                }
                output += $"\n       Feed Options - ";
                if (m_currentFVRObj.TagFirearmFeedOption.Count > 0)
                {
                    output += string.Join(", ", m_currentFVRObj.TagFirearmFeedOption.ConvertAll(x => x.ToString()).ToArray());
                }
                output += $"\n             Mounts - ";
                if (m_currentFVRObj.TagFirearmMounts.Count > 0)
                {
                    output += string.Join(", ", m_currentFVRObj.TagFirearmMounts.ConvertAll(x => x.ToString()).ToArray());
                }
                output += $"\nAttachment Tags: {m_currentFVRObj.TagAttachmentMount}, {m_currentFVRObj.TagAttachmentFeature}";
                output += $"\n     Melee Tags: {m_currentFVRObj.TagMeleeStyle}, {m_currentFVRObj.TagMeleeHandedness}";
                output += $"\n   Powerup Tags: {m_currentFVRObj.TagPowerupType}";
                output += $"\n    Thrown Tags: {m_currentFVRObj.TagThrownType}, {m_currentFVRObj.TagThrownDamageType}";

                if (m_currentItemSpawnerID != null)
                {
                    ItemSpawnerCategoryDefinitions.Category    Cat    = Array.Find(ManagerSingleton <IM> .Instance.CatDefs.Categories, x => x.Cat == m_currentItemSpawnerID.Category);
                    ItemSpawnerCategoryDefinitions.SubCategory SubCat = Array.Find(Cat.Subcats, x => x.Subcat == m_currentItemSpawnerID.SubCategory);

                    output += $"\n\n";
                    if (Cat != null)
                    {
                        output += $"{Cat.DisplayName} ({Cat.DoesDisplay_Sandbox}, {Cat.DoesDisplay_Unlocks}) | ";
                    }
                    if (SubCat != null)
                    {
                        output += $"{SubCat.DisplayName} ({SubCat.DoesDisplay_Sandbox}, {SubCat.DoesDisplay_Unlocks}) | ";
                    }
                    output += $"{m_currentItemSpawnerID.DisplayName} ({m_currentItemSpawnerID.ItemID})";
                    output += $"\nSpawns: {m_currentItemSpawnerID.MainObject.DisplayName} on {(!(m_currentItemSpawnerID.UsesLargeSpawnPad || m_currentItemSpawnerID.UsesHugeSpawnPad) ? "Small" : (m_currentItemSpawnerID.UsesLargeSpawnPad ? "Large" : "Huge"))}";
                    if (m_currentItemSpawnerID.SecondObject != null)
                    {
                        output += $", {m_currentItemSpawnerID.SecondObject.DisplayName}";
                    }
                    output          += $"\nUnlock Cost: {m_currentItemSpawnerID.UnlockCost} S.A.U.C.E. {(m_currentItemSpawnerID.IsUnlockedByDefault ? "(Unlocked by default) -" : "-")} Is Reward: {m_currentItemSpawnerID.IsReward}";
                    output          += $"\nSubheading: {m_currentItemSpawnerID.SubHeading}\nDescription: {m_currentItemSpawnerID.Description}";
                    ItemImage.sprite = m_currentItemSpawnerID.Sprite;
                }
                else
                {
                    output          += $"\n\nNo ItemSpawnerID found.";
                    ItemImage.sprite = ItemImageNoIcon;
                }

                ItemInfo.text = output;
            }
            else
            {
                ItemImage.sprite = ItemImageNoIcon;
                ItemInfo.text    = "No FVRObject found.";
                if (m_currentGameObj != null)
                {
                    ItemInfo.text += $"\nThe current object's name is {m_currentGameObj.name}.";
                }
                if (!string.IsNullOrEmpty(firstMatch))
                {
                    ItemInfo.text += $"\nThe match text was {firstMatch}.";
                }
            }
#endif
        }