From 40ac99ddc72c7c048db0bb274930648cb0fb82cf Mon Sep 17 00:00:00 2001 From: psyGamer Date: Sun, 8 Sep 2024 10:40:55 +0200 Subject: [PATCH] style(Studio): Use "string" instead of "var" and raw multiline-string --- CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs | 8 ++++---- Studio/CelesteStudio/Studio.cs | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs b/CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs index cb3207441..f008a0bae 100644 --- a/CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs +++ b/CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs @@ -84,7 +84,7 @@ private static string Checksum { [Load] private static void Load() { // INSTALL_STUDIO is only set during builds from Build.yml/Release.yml, since otherwise the URLs / checksums are invalid -#if INSTALL_STUDIO +// #if INSTALL_STUDIO // Check if studio is already up-to-date string installedVersion = ""; if (!File.Exists(VersionFile) || (installedVersion = File.ReadAllText(VersionFile)) != CurrentStudioVersion) { @@ -138,9 +138,9 @@ private static void Load() { } else { installed = true; } -#else - installed = true; -#endif +// #else +// installed = true; +// #endif } [Initialize] diff --git a/Studio/CelesteStudio/Studio.cs b/Studio/CelesteStudio/Studio.cs index 81b9ab27c..ff74db772 100644 --- a/Studio/CelesteStudio/Studio.cs +++ b/Studio/CelesteStudio/Studio.cs @@ -305,7 +305,10 @@ protected override void OnClosing(CancelEventArgs e) { private bool ShouldDiscardChanges(bool checkTempFile = true) { if (Editor.Document.Dirty || checkTempFile && Editor.Document.FilePath == Document.ScratchFile) { - var confirm = MessageBox.Show($"You have unsaved changes.{Environment.NewLine}Are you sure you want to discard them?", MessageBoxButtons.YesNo, MessageBoxType.Question, MessageBoxDefaultButton.No); + var confirm = MessageBox.Show(""" + You have unsaved changes. + Are you sure you want to discard them? + """, MessageBoxButtons.YesNo, MessageBoxType.Question, MessageBoxDefaultButton.No); return confirm == DialogResult.Yes; } @@ -313,11 +316,11 @@ private bool ShouldDiscardChanges(bool checkTempFile = true) { } private string GetFilePickerDirectory() { - var fallbackDir = string.IsNullOrWhiteSpace(Settings.Instance.LastSaveDirectory) + string fallbackDir = string.IsNullOrWhiteSpace(Settings.Instance.LastSaveDirectory) ? Path.Combine(CelesteDirectory ?? string.Empty, "TAS Files") : Settings.Instance.LastSaveDirectory; - var dir = Editor.Document.FilePath == Document.ScratchFile + string dir = Editor.Document.FilePath == Document.ScratchFile ? fallbackDir : Path.GetDirectoryName(Editor.Document.FilePath) ?? fallbackDir;