Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit e2c8b7c

Browse files
committed
fixed copy errors button copying old errors
1 parent cfd075c commit e2c8b7c

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

UI/MainWindow/MainWindowErrorStatus.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ private void Status_WarningButton_Clicked(object sender, RoutedEventArgs e)
4242

4343
private void Status_CopyErrorsButton_Click(object sender, RoutedEventArgs e)
4444
{
45-
if (CurrentErrorString != null)
45+
if (!string.IsNullOrEmpty(CurrentErrorString))
4646
{
4747
Clipboard.SetText(CurrentErrorString);
4848
}

UI/MainWindow/MainWindowSPCompiler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public partial class MainWindow
2222
private readonly List<string> CompiledFileNames = new();
2323
private readonly List<string> CompiledFiles = new();
2424
private readonly List<string> NonUploadedFiles = new();
25-
private List<ErrorDataGridRow> CurrentErrors = new();
26-
private List<ErrorDataGridRow> CurrentWarnings = new();
25+
private readonly List<ErrorDataGridRow> CurrentErrors = new();
26+
private readonly List<ErrorDataGridRow> CurrentWarnings = new();
2727

2828
public int TotalErrors;
2929
public int TotalWarnings;
@@ -70,6 +70,7 @@ private async void Compile_SPScripts(bool compileAll = true)
7070
var hadError = false;
7171
TotalErrors = 0;
7272
TotalWarnings = 0;
73+
CurrentErrorString = string.Empty;
7374

7475
// Searches for the spcomp.exe compiler
7576
foreach (var dir in currentConfig.SMDirectories)

UI/MainWindow/MainWindowTranslations.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public void Language_Translate(bool Initial = false)
8888
BtExpandCollapse.ToolTip = Translate(OBExpanded ? "ExpandAllDirs" : "CollapseAllDirs");
8989
BtRefreshDir.ToolTip = Translate("RefreshOB");
9090

91+
// Leaving a space at the end here because it makes the button look better
9192
Status_ErrorText.Text = $"0 {Translate("Errors")} ";
9293
Status_WarningText.Text = $"0 {Translate("Warnings")} ";
9394
Status_CopyErrorsButton.Content = Translate("CopyErrors");

0 commit comments

Comments
 (0)