Example #1
0
 internal static void InitInLobbyConfig()
 {
     inLobbyConfigEntry = new ModConfigEntry
     {
         DisplayName = "Artifacts Randomizer",
         EnableField = ConfigFieldUtilities.CreateFromBepInExConfigEntry(Enabled) as BooleanConfigField
     };
     inLobbyConfigEntry.SectionFields["Main"] = new List <IConfigField>
     {
         new EnumConfigField <Randomization>(RandomizationMode.Definition.Key, RandomizationMode.Description.Description, () => RandomizationMode.Value, (newValue) => RandomizationMode.Value = newValue),
         new ArtifactBlacklistField(Blacklist.Definition.Key, Blacklist.Description.Description, GetBlacklistIndices, AddBlacklistIndex, RemoveBlacklistIndex)
     };
     inLobbyConfigEntry.SectionFields["Chance"] = new List <IConfigField>
     {
         new FloatConfigField(DefaultChance.Definition.Key, DefaultChance.Description.Description, () => DefaultChance.Value, null, (newValue) => DefaultChance.Value = newValue, 0, 1),
         new ArtifactChanceField(ArtifactWeights.Definition.Key, ArtifactWeights.Description.Description, GetArtifactChances, AddArtifactChance, RemoveArtifactChance, EndEditArtifactChance)
     };
     inLobbyConfigEntry.SectionFields["Weight"] = new List <IConfigField>
     {
         new IntConfigField(DefaultWeight.Definition.Key, DefaultWeight.Description.Description, () => DefaultWeight.Value, null, (newValue) => DefaultWeight.Value = newValue, 0),
         new IntConfigField(MaxCount.Definition.Key, MaxCount.Description.Description, () => MaxCount.Value, null, (newValue) => MaxCount.Value = newValue, -1),
         new IntConfigField(MinCount.Definition.Key, MinCount.Description.Description, () => MinCount.Value, null, (newValue) => MinCount.Value = newValue, 0),
         new ArtifactWeightField(ArtifactWeights.Definition.Key, ArtifactWeights.Description.Description, GetArtifactWeights, AddArtifactWeight, RemoveArtifactWeight, EndEditArtifactWeight)
     };
     ModConfigCatalog.Add(inLobbyConfigEntry);
 }
        private static void OnStartInternal()
        {
            var modConfig = new ModConfigEntry
            {
                DisplayName = "Partial Item Display",
                EnableField = ConfigFieldUtilities.CreateFromBepInExConfigEntry(PartialItemDisplayPlugin.Enabled) as BooleanConfigField,
            };

            PartialItemDisplayPlugin.DefaultSection.ApplyToInLobbyConfig(modConfig);
            foreach (var characterSection in PartialItemDisplayPlugin.CharacterSections.Values)
            {
                characterSection.ApplyToInLobbyConfig(modConfig);
            }

            ModConfigCatalog.Add(modConfig);
            ModConfig = modConfig;
        }