fix(ios): consolidate mobile integration changes

This commit is contained in:
Adrian Castro
2026-08-03 11:09:30 +02:00
parent 21276e20d1
commit 01f68d4038
7 changed files with 119 additions and 43 deletions
+37 -3
View File
@@ -768,6 +768,13 @@ end
-- _pollPickedFiles must stay armed so it consumes the file when it lands
-- moments later (it clears pickPending itself once something is found).
function RomImporter:focus(f)
if not f then
self._activeTouch = nil
self._pagePress = nil
self._slotPress = nil
self._modPress = nil
return
end
if not (f and self.android and self.workState ~= "working") then return end
-- SAF create-document finished: GameActivity wrote export_done.flag.
if love.filesystem.getInfo("export_done.flag", "file") then
@@ -2987,6 +2994,29 @@ function RomImporter:mousepressed(x, y, button)
end
end
function RomImporter:touchpressed(id, x, y)
if self._activeTouch ~= nil and self._activeTouch ~= id then
self._pagePress = nil
self._slotPress = nil
self._modPress = nil
self._activeTouch = nil
end
if self._activeTouch ~= nil then return end
self._activeTouch = id
self:mousepressed(x, y, 1, id)
end
function RomImporter:touchmoved(id, _, y)
if self._activeTouch ~= id then return end
self:_updateDrag(true, y)
end
function RomImporter:touchreleased(id, _, y)
if self._activeTouch == nil then return end
self:_updateDrag(false, y)
self._activeTouch = nil
end
function RomImporter:keypressed(key)
if self._rename then
if key == "backspace" then
@@ -3688,9 +3718,7 @@ function RomImporter:_pointerHold()
return true, ty
end
function RomImporter:_updateSlotDrag()
if self.android and not self.touchPollable then return end
local down, py = self:_pointerHold()
function RomImporter:_updateDrag(down, py)
py = py or self._my
local maxPage = self._pageMax or 0
@@ -3748,6 +3776,12 @@ function RomImporter:_updateSlotDrag()
end
end
function RomImporter:_updateSlotDrag()
if self.ios or (self.android and not self.touchPollable) then return end
local down, py = self:_pointerHold()
self:_updateDrag(down, py)
end
-- Mouse wheel over a game tab scrolls its save-slot list (installed onto the
-- global love.wheelmoved in new(); see the chain there). Clamped to the last
-- content extent draw computed for that version.