mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-27 08:51:27 +02:00
fix(launcher): prioritize in-launcher FileBrowser on handhelds and fix modalUp detection
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user