Exemplo n.º 1
0
        /// <summary>
        /// Populates a new ModCraftTreeRoot from a CraftNode tree.
        /// </summary>
        /// <param name="tree">The tree to create the ModCraftTreeRoot from.</param>
        /// <param name="root"></param>
        internal static void CreateFromExistingTree(CraftNode tree, ref ModCraftTreeLinkingNode root)
        {
            foreach (CraftNode node in tree)
            {
                if (node.action == TreeAction.Expand)
                {
                    ModCraftTreeTab tab   = root.AddTabNode(node.id);
                    var             thing = (ModCraftTreeLinkingNode)tab;
                    CreateFromExistingTree(node, ref thing);
                }

                if (node.action == TreeAction.Craft)
                {
                    var techType = TechType.None;
                    TechTypeExtensions.FromString(node.id, out techType, false);

                    if (node.id == "SeamothHullModule2")
                    {
                        techType = TechType.VehicleHullModule2;
                    }
                    else if (node.id == "SeamothHullModule3")
                    {
                        techType = TechType.VehicleHullModule3;
                    }

                    root.AddCraftingNode(techType);
                }
            }
        }
Exemplo n.º 2
0
        public static void Postfix(ref TechType __result)
        {
            if (__result == TechType.None)
            {
                return;
            }

            RecipeData recipeData;
            TechType   techType2;
            bool       eggCheck;

            while (!(eggCheck = TechTypeExtensions.FromString(__result.AsString() + "Egg", out techType2, true)) && (recipeData = CraftDataHandler.GetTechData(__result)) != null && recipeData.ingredientCount > 0)
            {
                try{ __result = recipeData.Ingredients.GetRandom().techType; }
                catch
                {
                    // ignored
                }
            }

            if (eggCheck)
            {
                __result = techType2;
            }
        }
Exemplo n.º 3
0
        public override TechType ConvertFromSerial(string value)
        {
            if (TechTypeExtensions.FromString(value, out var tType, true))
            {
                //SetNameAsComment(value, tType);

                return(tType);
            }
Exemplo n.º 4
0
 public void Start()
 {
     TechTypeExtensions.FromString("SpeedModule", out SpeedModule, true);
     ThisEquipment               = ThisExosuit.modules;
     ThisEquipment.onAddItem    += OnAddItem;
     ThisEquipment.onRemoveItem += OnRemoveItem;
     Main.Instance.onExosuitSpeedValueChanged.AddHandler(this, new Event <object> .HandleFunction(OnExosuitSpeedValueChanged));
     Main.Instance.onPlayerMotorModeChanged.AddHandler(this, new Event <Player.MotorMode> .HandleFunction(OnPlayerMotorModeChanged));
 }
Exemplo n.º 5
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var tt = (string)serializer.Deserialize(reader, typeof(string));

            return(TechTypeExtensions.FromString(tt, out var techType, true) ?
                   techType
                : TechTypeHandler.TryGetModdedTechType(tt, out techType) ?
                   techType
                    : throw new Exception($"Failed to parse {tt} into a TechType."));
        }
Exemplo n.º 6
0
 public void Start()
 {
     TechTypeExtensions.FromString("SpeedModule", out SpeedModule, true);
     ThisEquipment               = ThisSeamoth.modules;
     ThisEquipment.onAddItem    += OnAddItem;
     ThisEquipment.onRemoveItem += OnRemoveItem;
     Main.Instance.isSeamothCanFly.changedEvent.AddHandler(this, new Event <Utils.MonitoredValue <bool> > .HandleFunction(OnSeamothCanFlyChanged));
     Main.Instance.onSeamothSpeedValueChanged.AddHandler(this, new Event <object> .HandleFunction(OnSeamothSpeedValueChanged));
     Main.Instance.onPlayerMotorModeChanged.AddHandler(this, new Event <Player.MotorMode> .HandleFunction(OnPlayerMotorModeChanged));
 }
Exemplo n.º 7
0
        private static void CreateDataboxesAndLoadFiles()
        {
            foreach (FileInfo file in DataboxFolder.GetFiles().Where((x) => x.Extension.ToLower() == ".json"))
            {
                try
                {
                    DataboxInfo databox;
                    using (var reader = new StreamReader(file.FullName))
                    {
                        var serializer = new JsonSerializer();
                        databox = JsonConvert.DeserializeObject <DataboxInfo>(reader.ReadToEnd(), new JsonConverter[]
                        {
                            new StringEnumConverter()
                            {
#if SN1
                                CamelCaseText = true,
#elif BZ
                                NamingStrategy = new CamelCaseNamingStrategy(),
#endif
                                AllowIntegerValues = true
                            },
                            new TechTypeConverter(),
                            new Vector3Converter()
                        });
                    }
                    if (databox != null)
                    {
                        var tt = TechTypeExtensions.FromString(databox.ItemToUnlock, out var techType, true) ? techType
                            : TechTypeHandler.TryGetModdedTechType(databox.ItemToUnlock, out techType) ? techType
                                : TechType.None;

                        if (tt != TechType.None)
                        {
                            var customDatabox = new DataboxPrefab(databox.DataboxID, databox.AlreadyUnlockedDescription, databox.PrimaryDescription, databox.SecondaryDescription, tt, databox.BiomesToSpawnIn, databox.CoordinatedSpawns);
                            customDatabox.Patch();
                        }
                        else
                        {
                            throw new Exception($"Couldn't parse {databox.ItemToUnlock} to TechType.");
                        }
                    }
                    else
                    {
                        QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Unable to load Custom Databox from {Path.GetDirectoryName(file.FullName)}!");
                    }
                }
                catch (Exception e)
                {
                    QModManager.Utility.Logger.Log(QModManager.Utility.Logger.Level.Error, $"Unable to load Custom Databox from {Path.GetDirectoryName(file.FullName)}!", e);
                }
            }
        }
Exemplo n.º 8
0
        private static void LoadChangeFiles()
        {
            Dictionary <TechType, List <BiomeData> > modifiedDistributions = new Dictionary <TechType, List <BiomeData> >();

            foreach (FileInfo file in ChangesPath.GetFiles().Where((x) => x.Extension.ToLower() == ".json"))
            {
                try
                {
                    if (!file.Name.ToLower().Contains("disabled"))
                    {
                        SortedDictionary <string, List <BiomeData> > pairs;
                        using (StreamReader reader = new StreamReader(file.FullName))
                        {
                            pairs = JsonConvert.DeserializeObject <SortedDictionary <string, List <BiomeData> > >(reader.ReadToEnd(), new JsonConverter[] {
                                new StringEnumConverter()
                                {
#if SUBNAUTICA_STABLE
                                    CamelCaseText = true,
#else
                                    NamingStrategy = new CamelCaseNamingStrategy(),
#endif
                                    AllowIntegerValues = true
                                },
                                new TechTypeConverter()
                            }) ?? new SortedDictionary <string, List <BiomeData> >();
                        }
                        int Succeded = 0;
                        foreach (KeyValuePair <string, List <BiomeData> > pair in pairs)
                        {
                            if (TechTypeExtensions.FromString(pair.Key, out TechType techType, true))
                            {
                                if (modifiedDistributions.ContainsKey(techType))
                                {
                                    List <BiomeData> datas = modifiedDistributions[techType];
                                    pair.Value.ForEach((x) => datas.Add(x));
                                    datas.Distinct();
                                    Succeded++;
                                }
                                else
                                {
                                    modifiedDistributions[techType] = pair.Value;
                                    Succeded++;
                                }
                            }
                            else
                            {
                                Logger.Log(Logger.Level.Debug, $"TechType: {pair.Key} not found --- do you have its mod installed?");
                            }
                        }
                        Logger.Log(Logger.Level.Debug, $"Successfully loaded file: {file.Name} with {Succeded} TechTypes being altered.");
                    }
        private void CloneTopLevelModTab(string scheme, ref Dictionary <string, string> languageLines, ref Dictionary <string, Atlas.Sprite> group)
        {
            string clonedLangKey = string.Format(DisplayNameFormat, AioFabScheme, scheme);

            if (!languageLines.ContainsKey(clonedLangKey) && languageLines.TryGetValue(scheme, out string origString))
            {
                languageLines[clonedLangKey] = origString;
            }

            string clonedSpriteKey = string.Format(TabSpriteFormat, AioFabScheme, scheme);

            if (TechTypeExtensions.FromString(scheme, out TechType techType, true))
            {
                group[clonedSpriteKey] = SpriteManager.Get(techType);
            }
        }
Exemplo n.º 10
0
        public void Start()
        {
            TechTypeExtensions.FromString("SpeedModule", out SpeedModule, true);

#if DEBUG_SEAMOTH_OVERDRIVE
            seamothID = gameObject.GetId();
            Logger.Log($"[CheatManager]\nSeamothOverDrive.Start(): {seamothID}\nForwardForce: {seamoth.forwardForce}\nBackWardForce: {seamoth.backwardForce}\nVerticalForce: {seamoth.verticalForce}\nSidewardForce: {seamoth.sidewardForce}\nSidewaysTorque: {seamoth.sidewaysTorque}");
#endif
            Seamoth_forwardForce  = seamoth.forwardForce;
            Seamoth_backwardForce = seamoth.backwardForce;
            Seamoth_sidewardForce = seamoth.sidewardForce;
            Seamoth_verticalForce = seamoth.verticalForce;

            seamothEquipment               = seamoth.modules;
            seamothEquipment.onAddItem    += SpeedModuleAddListener;
            seamothEquipment.onRemoveItem += SpeedModuleRemoveListener;
        }
Exemplo n.º 11
0
        /// <summary>
        /// Populates a new ModCraftTreeRoot from a CraftNode tree.
        /// </summary>
        /// <param name="tree">The tree to create the ModCraftTreeRoot from.</param>
        /// <param name="root"></param>
        internal static void CreateFromExistingTree(CraftNode tree, ref ModCraftTreeLinkingNode root)
        {
            foreach (CraftNode node in tree)
            {
                if (node.action == TreeAction.Expand)
                {
                    ModCraftTreeTab tab   = root.AddTabNode(node.id);
                    var             thing = (ModCraftTreeLinkingNode)tab;
                    CreateFromExistingTree(node, ref thing);
                }

                if (node.action == TreeAction.Craft)
                {
                    TechTypeExtensions.FromString(node.id, out TechType techType, false);

                    root.AddCraftingNode(techType);
                }
            }
        }
Exemplo n.º 12
0
        public void Start()
        {
            TechTypeExtensions.FromString("SpeedModule", out SpeedModule, true);

#if DEBUG_EXOSUIT_OVERDRIVE
            exosuitID = gameObject.GetId();
            Logger.Log($"ExosuitOverDrive.Start(): {exosuitID}\nForwardForce: {exosuit.forwardForce}\nBackWardForce: {exosuit.backwardForce}\nVerticalForce: {exosuit.verticalForce}\nSidewardForce: {exosuit.sidewardForce}\nSidewaysTorque: {exosuit.sidewaysTorque}");
#endif

            Exosuit_forwardForce  = exosuit.forwardForce;
            Exosuit_backwardForce = exosuit.backwardForce;
            Exosuit_sidewardForce = exosuit.sidewardForce;
            Exosuit_verticalForce = exosuit.verticalForce;

            prev_multiplier = 1;

            exosuitEquipment               = exosuit.modules;
            exosuitEquipment.onAddItem    += SpeedModuleAddListener;
            exosuitEquipment.onRemoveItem += SpeedModuleRemoveListener;
        }
        internal static TechType ToTechType(this string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(TechType.None);
            }

            // Look for a known TechType
            if (TechTypeExtensions.FromString(value, out TechType tType, true))
            {
                return(tType);
            }

            //  Not one of the known TechTypes - is it registered with SMLHelper?
            if (TechTypeHandler.TryGetModdedTechType(value, out TechType custom))
            {
                return(custom);
            }

            return(TechType.None);
        }
Exemplo n.º 14
0
        private static void ReplaceNodeTech(uGUI_CraftNode node)
        {
            if (node.action != TreeAction.Craft)
            {
                return;
            }

            if (!node.techType0.ToString().StartsWith("Defabricated") && RecyclingData.TryGet(node.techType0, out TechType recyclingTech))
            {
                node.techType0 = recyclingTech;
            }
            else if (node.techType0.ToString().StartsWith("Defabricated"))
            {
                TechTypeExtensions.FromString(node.techType0.ToString().Replace("Defabricated", ""), out TechType original, true);
                node.techType0 = original;
            }
            else
            {
                ErrorMessage.AddMessage($"Failed to change {node.techType0}");
            }
        }
Exemplo n.º 15
0
        private void CloneTopLevelModTab(string scheme, ref Dictionary <string, string> languageLines, ref Dictionary <string, Sprite> group)
        {
            string clonedLangKey = string.Format(DisplayNameFormat, AioFabScheme, scheme);

            if (!languageLines.ContainsKey(clonedLangKey) && languageLines.TryGetValue(scheme, out string origString))
            {
                LanguageHandler.SetLanguageLine(clonedLangKey, origString);
                languageLines[clonedLangKey] = origString;
            }
            else
            {
                Console.WriteLine($"[AIOFabricator][WARN] Problem cloning language line for '{scheme}:root'{Environment.NewLine}Language resource not found");
            }

            string clonedSpriteKey = string.Format(TabSpriteFormat, AioFabScheme, scheme);

            if (TechTypeExtensions.FromString(scheme, out TechType techType, true))
            {
                var rootSprite = SpriteManager.Get(techType);
                SpriteHandler.RegisterSprite(SpriteManager.Group.Category, clonedSpriteKey, rootSprite);
                group[clonedSpriteKey] = rootSprite;
            }
Exemplo n.º 16
0
        public static void OnGameStart()
        {
            LoadConfig();

            warpCannonTechType  = TechTypePatcher.AddTechType(WARP_CANNON_CLASS_ID, "Warp Cannon", "A tool that allows you to warp 30 meters using Warper technology.");
            warpScalesTechType  = TechTypePatcher.AddTechType(WARP_SCALE_CLASS_ID, "Warp Scale", "A resource obtained from warpers that can be used to craft Warp Batteries.");
            warpBatteryTechType = TechTypePatcher.AddTechType(WARP_BATTERY_CLASS_ID, "Warp Battery", "A battery that powers Warp Cannons.");

            customTechTypes.Add(WARP_CANNON_CLASS_ID, warpCannonTechType);
            customTechTypes.Add(WARP_BATTERY_CLASS_ID, warpBatteryTechType);
            customTechTypes.Add(WARP_SCALE_CLASS_ID, warpScalesTechType);

            var warpCannonData  = new TechDataHelper();
            var warpBatteryData = new TechDataHelper();

            foreach (var techType in IngredientsConfig)
            {
                if (techType.Key == "WarpCannon")
                {
                    warpCannonData._craftAmount = techType.Value.CraftAmount;
                    warpCannonData._techType    = warpCannonTechType;
                    warpCannonData._ingredients = new List <IngredientHelper>();

                    foreach (var ingredient in techType.Value.Ingredients)
                    {
                        var ingredientTech = default(TechType);
                        if (TechTypeExtensions.FromString(ingredient.ItemName, out ingredientTech, false))
                        {
                            warpCannonData._ingredients.Add(new IngredientHelper(ingredientTech, ingredient.Amount));
                        }
                        else if (customTechTypes.TryGetValue(ingredient.ItemName, out ingredientTech))
                        {
                            warpCannonData._ingredients.Add(new IngredientHelper(ingredientTech, ingredient.Amount));
                        }
                    }
                }

                if (techType.Key == "WarpBattery")
                {
                    warpBatteryData._craftAmount = techType.Value.CraftAmount;
                    warpBatteryData._techType    = warpBatteryTechType;
                    warpBatteryData._ingredients = new List <IngredientHelper>();


                    foreach (var ingredient in techType.Value.Ingredients)
                    {
                        var ingredientTech = default(TechType);
                        if (TechTypeExtensions.FromString(ingredient.ItemName, out ingredientTech, false))
                        {
                            warpBatteryData._ingredients.Add(new IngredientHelper(ingredientTech, ingredient.Amount));
                        }
                        else if (customTechTypes.TryGetValue(ingredient.ItemName, out ingredientTech))
                        {
                            warpBatteryData._ingredients.Add(new IngredientHelper(ingredientTech, ingredient.Amount));
                        }
                    }
                }
            }

            CraftDataPatcher.customTechData.Add(warpCannonTechType, warpCannonData);
            CraftDataPatcher.customTechData.Add(warpBatteryTechType, warpBatteryData);

            CraftDataPatcher.customEquipmentTypes.Add(warpCannonTechType, EquipmentType.Hand);
            CraftDataPatcher.customItemSizes.Add(warpCannonTechType, new Vector2int(2, 2));
            CraftDataPatcher.customHarvestTypeList.Add(TechType.Warper, HarvestType.DamageAlive);
            CraftDataPatcher.customHarvestOutputList.Add(TechType.Warper, warpScalesTechType);

            CraftTreePatcher.customCraftNodes.Add("Personal/Tools/WarpCannon", warpCannonTechType);
            CraftTreePatcher.customCraftNodes.Add("Resources/Electronics/WarpBattery", warpBatteryTechType);

            // Load AssetBundle
            AssetBundle = AssetBundle.LoadFromFile(Path.Combine("./QMods/WarpCannon/", "warpcannon.assets"));
            if (AssetBundle == null)
            {
                return;
            }

            // Load GameObjects

            // Load Battery
            var warpCannonBattery = AssetBundle.LoadAsset <GameObject>("WarpBattery") as GameObject;

            Utility.AddBasicComponents(ref warpCannonBattery, "WarpBattery");
            warpCannonBattery.AddComponent <Pickupable>();
            warpCannonBattery.AddComponent <Battery>();
            warpCannonBattery.AddComponent <TechTag>().type = warpBatteryTechType;

            CustomPrefabHandler.customPrefabs.Add(new CustomPrefab("WarpBattery", "WorldEntities/Tools/WarpBattery", warpCannonBattery, warpBatteryTechType));

            // Load Warp Cannon
            var warpCannon = AssetBundle.LoadAsset <GameObject>("WarpCannon");

            Utility.AddBasicComponents(ref warpCannon, WARP_CANNON_CLASS_ID);
            warpCannon.AddComponent <Pickupable>();
            warpCannon.AddComponent <TechTag>().type = warpCannonTechType;

            var fabricating = warpCannon.FindChild("3rd person model").AddComponent <VFXFabricating>();

            fabricating.localMinY   = -0.4f;
            fabricating.localMaxY   = 0.2f;
            fabricating.posOffset   = new Vector3(-0.054f, 0.223f, -0.06f);
            fabricating.eulerOffset = new Vector3(-44.86f, 90f, 0f);
            fabricating.scaleFactor = 1;

            var energyMixin = warpCannon.AddComponent <EnergyMixin>();

            energyMixin.defaultBattery      = warpBatteryTechType;
            energyMixin.storageRoot         = warpCannon.FindChild("3rd person model").AddComponent <ChildObjectIdentifier>();
            energyMixin.compatibleBatteries = new List <TechType> {
                warpBatteryTechType
            };
            energyMixin.allowBatteryReplacement = true;
            energyMixin.batteryModels           = (new List <EnergyMixin.BatteryModels>()
            {
                new EnergyMixin.BatteryModels()
                {
                    techType = warpBatteryTechType,
                    model = warpCannonBattery
                }
            }).ToArray();

            var warpCannonComponent = warpCannon.AddComponent <WarpCannon>();

            warpCannonComponent.Init();
            warpCannonComponent.mainCollider             = warpCannon.AddComponent <BoxCollider>();
            warpCannonComponent.ikAimRightArm            = true;
            warpCannonComponent.useLeftAimTargetOnPlayer = true;

            CustomPrefabHandler.customPrefabs.Add(new CustomPrefab(WARP_CANNON_CLASS_ID, "WorldEntities/Tools/WarpCannon", warpCannon, warpCannonTechType));

            // Load Sprites
            var warpCannonSprite  = AssetBundle.LoadAsset <Sprite>("Warp_Cannon");
            var warpScalesSprite  = AssetBundle.LoadAsset <Sprite>("Warp_Scale");
            var warpBatterySprite = AssetBundle.LoadAsset <Sprite>("Warp_Battery");

            CustomSpriteHandler.customSprites.Add(new CustomSprite(warpCannonTechType, warpCannonSprite));
            CustomSpriteHandler.customSprites.Add(new CustomSprite(warpScalesTechType, warpScalesSprite));
            CustomSpriteHandler.customSprites.Add(new CustomSprite(warpBatteryTechType, warpBatterySprite));
        }
Exemplo n.º 17
0
 public static TechType GetTechType(string value)
 {
     if (TechTypeExtensions.FromString(value, out TechType tType, true))
     {
         return(tType);
     }
Exemplo n.º 18
0
        // Loads configuration from Config.txt file.
        public static void LoadConfiguration()
        {
            // Get config file path
            string     codeBase       = Assembly.GetExecutingAssembly().CodeBase;
            UriBuilder uri            = new UriBuilder(codeBase);
            string     path           = Uri.UnescapeDataString(uri.Path);
            string     currentDir     = Path.GetDirectoryName(path);
            string     configFilePath = currentDir + "/Config.txt";

            Logger.Log("Loading configuration from \"" + configFilePath + "\"...");

            // Retrieve config
            if (File.Exists(configFilePath))
            {
                string   configFile  = File.ReadAllText(configFilePath);
                string[] configLines = configFile.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                foreach (string configStr in configLines)
                {
                    if (!configStr.StartsWith("#") && configStr.Contains("="))
                    {
                        string[] configElem = configStr.Split("=".ToCharArray(), StringSplitOptions.None);
                        if (configElem != null && configElem.Length == 2)
                        {
                            string configKey      = configElem[0].Trim();
                            string configValueStr = configElem[1].Trim();
                            bool   configValue    = (configValueStr.CompareTo("true") == 0);

                            switch (configKey)
                            {
                            case "enablePlaceItems":
                                ConfigSwitcher.EnablePlaceItems = configValue; break;

                            case "enablePlaceBatteries":
                                ConfigSwitcher.EnablePlaceBatteries = configValue; break;

                            case "enableSpecialItems":
                                ConfigSwitcher.EnableSpecialItems = configValue; break;

                            case "enableNutrientBlock":
                                ConfigSwitcher.EnableNutrientBlock = configValue; break;

                            case "asBuildable_SpecimenAnalyzer":
                                ConfigSwitcher.SpecimenAnalyzer_asBuildable = configValue; break;

                            case "asBuildable_MarkiplierDoll1":
                                ConfigSwitcher.MarkiDoll1_asBuildable = configValue; break;

                            case "asBuildable_MarkiplierDoll2":
                                ConfigSwitcher.MarkiDoll2_asBuildable = configValue; break;

                            case "asBuildable_JackSepticEyeDoll":
                                ConfigSwitcher.JackSepticEye_asBuildable = configValue; break;

                            case "asBuildable_EatMyDictionDoll":
                                ConfigSwitcher.EatMyDiction_asBuidable = configValue; break;

                            case "asBuildable_ForkliftToy":
                                ConfigSwitcher.Forklift_asBuidable = configValue; break;

                            case "asBuildable_SofaSmall":
                                ConfigSwitcher.SofaStr1_asBuidable = configValue; break;

                            case "asBuildable_SofaMedium":
                                ConfigSwitcher.SofaStr2_asBuidable = configValue; break;

                            case "asBuildable_SofaBig":
                                ConfigSwitcher.SofaStr3_asBuidable = configValue; break;

                            case "asBuildable_SofaCorner":
                                ConfigSwitcher.SofaCorner2_asBuidable = configValue; break;

                            case "asBuildable_LabCart":
                                ConfigSwitcher.LabCart_asBuildable = configValue; break;

                            case "asBuildable_EmptyDesk":
                                ConfigSwitcher.EmptyDesk_asBuildable = configValue; break;

                            case "flora_RecipiesResource":
                                TechType tmpresource = TechType.None;
                                if (TechTypeExtensions.FromString(configValueStr, out tmpresource, true) && tmpresource != TechType.None)
                                {
                                    ConfigSwitcher.FloraRecipiesResource = tmpresource;
                                }
                                else
                                {
                                    Logger.Log("Warning: \"" + configValueStr + "\" is not a valid resource type for flora recipies. Default resource will be set.");
                                }
                                break;

                            case "config_LandTree":
                                GetFloraConfig(ConfigSwitcher.config_LandTree1, configValueStr); break;

                            case "config_JungleTreeA":
                                GetFloraConfig(ConfigSwitcher.config_JungleTree1, configValueStr); break;

                            case "config_JungleTreeB":
                                GetFloraConfig(ConfigSwitcher.config_JungleTree2, configValueStr); break;

                            case "config_TropicalTreeA":
                                GetFloraConfig(ConfigSwitcher.config_TropicalTreeA, configValueStr); break;

                            case "config_TropicalTreeB":
                                GetFloraConfig(ConfigSwitcher.config_TropicalTreeB, configValueStr); break;

                            case "config_TropicalTreeC":
                                GetFloraConfig(ConfigSwitcher.config_TropicalTreeC, configValueStr); break;

                            case "config_TropicalTreeD":
                                GetFloraConfig(ConfigSwitcher.config_TropicalTreeD, configValueStr); break;

                            case "config_LandPlantRedA":
                                GetFloraConfig(ConfigSwitcher.config_LandPlant1, configValueStr); break;

                            case "config_LandPlantRedB":
                                GetFloraConfig(ConfigSwitcher.config_LandPlant2, configValueStr); break;

                            case "config_LandPlantA":
                                GetFloraConfig(ConfigSwitcher.config_LandPlant3, configValueStr); break;

                            case "config_LandPlantB":
                                GetFloraConfig(ConfigSwitcher.config_LandPlant4, configValueStr); break;

                            case "config_LandPlantC":
                                GetFloraConfig(ConfigSwitcher.config_LandPlant5, configValueStr); break;

                            case "config_FernA":
                                GetFloraConfig(ConfigSwitcher.config_Fern2, configValueStr); break;

                            case "config_FernB":
                                GetFloraConfig(ConfigSwitcher.config_Fern4, configValueStr); break;

                            case "config_TropicalPlantA":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantA, configValueStr); break;

                            case "config_TropicalPlantB":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantB, configValueStr); break;

                            case "config_TropicalPlantC":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantC, configValueStr); break;

                            case "config_TropicalPlantD":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantD, configValueStr); break;

                            case "config_TropicalPlantE":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantE, configValueStr); break;

                            case "config_TropicalPlantF":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantF, configValueStr); break;

                            case "config_TropicalPlantG":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantG, configValueStr); break;

                            case "config_TropicalPlantH":
                                GetFloraConfig(ConfigSwitcher.config_TropicalPlantH, configValueStr); break;

                            case "config_CrabClawKelpA":
                                GetFloraConfig(ConfigSwitcher.config_CrabClawKelp2, configValueStr); break;

                            case "config_CrabClawKelpB":
                                GetFloraConfig(ConfigSwitcher.config_CrabClawKelp1, configValueStr); break;

                            case "config_CrabClawKelpC":
                                GetFloraConfig(ConfigSwitcher.config_CrabClawKelp3, configValueStr); break;

                            case "config_PyroCoralA":
                                GetFloraConfig(ConfigSwitcher.config_PyroCoral1, configValueStr); break;

                            case "config_PyroCoralB":
                                GetFloraConfig(ConfigSwitcher.config_PyroCoral2, configValueStr); break;

                            case "config_PyroCoralC":
                                GetFloraConfig(ConfigSwitcher.config_PyroCoral3, configValueStr); break;

                            case "config_CoveTree":
                                GetFloraConfig(ConfigSwitcher.config_CoveTree1, configValueStr); break;

                            case "config_SpottedReedsA":
                                GetFloraConfig(ConfigSwitcher.config_GreenReeds1, configValueStr); break;

                            case "config_SpottedReedsB":
                                GetFloraConfig(ConfigSwitcher.config_GreenReeds6, configValueStr); break;

                            case "config_BrineLily":
                                GetFloraConfig(ConfigSwitcher.config_LostRiverPlant2, configValueStr); break;

                            case "config_LostRiverPlant":
                                GetFloraConfig(ConfigSwitcher.config_LostRiverPlant4, configValueStr); break;

                            case "config_CoralReefPlantMiddle":
                                GetFloraConfig(ConfigSwitcher.config_PlantMiddle11, configValueStr); break;

                            case "config_SmallMushroomsDeco":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco3, configValueStr); break;

                            case "config_FloatingStone":
                                GetFloraConfig(ConfigSwitcher.config_FloatingStone1, configValueStr); break;

                            case "config_BrownCoralTubesA":
                                GetFloraConfig(ConfigSwitcher.config_BrownCoralTubes1, configValueStr); break;

                            case "config_BrownCoralTubesB":
                                GetFloraConfig(ConfigSwitcher.config_BrownCoralTubes2, configValueStr); break;

                            case "config_BrownCoralTubesC":
                                GetFloraConfig(ConfigSwitcher.config_BrownCoralTubes3, configValueStr); break;

                            case "config_BlueCoralTubes":
                                GetFloraConfig(ConfigSwitcher.config_BlueCoralTubes1, configValueStr); break;

                            case "config_PurplePinecone":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco10, configValueStr); break;

                            case "config_CoralPlantYellow":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco11, configValueStr); break;

                            case "config_CoralPlantGreen":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco13, configValueStr); break;

                            case "config_CoralPlantBlue":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco14, configValueStr); break;

                            case "config_CoralPlantRed":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco15Red, configValueStr); break;

                            case "config_CoralPlantPurple":
                                GetFloraConfig(ConfigSwitcher.config_SmallDeco17Purple, configValueStr); break;

                            case "addRegularAirSeeds":
                                ConfigSwitcher.EnableRegularAirSeeds = configValue; break;

                            case "addRegularWaterSeeds":
                                ConfigSwitcher.EnableRegularWaterSeeds = configValue; break;

                            case "GhostLeviatan_enable":
                                GhostLeviatan_enable = configValue; break;

                            case "GhostLeviatan_maxSpawns":
                                int.TryParse(configValueStr, out ConfigSwitcher.GhostLeviatan_maxSpawns); break;

                            case "GhostLeviatan_timeBeforeFirstSpawn":
                                float.TryParse(configValueStr, out ConfigSwitcher.GhostLeviatan_timeBeforeFirstSpawn); break;

                            case "GhostLeviatan_spawnTimeRatio":
                                float.TryParse(configValueStr, out ConfigSwitcher.GhostLeviatan_spawnTimeRatio); break;

                            case "GhostLeviatan_health":
                                float.TryParse(configValueStr, out ConfigSwitcher.GhostLeviatan_health); break;

                            case "language":
                                if (configValueStr.CompareTo("fr") == 0)
                                {
                                    LanguageHelper.UserLanguage = RegionHelper.CountryCode.FR;
                                }
                                else if (configValueStr.CompareTo("es") == 0)
                                {
                                    LanguageHelper.UserLanguage = RegionHelper.CountryCode.ES;
                                }
                                else if (configValueStr.CompareTo("tr") == 0)
                                {
                                    LanguageHelper.UserLanguage = RegionHelper.CountryCode.TR;
                                }
                                else if (configValueStr.CompareTo("en") == 0)
                                {
                                    LanguageHelper.UserLanguage = RegionHelper.CountryCode.EN;
                                }
                                // else, do nothing (uses default language from Windows current Culture)
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
            else
            {
                Logger.Log("Warning: Cannot find config file. Default options will be set.");
            }
        }