diff --git a/src/import/LauncherView.lua b/src/import/LauncherView.lua index 2d8f9026..f7bbfe40 100644 --- a/src/import/LauncherView.lua +++ b/src/import/LauncherView.lua @@ -5604,6 +5604,8 @@ end -- a click on the scrim lands on whatever button happens to be behind it. -- Keep this list in sync with buildModals below. local function modalUp(imp) + if Kit.FileBrowser and Kit.FileBrowser.active then return true end + if Kit.VirtualKeyboard and Kit.VirtualKeyboard.active then return true end return (imp._settingsText or imp._settings or imp._rename or imp._indexPrompt or imp._modConfirm or imp._modReleaseNotes or imp._appPatchNotes diff --git a/src/import/RomImporter.lua b/src/import/RomImporter.lua index 695ee4d9..c97a0df3 100644 --- a/src/import/RomImporter.lua +++ b/src/import/RomImporter.lua @@ -2055,6 +2055,25 @@ function RomImporter:chooseMod() end return end + local isHandheld = os.getenv("HANDHELD") == "1" or os.getenv("PORTMASTER") == "1" + or os.getenv("POKEPORT_HANDHELD") == "1" or os.getenv("TRIMUI") == "1" + or os.getenv("MUOS") == "1" or os.getenv("KNULLI") == "1" + + if isHandheld then + local okKit, Kit = pcall(require, "src.ui.kit.Kit") + if okKit and Kit.FileBrowser then + self._padCursorActive = false + Kit.FileBrowser.open({ + title = "Select Mod (.zip)", + mode = "mod", + onSelect = function(pickedPath) + self:_installMod(pickedPath) + end, + }) + return + end + end + local path = chooseZip() if path then self:_installMod(path) @@ -2494,6 +2513,25 @@ function RomImporter:chooseSaveImport(version) end return end + local isHandheld = os.getenv("HANDHELD") == "1" or os.getenv("PORTMASTER") == "1" + or os.getenv("POKEPORT_HANDHELD") == "1" or os.getenv("TRIMUI") == "1" + or os.getenv("MUOS") == "1" or os.getenv("KNULLI") == "1" + + if isHandheld then + local okKit, Kit = pcall(require, "src.ui.kit.Kit") + if okKit and Kit.FileBrowser then + self._padCursorActive = false + Kit.FileBrowser.open({ + title = "Select Save (.sav)", + mode = "save", + onSelect = function(pickedPath) + self:_importSave(version, pickedPath) + end, + }) + return + end + end + local path = chooseSav() if path then self:_importSave(version, path) @@ -2651,6 +2689,25 @@ function RomImporter:choose(version) end return end + local isHandheld = os.getenv("HANDHELD") == "1" or os.getenv("PORTMASTER") == "1" + or os.getenv("POKEPORT_HANDHELD") == "1" or os.getenv("TRIMUI") == "1" + or os.getenv("MUOS") == "1" or os.getenv("KNULLI") == "1" + + if isHandheld then + local okKit, Kit = pcall(require, "src.ui.kit.Kit") + if okKit and Kit.FileBrowser then + self._padCursorActive = false + Kit.FileBrowser.open({ + title = "Select " .. (GameVersion.info(self.chooseVersion).displayName or "ROM"), + mode = "rom", + onSelect = function(pickedPath) + self:startPath(pickedPath) + end, + }) + return + end + end + local path = chooseRom(GameVersion.info(self.chooseVersion).displayName) if path then self:startPath(path)