mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 08:11:35 +02:00
Merge branch 'dev' of https://github.com/bryanthaboi/gen1recomp into dev
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
-- Platform capability detection for NX / mobile / desktop.
|
||||
-- Platform capability detection for console, mobile and desktop builds.
|
||||
|
||||
local Platform = {}
|
||||
|
||||
@@ -8,20 +8,22 @@ local function compute()
|
||||
local osName = (love and love.system and love.system.getOS and love.system.getOS())
|
||||
or "Unknown"
|
||||
local nx = osName == "NX"
|
||||
local uwp = osName == "UWP"
|
||||
local mobile = osName == "Android" or osName == "iOS"
|
||||
local nativePicker = love and love.system
|
||||
and type(love.system.pickFile) == "function"
|
||||
return {
|
||||
os = osName,
|
||||
nx = nx,
|
||||
uwp = uwp,
|
||||
mobile = mobile,
|
||||
console = nx,
|
||||
console = nx or uwp,
|
||||
hasNativePicker = nativePicker,
|
||||
canSpawnProcess = osName == "OS X" or osName == "Windows" or osName == "Linux",
|
||||
romImportMode = nx and "save-directory"
|
||||
or (nativePicker and "native-picker")
|
||||
or "desktop",
|
||||
networkValidated = not nx,
|
||||
networkValidated = not nx and not uwp,
|
||||
}
|
||||
end
|
||||
|
||||
@@ -34,6 +36,10 @@ function Platform.isNX()
|
||||
return Platform.detect().nx
|
||||
end
|
||||
|
||||
function Platform.isUWP()
|
||||
return Platform.detect().uwp
|
||||
end
|
||||
|
||||
function Platform.romImportMode()
|
||||
return Platform.detect().romImportMode
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user