private void LoadSettings() { _allowMobHunting = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_allowMobHunting)}", bool.FalseString)); _skipUnrestrictedPvPZones = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipUnrestrictedPvPZones)}", bool.TrueString)); _skipKeeperPacks = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipKeeperPacks)}", bool.TrueString)); _allowSiegeCampTreasure = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_allowSiegeCampTreasure)}", bool.TrueString)); _skipRedAndBlackZones = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipRedAndBlackZones)}", bool.TrueString)); _keeperSkipRange = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_keeperSkipRange)}", 22); _minimumHealthForGathering = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_minimumHealthForGathering)}", 0.8f); _percentageForBanking = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_percentageForBanking)}", 99f); _percentageForSiegeCampTreasure = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_percentageForSiegeCampTreasure)}", 33f); _selectedGatherCluster = PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_selectedGatherCluster)}", null); _selectedTownClusterIndex = PlayerPrefs.GetInt($"{_prefsIdentifier}{nameof(_selectedTownClusterIndex)}", 0); _selectedMininumTierIndex = PlayerPrefs.GetInt($"{_prefsIdentifier}{nameof(_selectedMininumTierIndex)}", 0); _gatherInformations = new Dictionary <GatherInformation, bool>(); foreach (var resourceType in Enum.GetValues(typeof(Albion_Direct.ResourceType)).Cast <Albion_Direct.ResourceType>()) { foreach (var tier in Enum.GetValues(typeof(Albion_Direct.Tier)).Cast <Albion_Direct.Tier>()) { foreach (var enchantment in Enum.GetValues(typeof(Albion_Direct.EnchantmentLevel)).Cast <Albion_Direct.EnchantmentLevel>()) { if ((tier < Albion_Direct.Tier.IV || resourceType == Albion_Direct.ResourceType.Rock) && enchantment != Albion_Direct.EnchantmentLevel.White) { continue; } var info = new GatherInformation(resourceType, tier, enchantment); var val = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{info.ToString()}", (tier >= Albion_Direct.Tier.II).ToString())); _gatherInformations.Add(info, val); } } } }
private void LoadSettings() { _allowMobHunting = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_allowMobHunting)}", bool.FalseString)); _skipUnrestrictedPvPZones = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipUnrestrictedPvPZones)}", bool.TrueString)); _skipKeeperPacks = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipKeeperPacks)}", bool.TrueString)); _allowSiegeCampTreasure = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_allowSiegeCampTreasure)}", bool.TrueString)); _skipRedAndBlackZones = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_skipRedAndBlackZones)}", bool.TrueString)); _keeperSkipRange = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_keeperSkipRange)}", 22); _minimumHealthForGathering = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_minimumHealthForGathering)}", 0.8f); _percentageForBanking = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_percentageForBanking)}", 99f); _percentageForSiegeCampTreasure = PlayerPrefs.GetFloat($"{_prefsIdentifier}{nameof(_percentageForSiegeCampTreasure)}", 33f); _selectedGatherCluster = PlayerPrefs.GetString($"{_prefsIdentifier}{nameof(_selectedGatherCluster)}", null); _selectedTownClusterIndex = PlayerPrefs.GetInt($"{_prefsIdentifier}{nameof(_selectedTownClusterIndex)}", 0); _selectedMininumTierIndex = PlayerPrefs.GetInt($"{_prefsIdentifier}{nameof(_selectedMininumTierIndex)}", 0); _selectedCraftCluster = PlayerPrefs.GetString($"{_craftPrefsIdentifier}{nameof(_selectedCraftCluster)}", null); _selectedCraftTownClusterIndex = PlayerPrefs.GetInt($"{_craftPrefsIdentifier}{nameof(_selectedCraftTownClusterIndex)}", 0); _gatherInformations = new Dictionary <GatherInformation, bool>(); foreach (var resourceType in Enum.GetValues(typeof(ResourceType)).Cast <ResourceType>()) { foreach (var tier in Enum.GetValues(typeof(Tier)).Cast <Tier>()) { foreach (var enchantment in Enum.GetValues(typeof(EnchantmentLevel)).Cast <EnchantmentLevel>()) { if ((tier < Tier.IV || resourceType == ResourceType.Rock) && enchantment != EnchantmentLevel.White) { continue; } var info = new GatherInformation(resourceType, tier, enchantment); var val = bool.Parse(PlayerPrefs.GetString($"{_prefsIdentifier}{info.ToString()}", (tier >= Tier.II).ToString())); _gatherInformations.Add(info, val); } } } // foreach (var processedResourceType in Enum.GetValues(typeof(ProcessedResourceType)).Cast<ProcessedResourceType>) _toCraftListCount = PlayerPrefs.GetInt($"{_craftPrefsIdentifier}_toCraftListLength", 0); Core.Log($"Loading to craft list Settings {_toCraftListCount}"); if (_toCraftListCount > 0) { for (int i = 0; i < _toCraftListCount; i++) { string S = PlayerPrefs.GetString($"{_craftPrefsIdentifier}{i}_1", null); int I = PlayerPrefs.GetInt($"{_craftPrefsIdentifier}{i}_2", -1); Core.Log($"{S}{I}"); Tuple <string, int> T = new Tuple <string, int>(S, I); toCraftList.Add(T); } } }