iOS设备震动函数改为输入1|2|3三档而不是时间(适配自改love,原版love都是固定振动)
框架不再使用不属于自己的SYSTEM的变量
This commit is contained in:
@@ -408,7 +408,7 @@ function love.errorhandler(msg)
|
|||||||
--Write messages to log file
|
--Write messages to log file
|
||||||
love.filesystem.append('conf/error.log',
|
love.filesystem.append('conf/error.log',
|
||||||
os.date("%Y/%m/%d %A %H:%M:%S\n")..
|
os.date("%Y/%m/%d %A %H:%M:%S\n")..
|
||||||
#ERRDATA.." crash(es) "..SYSTEM.."-"..VERSION.string.." scene: "..scn.."\n"..
|
#ERRDATA.." crash(es) "..love.system.getOS().."-"..VERSION.string.." scene: "..scn.."\n"..
|
||||||
table.concat(err,"\n",1,c-2).."\n\n"
|
table.concat(err,"\n",1,c-2).."\n\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -449,7 +449,7 @@ function love.errorhandler(msg)
|
|||||||
FONT.set(100)gc_print(":(",100,0,0,1.2)
|
FONT.set(100)gc_print(":(",100,0,0,1.2)
|
||||||
FONT.set(40)gc.printf(errorMsg,100,160,SCR.w0-100)
|
FONT.set(40)gc.printf(errorMsg,100,160,SCR.w0-100)
|
||||||
FONT.set(20)
|
FONT.set(20)
|
||||||
gc_print(SYSTEM.."-"..VERSION.string.." scene:"..(SCN and SCN.cur or"NULL"),100,660)
|
gc_print(love.system.getOS().."-"..VERSION.string.." scene:"..(SCN and SCN.cur or"NULL"),100,660)
|
||||||
gc.printf(err[1],100,360,1260-100)
|
gc.printf(err[1],100,360,1260-100)
|
||||||
gc_print("TRACEBACK",100,450)
|
gc_print("TRACEBACK",100,450)
|
||||||
for i=4,#err-2 do
|
for i=4,#err-2 do
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ package.cpath=package.cpath..';'..SAVEDIR..'/lib/lib?.so;'..'?.dylib'
|
|||||||
local loaded={}
|
local loaded={}
|
||||||
return function(libName)
|
return function(libName)
|
||||||
local require=require
|
local require=require
|
||||||
if SYSTEM=='OS X'then
|
if love.system.getOS()=='OS X'then
|
||||||
require=package.loadlib(libName..'.dylib','luaopen_'..libName)
|
require=package.loadlib(libName..'.dylib','luaopen_'..libName)
|
||||||
libname=nil
|
libname=nil
|
||||||
elseif SYSTEM=='Android'then
|
elseif love.system.getOS()=='Android'then
|
||||||
if not loaded[libName]then
|
if not loaded[libName]then
|
||||||
local platform=(function()
|
local platform=(function()
|
||||||
local p=io.popen('uname -m')
|
local p=io.popen('uname -m')
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
local level={0,0,.01,.016,.023,.03,.04,.05,.06,.07,.08,.09,.12,.15}
|
local level={0,0,.01,.016,.023,.03,.04,.05,.06,.07,.08,.09,.12,.15}
|
||||||
local vib=love.system.vibrate
|
local vib=love.system.vibrate
|
||||||
return function(t)
|
return love.system.getOS()=='iOS'and
|
||||||
t=level[t]
|
function(t)
|
||||||
if t then vib(t)end
|
t=level[t]
|
||||||
end
|
if t then vib(t<=.03 and 1 or t<=.09 and 2 or 3)end
|
||||||
|
end
|
||||||
|
or
|
||||||
|
function(t)
|
||||||
|
t=level[t]
|
||||||
|
if t then vib(t)end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user