My mod that uses HugsLib breaks everything

Started by Choosechee, June 01, 2024, 12:33:56 AM

Previous topic - Next topic

Choosechee

I'm trying to make a mod with mod options using HugsLib, but it gives the game a massive amount of errors and causes the game to disable it.
Here's the log: https://pastebin.com/cefa9tgb
Here's the source code (I just have the settings for now): using System;
using RimWorld;
using HugsLib;
using HugsLib.Settings;

namespace BetterTalkingHearingMatters
{
    public class BetterTalkingHearingMattersSettings : ModBase
    {
        private SettingHandle<bool> betterTalkingMatters;
        private SettingHandle<int> talkingMaxEffect;

        private SettingHandle<bool> betterHearingMatters;
        private SettingHandle<int> hearingMaxEffect;

        public BetterTalkingHearingMattersSettings()
        {
            betterTalkingMatters = Settings.GetHandle<bool>(
                "betterTalkingMatters",
                "Better talking matters",
                "Whether talking capacity above 100% increases social work quality.",
                true
            );
            talkingMaxEffect = Settings.GetHandle<int>(
                "talkingMaxEffect",
                "Talking max effect",
                "The point where further increases in talking capacity stop increasing work quality.",
                150,
                Validators.IntRangeValidator(101, 400)
            );
            talkingMaxEffect.VisibilityPredicate = () => betterTalkingMatters.Value;

            betterHearingMatters = Settings.GetHandle<bool>(
                "betterHearingMatters",
                "Better hearing matters",
                "Whether hearing capacity above 100% increases social work quality.",
                true
            );
            hearingMaxEffect = Settings.GetHandle<int>(
                "hearingMaxEffect",
                "Hearing max effect",
                "The point where further increases in hearing capacity stop increasing work quality.",
                150,
                Validators.IntRangeValidator(101, 400)
            );
            hearingMaxEffect.VisibilityPredicate = () => betterHearingMatters.Value;
        }

        public override string ModIdentifier
        {
            get { return "BetterTalkingHearingMatters"; }
        }
    }
}
And here's the mod: https://drive.google.com/file/d/10nHKCuDDCtHoNLXMopHz3rntlOQwZUHE/view?usp=drive_link

I'm sure it's something really obvious, but there's nothing that says BetterTalkingHearingMatters in the log, so I don't know what to do.

Choosechee

Needed to use .NET Framework 4.7.2 instead of .NET Core 8...