static void Main() { // Global exception handler AppDomain.CurrentDomain.UnhandledException += (sender, e) => { Log.WriteLine(e.ExceptionObject.ToString()); }; // Logging string logFolder = "SpelunkyRTATrackerLogs"; Directory.CreateDirectory(logFolder); string logName = logFolder + "\\log_" + (DateTime.Now.ToString("MMddyyyy_HHmmss")) + ".txt"; StreamWriter logFile = File.CreateText(logName); logFile.AutoFlush = true; Console.SetOut(logFile); // Settings file TrackerSettings settings = TrackerSettings.Load(); settings.Save(); // Initial setup Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TrayApplicationContext(settings)); }
public void SaveSettings(Color backColor, Color formColor, Keys resetHotkey, int resetHotkeyMods, String freshSave, String gameSave, int imageSize, int rows, bool inverted) { trackerSettings.backColor = ColorTranslator.ToHtml(backColor); trackerSettings.textColor = ColorTranslator.ToHtml(formColor); trackerSettings.resetHotkey = (int)resetHotkey; trackerSettings.resetHotkeyMods = resetHotkeyMods; trackerSettings.freshSave = freshSave; trackerSettings.gameSave = gameSave; trackerSettings.imageSize = imageSize; trackerSettings.rows = rows; trackerSettings.inverted = inverted; trackerSettings.Save(); }
private void SaveSettings() { tracker.UseDefaultPath = trackerUseDefault.Checked; tracker.CustomPath = trackerCustomSavesFolder.Text; tracker.AutoDetectVersion = trackerAutoVersion.Checked; tracker.RefreshInterval = (int)trackerRefreshDelay.Value; tracker.TrySetGameVersion(trackerGameVersion.Text); tracker.Save(); main.ShowBasic = mainShowBasic.Checked; main.RenderFancyCorners = mainFancyCorners.Checked; main.RenderCompletionGlow = mainCompletionGlow.Checked; main.LayoutDebug = mainLayoutDebug.Checked; main.RainbowMode = mainTheme.Text == "Pride Mode"; main.BackColor = ToXNAColor(mainBackColor.BackColor); main.TextColor = ToXNAColor(mainTextColor.BackColor); main.BorderColor = ToXNAColor(mainBorderColor.BackColor); main.Save(); overlay.Enabled = overlayEnabled.Checked; overlay.HideCompleted = overlayHideCompleted.Checked; overlay.OnlyShowFavorites = overlayOnlyShowFavorites.Checked; overlay.ShowLabels = overlayShowText.Checked; overlay.ShowCriteria = overlayShowCriteria.Checked; overlay.ShowCounts = overlayShowCounts.Checked; overlay.ShowOverview = overlayShowOverview.Checked; overlay.Speed = overlaySpeed.Value; overlay.RightToLeft = overlayDirection.SelectedIndex == 0; overlay.Width = (int)overlayWidth.Value; overlay.BackColor = ToXNAColor(overlayBackColor.BackColor); overlay.TextColor = ToXNAColor(overlayTextColor.BackColor); overlay.Save(); notes.Enabled = notesEnabled.Checked; notes.Save(); }