Skip to content

Commit

Permalink
style(Studio): Use "string" instead of "var" and raw multiline-string
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Sep 10, 2024
1 parent 3a7d017 commit 40ac99d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions CelesteTAS-EverestInterop/EverestInterop/StudioHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<None>";
if (!File.Exists(VersionFile) || (installedVersion = File.ReadAllText(VersionFile)) != CurrentStudioVersion) {
Expand Down Expand Up @@ -138,9 +138,9 @@ private static void Load() {
} else {
installed = true;
}
#else
installed = true;
#endif
// #else
// installed = true;
// #endif
}

[Initialize]
Expand Down
9 changes: 6 additions & 3 deletions Studio/CelesteStudio/Studio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -305,19 +305,22 @@ 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;
}

return 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;

Expand Down

0 comments on commit 40ac99d

Please sign in to comment.