private void Initialize() { UpdateMePlugin.Instance = this; this._init = true; if (!this._config.Data.Enabled) { UpdateMePlugin.Log.Warn("UpdateMe is disabled!"); return; } UpdateMePlugin.Log.Warn("UpdateMe initialized."); this._logic = new MainLogic(); }
public override void Init(ITorchBase torch) { base.Init(torch); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); UpdateMePlugin.Log.Warn("Loading UpdateMe config."); bool initializeConfig = !File.Exists(Path.Combine(base.StoragePath, "UpdateMe.cfg")); this._config = Persistent <UpdateMePluginConfig> .Load(Path.Combine(base.StoragePath, "UpdateMe.cfg"), true); if (initializeConfig) { this._config.Data.Enabled = true; this._config.Data.LogEnabled = true; this._config.Data.RestartForNewTorchVersion = true; this._config.Data.MessageForNewTorchVersion = "A new Torch version has been found!"; this._config.Data.RestartForNewDSVersion = true; this._config.Data.MessageForNewDSVersion = "A new Space Engineers DS version has been found!"; this._config.Data.RestartInMinutes = 2; this._config.Data.CheckFrequencyInMinutes = 5; } this._config.Save(); this._config.Data.SetLoaded(this); UpdateMePlugin.Log.Debug("UpdateMe config loaded."); /* * try * { * GameVersion = new MyVersion(MyPerGameSettings.BasicGameInfo.GameVersion.Value); * } * catch (Exception ex) * { * Util.Log(string.Concat("UpdateMe catched an exception! - MyVersion", ex, ex.StackTrace)); * } */ myTimer = new Timer(); myTimer.Enabled = false; UpdateMePlugin.Instance = this; }
public void SetLoaded(UpdateMePlugin core) { }