mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-22 13:36:14 +02:00
This commit is contained in:
@@ -2854,6 +2854,7 @@ function RomImporter:_updatePadCursor(dt)
|
||||
local overY = 0
|
||||
if ny > oy + h then overY = ny - (oy + h)
|
||||
elseif ny < oy then overY = ny - oy end
|
||||
if math.abs(ay) > PAD_DEAD and not self._padStickCentered then overY = 0 end
|
||||
if overY ~= 0 and self._flex then
|
||||
require("src.import.LauncherView").wheelmoved(self, 0, -overY / 48)
|
||||
end
|
||||
@@ -2913,7 +2914,11 @@ end
|
||||
function RomImporter:gamepadaxis(_, axis, value)
|
||||
if axis == "leftx" or axis == "lefty" or axis == "righty" then
|
||||
self._padAxis[axis] = value
|
||||
if math.abs(value) > PAD_DEAD then self:_activatePadCursor() end
|
||||
if math.abs(value) > PAD_DEAD then
|
||||
self:_activatePadCursor()
|
||||
elseif axis == "lefty" then
|
||||
self._padStickCentered = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2922,18 +2927,21 @@ end
|
||||
-- fire the virtual cursor's click twice off one A press (#620).
|
||||
function RomImporter:joystickpressed(joystick, button)
|
||||
if GamepadMap.ignoreRawForJoystick(joystick) then return end
|
||||
if GamepadMap.isAccelerometer(joystick) then return end
|
||||
local padButton = GamepadMap.mapRawToGamepadButton(button)
|
||||
if padButton then self:gamepadpressed(joystick, padButton) end
|
||||
end
|
||||
|
||||
function RomImporter:joystickreleased(joystick, button)
|
||||
if GamepadMap.ignoreRawForJoystick(joystick) then return end
|
||||
if GamepadMap.isAccelerometer(joystick) then return end
|
||||
local padButton = GamepadMap.mapRawToGamepadButton(button)
|
||||
if padButton then self:gamepadreleased(joystick, padButton) end
|
||||
end
|
||||
|
||||
function RomImporter:joystickaxis(joystick, axis, value)
|
||||
if GamepadMap.ignoreRawForJoystick(joystick) then return end
|
||||
if GamepadMap.isAccelerometer(joystick) then return end
|
||||
if axis == 1 then
|
||||
self:gamepadaxis(joystick, "leftx", value)
|
||||
elseif axis == 2 then
|
||||
@@ -2943,6 +2951,7 @@ end
|
||||
|
||||
function RomImporter:joystickhat(joystick, hat, direction)
|
||||
if GamepadMap.ignoreRawForJoystick(joystick) then return end
|
||||
if GamepadMap.isAccelerometer(joystick) then return end
|
||||
for _, dir in ipairs(self._rawHatDirs[hat] or {}) do
|
||||
self._padDir[dir] = nil
|
||||
end
|
||||
@@ -4003,6 +4012,18 @@ function RomImporter:_disarmTextInput()
|
||||
end
|
||||
end
|
||||
|
||||
function RomImporter:_blurPanelFields()
|
||||
if not (self._findSearchFocus or self._skinUrlFocus) then return end
|
||||
if self._indexPrompt or self._rename or self._settingsText
|
||||
or self._profileSavePrompt or self._profileRenamePrompt
|
||||
or (self._syncModal and self._syncFocus) then
|
||||
return
|
||||
end
|
||||
self._findSearchFocus = false
|
||||
self._skinUrlFocus = false
|
||||
self:_disarmTextInput()
|
||||
end
|
||||
|
||||
function RomImporter:_beginRename(version, id)
|
||||
local label
|
||||
for _, slot in ipairs(self.slots[version] or {}) do
|
||||
|
||||
Reference in New Issue
Block a user