From c426b7dcf10ce6e7bc7b0f453388c15c0bea6afa Mon Sep 17 00:00:00 2001 From: Boreal Date: Sat, 25 Jan 2025 00:49:08 -0800 Subject: [PATCH 1/2] Add Xbox One to listed pack types (#42) --- PCK-Studio/MainForm.cs | 4 ++-- PCK-Studio/MainForm.resx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 0e4cba47..04bd0b1f 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -130,7 +130,7 @@ namespace PckStudio catch (OverflowException ex) { MessageBox.Show(this, "Failed to open pck\n" + - "Try checking the 'Open/Save as Switch/Vita/PS4 pck' checkbox in the upper right corner.", + "Try checking the 'Open/Save as Switch/Vita/PS4/Xbox One pck' checkbox in the upper right corner.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Debug.WriteLine(ex.Message); } @@ -286,7 +286,7 @@ namespace PckStudio catch (OverflowException ex) { MessageBox.Show(this, "Failed to open pck\n" + - $"Try {(LittleEndianCheckBox.Checked ? "unchecking" : "checking")} the 'Open/Save as Switch/Vita/PS4 pck' check box in the upper right corner.", + $"Try {(LittleEndianCheckBox.Checked ? "unchecking" : "checking")} the 'Open/Save as Switch/Vita/PS4/Xbox One pck' check box in the upper right corner.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Debug.WriteLine(ex.Message); } diff --git a/PCK-Studio/MainForm.resx b/PCK-Studio/MainForm.resx index 53843773..7f0dec53 100644 --- a/PCK-Studio/MainForm.resx +++ b/PCK-Studio/MainForm.resx @@ -5000,7 +5000,7 @@ 21 - Open/Save as Switch/Vita/PS4 PCK + Open/Save as Switch/Vita/PS4/Xbox One PCK LittleEndianCheckBox From b61d19acccc11eaa85c67bd929597099f15b6e48 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 5 Feb 2025 19:19:36 +0100 Subject: [PATCH 2/2] PckNodeSorter - [Compare] Add safer type/null checking --- PCK-Studio/Internal/PckNodeSorter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PCK-Studio/Internal/PckNodeSorter.cs b/PCK-Studio/Internal/PckNodeSorter.cs index af2390ad..934bc1be 100644 --- a/PCK-Studio/Internal/PckNodeSorter.cs +++ b/PCK-Studio/Internal/PckNodeSorter.cs @@ -21,9 +21,9 @@ namespace PckStudio.Internal public int Compare(object x, object y) { - TreeNode tx = x as TreeNode; - TreeNode ty = y as TreeNode; - return Compare(tx, ty); + if (x is TreeNode tx && y is TreeNode ty) + return Compare(tx, ty); + return 0; } public int Compare(TreeNode x, TreeNode y)