public SettingsWindow(MySteamScanner steamscanner, string localdir, string steam, string configs) { this.myLogger = new Logger(configs); InitializeComponent(); this.SteamScanner = steamscanner; try { this.steampath = steam; this.CurrentUserSettings.Text = this.SteamScanner.GetCurrentUser(); Console.WriteLine(this.CurrentUserSettings.Text); this.userid = this.SteamScanner.GetCurrentID(); Console.WriteLine(this.userid); this.currentSave = this.SteamScanner.CurrentSave(this.CurrentUserSettings.Text); Console.WriteLine(this.currentSave); this.localPath = localdir; Console.WriteLine(this.localPath); this.steamConfigPath = Path.Combine(this.steampath, "userdata", this.userid, "287700\\local\\TPP_GRAPHICS_CONFIG"); Console.WriteLine(this.steamConfigPath); this.LoadSettings(); } catch (Exception e) { this.myLogger.LogToFile($"Error: {e}"); MessageBox.Show("Please select user first from the 'Saves' menu."); this.Close(); } }
public Launcher() { this.myLogger = new Logger(this.configFiles); this.myLogger.LogToFile("Application starting"); InitializeComponent(); Closing += LauncherClosing; this.Version.Text = this.currentVersion; //this.UpdateCheck(); try { this.localPath = File.ReadAllLines(Path.Combine(this.configFiles, "localpath.txt"))[0].Trim().Replace("\"", ""); if (Directory.Exists(this.localPath)) { this.SteamScanner = new MySteamScanner(this.localPath, this.configFiles); this.steamPath = this.SteamScanner.ScanSteam(); this.CheckSteamPath(); } else { this.myLogger.LogToFile("Local path doesn't exist."); if (this.SaveLocation()) { this.SteamScanner = new MySteamScanner(this.localPath, this.configFiles); this.steamPath = this.SteamScanner.ScanSteam(); this.CheckSteamPath(); } else { App.Current.Shutdown(); } } } catch (Exception e) { this.myLogger.LogToFile($"Local path not yet defined, {e}"); if (this.SaveLocation()) { if (!Directory.Exists(this.localPath) || (Directory.Exists(this.localPath) && Directory.GetDirectories(this.localPath).Length < 1)) { this.myLogger.LogToFile("Local directory doesn't exist, or exist but doesn't contain saves."); this.CopyOld(); } this.SteamScanner = new MySteamScanner(this.localPath, this.configFiles); this.steamPath = this.SteamScanner.ScanSteam(); this.CheckSteamPath(); } else { App.Current.Shutdown(); } } }
public MainWindow(MySteamScanner mySteamScan, string steam) { this.myLogger = new Logger(mySteamScan.configPath); InitializeComponent(); this.mySteamScan = mySteamScan; this.steampath = steam; Console.WriteLine(this.steampath); if (this.steampath == "") { MessageBox.Show("Steam not found, if you are sure it's installed and keep getting this message, please make an bug report to the GitHub project page."); this.Close(); } else { SaveManager(); } }