Ci mobile fix (#812)
* - Add portrait switch * - Only build mobile * 设置项添加竖屏和msaa参数,增加调整的控件 * 修正conf.lua里没拿到正确的存档路径(因为还没设置identity) * 加一些测试代码观察安卓到底有没有读到存档文件 * -Try relative * - Try set settings in main * - Make code analysis happy * - Try not use setFullScreen * - Test iOS portrait * - Add various loggings * - Try set identity first * - Try set configs in conf.lua * - Finish editing Co-authored-by: MrZ_26 <1046101471@qq.com>
This commit is contained in:
44
conf.lua
44
conf.lua
@@ -2,23 +2,22 @@ SYSTEM=love._os if SYSTEM=='OS X' then SYSTEM='macOS' end
|
||||
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
||||
FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
|
||||
|
||||
local _mobileFullscreen=true
|
||||
local _msaa=0
|
||||
if love.filesystem.getInfo('conf/settings') then
|
||||
local fileData=love.filesystem.read('conf/settings')
|
||||
if type(fileData)=='string' then
|
||||
if MOBILE and fileData:find('"portrait":true') then
|
||||
_mobileFullscreen=false
|
||||
end
|
||||
if fileData:find("'msaa':") then
|
||||
local num=tonumber(fileData:match("'msaa':(%d+)"))
|
||||
if num then _msaa=num end
|
||||
function love.conf(t)
|
||||
local identity='Techmino'
|
||||
local msaa=0
|
||||
local portrait=false
|
||||
|
||||
local fs=love.filesystem
|
||||
fs.setIdentity(identity)
|
||||
do -- Load grapgic settings from conf/settings
|
||||
local fileData=fs.read('conf/settings')
|
||||
if fileData then
|
||||
msaa=tonumber(fileData:match('"msaa":(%d+)')) or 0;
|
||||
portrait=MOBILE and fileData:find('"portrait":true') and true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function love.conf(t)
|
||||
t.identity='Techmino' -- Saving folder
|
||||
t.identity=identity -- Saving folder
|
||||
t.version="11.4"
|
||||
t.gammacorrect=false
|
||||
t.appendidentity=true -- Search files in source then in save directory
|
||||
@@ -30,23 +29,30 @@ function love.conf(t)
|
||||
|
||||
local W=t.window
|
||||
W.title="Techmino "..require "version".string
|
||||
W.width,W.height=1280,720
|
||||
W.minwidth,W.minheight=640,360
|
||||
if portrait then
|
||||
W.width,W.height=720,1280
|
||||
W.minwidth,W.minheight=360,640
|
||||
else
|
||||
W.width,W.height=1280,720
|
||||
W.minwidth,W.minheight=640,360
|
||||
end
|
||||
|
||||
W.vsync=0 -- Unlimited FPS
|
||||
W.msaa=_msaa -- Multi-sampled antialiasing
|
||||
W.msaa=msaa -- Multi-sampled antialiasing
|
||||
W.depth=0 -- Bits/samp of depth buffer
|
||||
W.stencil=1 -- Bits/samp of stencil buffer
|
||||
W.display=1 -- Monitor ID
|
||||
W.highdpi=true -- High-dpi mode for the window on a Retina display
|
||||
W.x,W.y=nil,nil -- Position of the window
|
||||
if love.filesystem.getInfo('media/image/icon.png') then
|
||||
|
||||
if fs.getInfo('media/image/icon.png') then
|
||||
W.icon='media/image/icon.png'
|
||||
end
|
||||
|
||||
if MOBILE then
|
||||
W.borderless=true
|
||||
W.resizable=false
|
||||
W.fullscreen=_mobileFullscreen
|
||||
W.fullscreen=true
|
||||
else
|
||||
W.borderless=false
|
||||
W.resizable=true
|
||||
|
||||
Reference in New Issue
Block a user