fix(launcher): prioritize in-launcher FileBrowser on handhelds and fix modalUp detection

This commit is contained in:
Shane McGovern
2026-08-26 11:56:26 +01:00
parent 592daafa42
commit ee427cd9eb
2 changed files with 59 additions and 0 deletions
+2
View File
@@ -5604,6 +5604,8 @@ end
-- a click on the scrim lands on whatever button happens to be behind it. -- a click on the scrim lands on whatever button happens to be behind it.
-- Keep this list in sync with buildModals below. -- Keep this list in sync with buildModals below.
local function modalUp(imp) 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 return (imp._settingsText or imp._settings or imp._rename
or imp._indexPrompt or imp._modConfirm or imp._modReleaseNotes or imp._indexPrompt or imp._modConfirm or imp._modReleaseNotes
or imp._appPatchNotes or imp._appPatchNotes
+57
View File
@@ -2055,6 +2055,25 @@ function RomImporter:chooseMod()
end end
return return
end 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() local path = chooseZip()
if path then if path then
self:_installMod(path) self:_installMod(path)
@@ -2494,6 +2513,25 @@ function RomImporter:chooseSaveImport(version)
end end
return return
end 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() local path = chooseSav()
if path then if path then
self:_importSave(version, path) self:_importSave(version, path)
@@ -2651,6 +2689,25 @@ function RomImporter:choose(version)
end end
return return
end 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) local path = chooseRom(GameVersion.info(self.chooseVersion).displayName)
if path then if path then
self:startPath(path) self:startPath(path)