This commit is contained in:
bryanthaboi
2026-08-04 15:13:07 -04:00
169 changed files with 58873 additions and 77 deletions
+9 -3
View File
@@ -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