diff --git a/Zframework/init.lua b/Zframework/init.lua index 83640385..9650a174 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -1,45 +1,45 @@ -SCR= require"Zframework/screen" -COLOR= require"Zframework/color" -SCN= require"Zframework/scene" -LOG= require"Zframework/log" -WS= require"Zframework/websocket" +SCR= require"Zframework.screen" +COLOR= require"Zframework.color" +SCN= require"Zframework.scene" +LOG= require"Zframework.log" +WS= require"Zframework.websocket" -LOADLIB=require"Zframework/loadLib" -WHEELMOV=require"Zframework/wheelScroll" +LOADLIB=require"Zframework.loadLib" +WHEELMOV=require"Zframework.wheelScroll" -require"Zframework/setFont" -MDRAW=require"Zframework/mDraw" +require"Zframework.setFont" +MDRAW=require"Zframework.mDraw" mStr=MDRAW.str mText=MDRAW.simpX mDraw=MDRAW.draw --- UPPERCHAR=require"Zframework/upperChar" -JSON=require"Zframework/json" -DUMPTABLE=require"Zframework/dumpTable" -URLENCODE=require"Zframework/urlEncode" +-- UPPERCHAR=require"Zframework.upperChar" +JSON=require"Zframework.json" +DUMPTABLE=require"Zframework.dumpTable" +URLENCODE=require"Zframework.urlEncode" -TABLE=require"Zframework/tableExtend" -SPLITSTR=require"Zframework/splitStr" -TIMESTR=require"Zframework/timeStr" +TABLE=require"Zframework.tableExtend" +SPLITSTR=require"Zframework.splitStr" +TIMESTR=require"Zframework.timeStr" -VIB= require"Zframework/vibrate" -SFX= require"Zframework/sfx" +VIB= require"Zframework.vibrate" +SFX= require"Zframework.sfx" -LIGHT= require"Zframework/light" -DOGC= require"Zframework/doGC" -BG= require"Zframework/background" -WIDGET= require"Zframework/widget" -TEXT= require"Zframework/text" -SYSFX= require"Zframework/sysFX" +LIGHT= require"Zframework.light" +DOGC= require"Zframework.doGC" +BG= require"Zframework.background" +WIDGET= require"Zframework.widget" +TEXT= require"Zframework.text" +SYSFX= require"Zframework.sysFX" -IMG= require"Zframework/image" -BGM= require"Zframework/bgm" -VOC= require"Zframework/voice" +IMG= require"Zframework.image" +BGM= require"Zframework.bgm" +VOC= require"Zframework.voice" -LANG= require"Zframework/languages" -TASK= require"Zframework/task" -FILE= require"Zframework/file" -PROFILE=require"Zframework/profile" +LANG= require"Zframework.languages" +TASK= require"Zframework.task" +FILE= require"Zframework.file" +PROFILE=require"Zframework.profile" local ms,kb=love.mouse,love.keyboard diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index 8dd311f2..f44c62ad 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -16,7 +16,7 @@ local band,bor,bxor=bit.band,bit.bor,bit.bxor local shl,shr=bit.lshift,bit.rshift local SOCK=require"socket".tcp() -local JSON=require"Zframework/json" +local JSON=require"Zframework.json" local mask_key={1,14,5,14} local function _send(opcode,message) diff --git a/main.lua b/main.lua index 5c86a6c0..515a574f 100644 --- a/main.lua +++ b/main.lua @@ -120,20 +120,20 @@ end --Load modules require"Zframework" -require"parts/list" -require"parts/globalTables" -require"parts/gametoolfunc" +require"parts.list" +require"parts.globalTables" +require"parts.gametoolfunc" SCR.setSize(1280,720)--Initialize Screen size FIELD[1]=newBoard()--Initialize field[1] -AIBUILDER= require"parts/AITemplate" -FREEROW= require"parts/freeRow" +AIBUILDER= require"parts.AITemplate" +FREEROW= require"parts.freeRow" -TEXTURE= require"parts/texture" -SKIN= require"parts/skin" -PLY= require"parts/player" -AIFUNC= require"parts/ai" -MODES= require"parts/modes" +TEXTURE= require"parts.texture" +SKIN= require"parts.skin" +PLY= require"parts.player" +AIFUNC= require"parts.ai" +MODES= require"parts.modes" --First start for phones if not fs.getInfo("conf/settings")and MOBILE then @@ -239,14 +239,14 @@ VOC.init{ --Initialize language lib LANG.init( { - require"parts/language/lang_zh", - require"parts/language/lang_zh2", - require"parts/language/lang_yygq", - require"parts/language/lang_en", - require"parts/language/lang_fr", - require"parts/language/lang_sp", - require"parts/language/lang_pt", - require"parts/language/lang_symbol", + require"parts.language.lang_zh", + require"parts.language.lang_zh2", + require"parts.language.lang_yygq", + require"parts.language.lang_en", + require"parts.language.lang_fr", + require"parts.language.lang_sp", + require"parts.language.lang_pt", + require"parts.language.lang_symbol", --1. Add language file to LANG folder; --2. Require it; --3. Add a button in parts/scenes/setting_lang.lua; @@ -278,7 +278,7 @@ for _,v in next,fs.getDirectoryItems("parts/backgrounds")do if fs.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then if v:sub(-3)=="lua"then local name=v:sub(1,-5) - BG.add(name,require("parts/backgrounds/"..name)) + BG.add(name,require("parts.backgrounds."..name)) end else LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v) @@ -289,7 +289,7 @@ end for _,v in next,fs.getDirectoryItems("parts/scenes")do if fs.getRealDirectory("parts/scenes/"..v)~=SAVEDIR then local sceneName=v:sub(1,-5) - SCN.add(sceneName,require("parts/scenes/"..sceneName)) + SCN.add(sceneName,require("parts.scenes."..sceneName)) LANG.addScene(sceneName) else LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v) diff --git a/parts/modes/pctrain_l.lua b/parts/modes/pctrain_l.lua index 323404ce..afbda05b 100644 --- a/parts/modes/pctrain_l.lua +++ b/parts/modes/pctrain_l.lua @@ -2,8 +2,8 @@ local int=math.floor local pc_drop={50,45,40,35,30,26,22,18,15,12} local pc_lock={55,50,46,42,39,36,33,31,29,27} local pc_fall={18,16,14,12,10,9,8,7,6,5} -local PCbase=require"parts/modes/PCbase" -local PClist=require"parts/modes/PClist" +local PCbase=require"parts.modes.PCbase" +local PClist=require"parts.modes.PClist" local function task_PC(P) local D=P.modeData diff --git a/parts/modes/pctrain_n.lua b/parts/modes/pctrain_n.lua index 33f3e3f7..d3bbcb85 100644 --- a/parts/modes/pctrain_n.lua +++ b/parts/modes/pctrain_n.lua @@ -1,5 +1,5 @@ -local PCbase=require"parts/modes/PCbase" -local PClist=require"parts/modes/PClist" +local PCbase=require"parts.modes.PCbase" +local PClist=require"parts.modes.PClist" local PCtype={ 1,1,1,1,2, 1,1,1,1,3, diff --git a/parts/player/init.lua b/parts/player/init.lua index 7dc89bab..f6779ced 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -1,13 +1,13 @@ -local Player=require"parts/player/player" -local prepareSequence=require"parts/player/prepareSequence" -local gameEnv0=require"parts/player/gameEnv0" +local Player=require"parts.player.player" +local prepareSequence=require"parts.player.prepareSequence" +local gameEnv0=require"parts.player.gameEnv0" local rnd,max=math.random,math.max local ins=table.insert local PLY={ - update=require"parts/player/update", - draw=require"parts/player/draw", + update=require"parts.player.update", + draw=require"parts.player.draw", } ---------------------------------------------------- diff --git a/parts/player/player.lua b/parts/player/player.lua index 24caa2d5..c61a51ef 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -9,7 +9,7 @@ local max,min,modf=math.max,math.min,math.modf local ins,rem=table.insert,table.remove local YIELD=YIELD -local kickList=require"parts/kickList" +local kickList=require"parts.kickList" ---------------------------------------------------- function Player.showText(P,text,dx,dy,font,style,spd,stop) diff --git a/parts/scenes/dict.lua b/parts/scenes/dict.lua index 17478d29..1a887f19 100644 --- a/parts/scenes/dict.lua +++ b/parts/scenes/dict.lua @@ -20,7 +20,7 @@ local scrollPos--Scroll down length local lastSearch--Last searched string function scene.sceneInit() - dict=require("parts/language/dict_"..({"zh","zh","zh","en","en","en","en","en"})[SETTING.lang]) + dict=require("parts.language.dict_"..({"zh","zh","zh","en","en","en","en","en"})[SETTING.lang]) inputBox:clear() result={} diff --git a/parts/scenes/history.lua b/parts/scenes/history.lua index fca32f67..37e5357e 100644 --- a/parts/scenes/history.lua +++ b/parts/scenes/history.lua @@ -6,7 +6,7 @@ function scene.sceneInit() BG.set("cubes") if not inited then inited=true - WIDGET.active.texts:setTexts(require"parts/updateLog") + WIDGET.active.texts:setTexts(require"parts.updateLog") end if newVersionLaunch then newVersionLaunch=false diff --git a/parts/scenes/load.lua b/parts/scenes/load.lua index c92ee4c4..7847121f 100644 --- a/parts/scenes/load.lua +++ b/parts/scenes/load.lua @@ -118,7 +118,7 @@ local loadingThread=coroutine.create(function() upFloor() for i=1,#MODES do local m=MODES[i]--Mode template - local M=require("parts/modes/"..m.name)--Mode file + local M=require("parts.modes."..m.name)--Mode file MODES[m.name],MODES[i]=M for k,v in next,m do M[k]=v diff --git a/parts/scenes/manual.lua b/parts/scenes/manual.lua index adceec77..e067c17f 100644 --- a/parts/scenes/manual.lua +++ b/parts/scenes/manual.lua @@ -2,7 +2,7 @@ local scene={} function scene.sceneInit() BG.set("cubes") - WIDGET.active.texts:setTexts(require("parts/language/manual_"..({"zh","zh","zh","en","en","en","en","en"})[SETTING.lang])) + WIDGET.active.texts:setTexts(require("parts.language.manual_"..({"zh","zh","zh","en","en","en","en","en"})[SETTING.lang])) end function scene.wheelMoved(_,y)