Exemplo n.º 1
0
        override protected void Initialize()
        {
            _campingSpots           = CreateSetting(nameof(_campingSpots), (CampingSpots) ~0);
            _butterfliesSpawnChance = CreateSetting(nameof(_butterfliesSpawnChance), 100, IntRange(0, 100));
            _butterfliesRadius      = CreateSetting(nameof(_butterfliesRadius), 25, IntRange(5, 50));
            _campingActivities      = CreateSetting(nameof(_campingActivities), (CampingActivities) ~0);

            _campingSpots.AddEvent(() =>
            {
                if (_campingSpots.Value.HasFlag(CampingSpots.OpenRegions))
                {
                    _campingSpots.SetSilently(_campingSpots.Value | CampingSpots.Butterflies);
                }
            });

            AddEventOnConfigClosed(SetButterfliesRadius);

            _safeZoneColliders = new List <SphereCollider>();
        }
Exemplo n.º 2
0
        static private void LoadChosenPreset(List <AMod> mods)
        {
            Preset preset = NameToPreset(_presetToLoad);

            if (preset == Preset.ResetToDefaults)
            {
                foreach (var mod in mods)
                {
                    mod.ResetSettings(true);
                }
            }
            else
            {
                foreach (var mod in mods)
                {
                    mod.LoadPreset(preset);
                }
            }

            _presetToLoad.SetSilently(PresetToName(Preset.None));
        }
Exemplo n.º 3
0
 private void ResetApplySilently()
 => _mainToggle.SetSilently(_mainToggle & ~Toggles.Apply);