diff --git a/Zframework/loadLib.lua b/Zframework/loadLib.lua index a992cd8b..97ebaa25 100644 --- a/Zframework/loadLib.lua +++ b/Zframework/loadLib.lua @@ -10,33 +10,28 @@ return function(name,libName) local fs=love.filesystem local platform={'arm64-v8a','armeabi-v7a'} - local libFunc=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc) - if libFunc then - LOG.print(name.." lib loaded",'message') - else - for i=1,#platform do - local soFile,_,_,mes1=fs.read('data',"libAndroid/"..platform[i].."/"..libName.Android) - if soFile then - local success,mes2=fs.write("lib/"..libName.Android,soFile) - if success then - libFunc,mes2=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc) - if libFunc then - LOG.print(name.." lib loaded",'message') - break - else - LOG.print("Cannot load "..name..": "..mes2,'error') - end + for i=1,#platform do + local soFile,_,_,mes1=fs.read('data',"libAndroid/"..platform[i].."/"..libName.Android) + if soFile then + local success,mes2=fs.write("lib/"..libName.Android,soFile) + if success then + libFunc,mes2=package.loadlib(SAVEDIR.."/lib/"..libName.Android,libName.libFunc) + if libFunc then + LOG.print(name.." lib loaded",'message') + break else - LOG.print(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2),'error') + LOG.print("Cannot load "..name..": "..mes2,'error') end else - LOG.print(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1),'error') + LOG.print(("Write %s-%s to saving failed: %s"):format(name,platform[i],mes2),'error') end + else + LOG.print(("Read %s-%s to saving failed: %s"):format(name,platform[i],mes1),'error') end - if not libFunc then - LOG.print("Cannot load "..name,'error') - return - end + end + if not libFunc then + LOG.print("Cannot load "..name,'error') + return end return libFunc() else diff --git a/main.lua b/main.lua index b03f353d..02212be9 100644 --- a/main.lua +++ b/main.lua @@ -239,8 +239,7 @@ end --Update data do - local needSave - local autoRestart + local needSave,autoRestart if type(STAT.version)~='number'then STAT.version=0 @@ -267,21 +266,18 @@ do needSave=true autoRestart=true end + if STAT.version~=VERSION.code then + STAT.version=VERSION.code + needSave=true + autoRestart=true + end + if not SETTING.VKSkin then SETTING.VKSkin=1 end if not TABLE.find({8,10,13,17,22,29,37,47,62,80,100},SETTING.frameMul)then SETTING.frameMul=100 end SETTING.appLock=nil - for _,v in next,VK_org do v.color=nil end - - if STAT.version~=VERSION.code then - STAT.version=VERSION.code - CLEAR("lib") - needSave=true - autoRestart=true - end - if RANKS.GM then RANKS.GM=0 end if RANKS.infinite then RANKS.infinite=6 end if RANKS.infinite_dig then RANKS.infinite_dig=6 end