From 5b6c18dd044a90cae083cec453d361e844215607 Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Sat, 30 Nov 2024 17:10:44 -0600 Subject: [PATCH 1/2] Case insensitive game exe name checks on Windows --- GUI/Dialogs/ManageGameInstancesDialog.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI/Dialogs/ManageGameInstancesDialog.cs b/GUI/Dialogs/ManageGameInstancesDialog.cs index db477ce28..37b1f8700 100644 --- a/GUI/Dialogs/ManageGameInstancesDialog.cs +++ b/GUI/Dialogs/ManageGameInstancesDialog.cs @@ -402,7 +402,7 @@ private void InstanceFileOK(object? sender, CancelEventArgs? e) // so we have to re-enforce the filter ourselves var chosen = Path.GetFileName(dlg.FileName); var allowed = manager.AllInstanceAnchorFiles; - if (!allowed.Contains(chosen)) + if (!allowed.Contains(chosen, Platform.PathComparer)) { e.Cancel = true; user.RaiseError(Properties.Resources.ManageGameInstancesInvalidFileSelected, From f4575f3ed8b438d06c6af3ac4200308269e6a7ee Mon Sep 17 00:00:00 2001 From: Paul Hebble Date: Sat, 30 Nov 2024 17:33:25 -0600 Subject: [PATCH 2/2] Draw progress bar when ProgressBarRenderer.IsSupported is false --- GUI/Controls/LabeledProgressBar.cs | 31 +++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/GUI/Controls/LabeledProgressBar.cs b/GUI/Controls/LabeledProgressBar.cs index 846dde54f..4da6b2158 100644 --- a/GUI/Controls/LabeledProgressBar.cs +++ b/GUI/Controls/LabeledProgressBar.cs @@ -60,14 +60,31 @@ public LabeledProgressBar() protected override void OnPaint(PaintEventArgs e) { - ProgressBarRenderer.DrawHorizontalBar(e.Graphics, ClientRectangle); - ProgressBarRenderer.DrawHorizontalChunks(e.Graphics, - new Rectangle(ClientRectangle.X, - ClientRectangle.Y, - ClientRectangle.Width - * (Value - Minimum) + if (ProgressBarRenderer.IsSupported) + { + ProgressBarRenderer.DrawHorizontalBar(e.Graphics, ClientRectangle); + ProgressBarRenderer.DrawHorizontalChunks(e.Graphics, + new Rectangle(ClientRectangle.X, + ClientRectangle.Y, + ClientRectangle.Width * (Value - Minimum) + / (Maximum - Minimum), + ClientRectangle.Height)); + } + else + { + const int borderWidth = 1; + var innerRect = Rectangle.Inflate(ClientRectangle, -2 * borderWidth, + -2 * borderWidth); + innerRect.Offset(borderWidth, borderWidth); + e.Graphics.DrawRectangle(SystemPens.ControlDark, ClientRectangle); + e.Graphics.FillRectangle(SystemBrushes.Control, innerRect); + e.Graphics.FillRectangle(SystemBrushes.Highlight, + new Rectangle(innerRect.X, + innerRect.Y, + innerRect.Width * (Value - Minimum) / (Maximum - Minimum), - ClientRectangle.Height)); + innerRect.Height)); + } TextRenderer.DrawText(e.Graphics, Text, Font, new Point((Width - textSize.Width) / 2, (Height - textSize.Height) / 2),