internal static TournamentXPSettings GetSettingsFromModLib(bool forceDebug = false)
        {
            FileDatabase.Initialise(SettingsHelper.ModuleFolderName);
            TournamentXPSettingsModLib settings = FileDatabase.Get <TournamentXPSettingsModLib>(TournamentXPSettingsModLib.InstanceID);

            if (settings == null)
            {
                settings = new TournamentXPSettingsModLib();
            }
            SettingsDatabase.RegisterSettings(settings);
            if (forceDebug)
            {
                settings.DebugMode = true;
            }
            return(settings.GetSettings());
        }
        public static bool GetModLibSettings(bool forceDebug = false, bool forceMenu = false)
        {
            var modnames = Utilities.GetModulesNames().ToList();

            if (modnames.Contains("Bannerlord.MBOptionScreen"))
            {
                if (forceMenu)
                {
                    //Reenable ModLib settings menu option
                    Module.CurrentModule.AddInitialStateOption(new InitialStateOption("ModOptionsMenu", new TextObject("ModLib Options"), 9990, () =>
                    {
                        ScreenManager.PushScreen(new ModOptionsGauntletScreen());
                    }, false));
                }
            }

            try
            {
                FileDatabase.Initialise(SettingsHelper.ModuleFolderName);
                TournamentXPSettingsModLib settings = FileDatabase.Get <TournamentXPSettingsModLib>(TournamentXPSettingsModLib.InstanceID);
                if (settings == null)
                {
                    settings = new TournamentXPSettingsModLib();
                }
                SettingsDatabase.RegisterSettings(settings);
                if (forceDebug)
                {
                    settings.DebugMode = true;
                }
                TournamentXPSettings.SetSettings(settings.GetSettings());
            }
            catch (Exception ex)
            {
                ErrorLog.Log("TournamentsXPanded failed to initialize settings data.\n\n" + ex.ToStringFull());
                return(false);
            }
            return(true);
        }