示例#1
0
        override protected void Initialize()
        {
            _areasToggle                      = CreateSetting(nameof(_areasToggle), false);
            _areasMode                        = CreateSetting(nameof(_areasMode), ResetMode.Timer);
            _areasTimer                       = CreateSetting(nameof(_areasTimer), AREAS_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(0, 100));
            _areasTimerSinceReset             = CreateSetting(nameof(_areasTimerSinceReset), AREAS_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(0, 100));
            _areasResetLayers                 = CreateSetting(nameof(_areasResetLayers), (AreasResetLayers)((1 << 8) - 1));
            _fixUnarmedBandits                = CreateSetting(nameof(_fixUnarmedBandits), WeaponSet.Disabled);
            _fixUnarmedBanditsDurabilityRatio = CreateSetting(nameof(_fixUnarmedBanditsDurabilityRatio), 100, IntRange(0, 100));

            _gatherablesToggle = CreateSetting(nameof(_gatherablesToggle), false);
            _gatheringMode     = CreateSetting(nameof(_gatheringMode), ResetMode.Timer);
            _gatheringTimer    = CreateSetting(nameof(_gatheringTimer), PICKUP_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(1, 100));
            _miningMode        = CreateSetting(nameof(_miningMode), ResetMode.Timer);
            _miningTimer       = CreateSetting(nameof(_miningTimer), PICKUP_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(1, 100));
            _fishingMode       = CreateSetting(nameof(_fishingMode), ResetMode.Timer);
            _fishingTimer      = CreateSetting(nameof(_fishingTimer), FISHING_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(1, 100));

            _merchantsToggle = CreateSetting(nameof(_merchantsToggle), false);
            _merchantsMode   = CreateSetting(nameof(_merchantsMode), ResetMode.Timer);
            _merchantsTimer  = CreateSetting(nameof(_merchantsTimer), MERCHANTS_RESET_HOURS.Div(TIME_UNIT).Round(), IntRange(1, 100));

            _areasTimer.AddEvent(() => _areasTimerSinceReset.Value = _areasTimerSinceReset.Value.ClampMin(_areasTimer));
            _areasTimerSinceReset.AddEvent(() => _areasTimer.Value = _areasTimer.Value.ClampMax(_areasTimerSinceReset));
        }
示例#2
0
 private void CreateMainToggle()
 {
     _mainToggle = new ModSetting <Toggles>(SectionName, nameof(_mainToggle), Toggles.None)
     {
         SectionOverride    = SectionOverride,
         DisplayResetButton = false,
         Description        = Description,
     };
     _mainToggle.Format(ModName ?? SectionName.SplitCamelCase());
     _mainToggle.AddEvent(OnTogglesChanged);
     _previousMainToggle = _mainToggle;
 }
示例#3
0
        static private void CreateSetting(List <AMod> mods)
        {
            List <string> names = new List <string>();

            foreach (var preset in Utility.GetEnumValues <Preset>())
            {
                names.Add(PresetToName(preset));
            }

            _presetToLoad = new ModSetting <string>("", nameof(_presetToLoad), PresetToName(Preset.None), new AcceptableValueList <string>(names.ToArray()));
            _presetToLoad.Format("Load preset");
            _presetToLoad.IsAdvanced         = true;
            _presetToLoad.DisplayResetButton = false;

            _presetToLoad.AddEvent(() => LoadChosenPreset(mods));
        }
示例#4
0
        override protected void Initialize()
        {
            _trapsArmDelay      = CreateSetting(nameof(_trapsArmDelay), 0f, FloatRange(0f, 5f));
            _trapsFriendlyFire  = CreateSetting(nameof(_trapsFriendlyFire), false);
            _wireTrapDepth      = CreateSetting(nameof(_wireTrapDepth), 0.703f, FloatRange(0f, 5f));
            _pressureTrapRadius = CreateSetting(nameof(_pressureTrapRadius), 1.1f, FloatRange(0f, 5f));
            _runicTrapRadius    = CreateSetting(nameof(_runicTrapRadius), 2.5f, FloatRange(0f, 5f));

            _trapsArmDelay.AddEvent(() =>
            {
                if (_trapsArmDelay == 0)
                {
                    _trapsFriendlyFire.Value = false;
                }
            });
        }
示例#5
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>();
        }
示例#6
0
        override protected void Initialize()
        {
            _enableCheats                  = CreateSetting(nameof(_enableCheats), false);
            _enableCheatsHotkey            = CreateSetting(nameof(_enableCheatsHotkey), "");
            _skipStartupVideos             = CreateSetting(nameof(_skipStartupVideos), false);
            _armorSlotsToHide              = CreateSetting(nameof(_armorSlotsToHide), ArmorSlots.None);
            _removeCoopScaling             = CreateSetting(nameof(_removeCoopScaling), false);
            _removeDodgeInvulnerability    = CreateSetting(nameof(_removeDodgeInvulnerability), false);
            _healEnemiesOnLoad             = CreateSetting(nameof(_healEnemiesOnLoad), false);
            _multiplicativeStacking        = CreateSetting(nameof(_multiplicativeStacking), false);
            _armorTrainingPenaltyReduction = CreateSetting(nameof(_armorTrainingPenaltyReduction), 50, IntRange(0, 100));
            _applyArmorTrainingToManaCost  = CreateSetting(nameof(_applyArmorTrainingToManaCost), false);
            _loadArrowsFromInventory       = CreateSetting(nameof(_loadArrowsFromInventory), false);
            _baseStaminaRegen              = CreateSetting(nameof(_baseStaminaRegen), 2.4f, FloatRange(0, 10));
            _titleScreenRandomize          = CreateSetting(nameof(_titleScreenRandomize), (TitleScreens)0);
            _titleScreenHideCharacters     = CreateSetting(nameof(_titleScreenHideCharacters), TitleScreenCharacterVisibility.Enable);
            _craftFromStash                = CreateSetting(nameof(_craftFromStash), false);
            _displayStashAmount            = CreateSetting(nameof(_displayStashAmount), false);
            _displayPricesInStash          = CreateSetting(nameof(_displayPricesInStash), false);
            _itemActionDropOne             = CreateSetting(nameof(_displayStashAmount), false);
            _temperatureToggle             = CreateSetting(nameof(_temperatureToggle), false);
            _temperatureDataByEnum         = new Dictionary <TemperatureSteps, ModSetting <Vector2> >();
            foreach (var step in Utility.GetEnumValues <TemperatureSteps>())
            {
                if (step != TemperatureSteps.Count)
                {
                    _temperatureDataByEnum.Add(step, CreateSetting(nameof(_temperatureDataByEnum) + step, DEFAULT_TEMPERATURE_DATA_BY_ENUM[step]));
                }
            }

            _enableCheats.AddEvent(() => Global.CheatsEnabled = _enableCheats);
            AddEventOnConfigClosed(() =>
            {
                foreach (var player in Players.Local)
                {
                    UpdateBaseStaminaRegen(player.Stats);
                }
                TryUpdateTemperatureData();
            });
        }