Example #1
0
        ////////////////

        internal bool UpdateToLatestVersion()
        {
            var mymod     = ModHelpersMod.Instance;
            var newConfig = new HamstarHelpersConfigData();
            var versSince = this.VersionSinceUpdate != "" ?
                            new Version(this.VersionSinceUpdate) :
                            new Version();

            if (versSince >= mymod.Version)
            {
                return(false);
            }

            if (versSince < new Version(4, 3, 0))
            {
                this.DebugModeHelpersInfo = false;
            }
            if (versSince < new Version(4, 4, 0))
            {
                this.ModIssueReportErrorLogMaxLines = newConfig.ModIssueReportErrorLogMaxLines;
            }

            this.VersionSinceUpdate = mymod.Version.ToString();

            return(true);
        }
Example #2
0
        ////////////////

        internal void LoadFromNetwork(HamstarHelpersMod mymod, HamstarHelpersConfigData config)
        {
            var myplayer = Main.LocalPlayer.GetModPlayer <HamstarHelpersPlayer>();

            mymod.ConfigJson.SetData(config);

            myplayer.Logic.FinishModSettingsSync();
        }
Example #3
0
        ////////////////

        internal void LoadFromNetwork(HamstarHelpersConfigData config)
        {
            var mymod    = ModHelpersMod.Instance;
            var myplayer = (ModHelpersPlayer)TmlHelpers.SafelyGetModPlayer(Main.LocalPlayer, ModHelpersMod.Instance, "ModHelpersPlayer");

            mymod.ConfigJson.SetData(config);

            myplayer.Logic.FinishModSettingsSyncOnClient();
        }
Example #4
0
        public static void ResetConfigFromDefaults()
        {
            if (Main.netMode != 0)
            {
                throw new HamstarException("Cannot reset to default configs outside of single player.");
            }

            var configData = new HamstarHelpersConfigData();

            //configData.SetDefaults();

            ModHelpersMod.Instance.ConfigJson.SetData(configData);
            ModHelpersMod.Instance.ConfigJson.SaveFile();
        }
Example #5
0
        ////////////////

        public bool UpdateToLatestVersion()
        {
            var new_config = new HamstarHelpersConfigData();
            var vers_since = this.VersionSinceUpdate != "" ?
                             new Version(this.VersionSinceUpdate) :
                             new Version();

            if (vers_since >= HamstarHelpersConfigData.ConfigVersion)
            {
                return(false);
            }
            if (vers_since < new Version(1, 4, 2, 1))
            {
                this.UseCustomLoggingPerNetMode = this.UseCustomModeLogging;
            }
            if (vers_since < new Version(1, 4, 2, 3))
            {
                this.IsServerPromptingForBrowser = true;
            }

            this.VersionSinceUpdate = HamstarHelpersConfigData.ConfigVersion.ToString();

            return(true);
        }