Beispiel #1
0
 public static void CreateEquipmentCooldownOption(EquipmentDef equipmentDef, string section, float defaultValue)
 {
     ConfigOptions.ConfigurableValue <float> configurableValue = null;
     configurableValue = ConfigOptions.ConfigurableValue.CreateFloat(
         categoryGUID,
         categoryName,
         config,
         section,
         "Cooldown",
         defaultValue,
         0f,
         1000f,
         onChanged: (newValue) =>
     {
         if (equipmentDef)
         {
             equipmentDef.cooldown = newValue;
         }
     }
         );
 }
Beispiel #2
0
        public static void Init()
        {
            ConfigOptions.ConfigurableValue <bool> enabledByConfig = ConfigOptions.ConfigurableValue.CreateBool(
                ConfigManager.General.categoryGUID,
                ConfigManager.General.categoryName,
                ConfigManager.General.config,
                "Misc",
                "Fun Events",
                true,
                "Enable fun events that happen on specific dates",
                restartRequired: true
                );

            if (enabledByConfig)
            {
                var today = System.DateTime.Now;
                if (today.Month == 4 && today.Day == 1)
                {
                    BazaarPrank.Init();
                }
            }
        }