From d692d957d44ba96dbb41c153b2b1fb28e1ccf9aa Mon Sep 17 00:00:00 2001 From: Philip Woolford Date: Sun, 11 Sep 2022 04:08:27 +0930 Subject: [PATCH] Check for missing ExeFS or `main` executable in SWSH shiny editor (#216) * Fix Shiny Rate Editor This fixes the broken shiny rate editor that hasn't been re-implemented. * Check for missing ExeFS or `main` executable in SWSH shiny editor --- pkNX.WinForms/MainEditor/EditorSWSH.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkNX.WinForms/MainEditor/EditorSWSH.cs b/pkNX.WinForms/MainEditor/EditorSWSH.cs index cda8a7b1..7457de07 100644 --- a/pkNX.WinForms/MainEditor/EditorSWSH.cs +++ b/pkNX.WinForms/MainEditor/EditorSWSH.cs @@ -112,7 +112,17 @@ public void NotWorking_EditMoves() public void EditShinyRate() { + if (ROM.PathExeFS == null) { + WinFormsUtil.Alert("ExeFS not detected."); + return; + } + var path = Path.Combine(ROM.PathExeFS, "main"); + if (!File.Exists(path)) { + WinFormsUtil.Alert("Not able to find `main` file in ExeFS."); + return; + } + var data = FileMitm.ReadAllBytes(path); var nso = new NSO(data);