调整require的写法

This commit is contained in:
MrZ626
2021-03-10 00:50:08 +08:00
parent 1545cb2154
commit fc1f363a8b
11 changed files with 66 additions and 66 deletions

View File

@@ -1,45 +1,45 @@
SCR= require"Zframework/screen" SCR= require"Zframework.screen"
COLOR= require"Zframework/color" COLOR= require"Zframework.color"
SCN= require"Zframework/scene" SCN= require"Zframework.scene"
LOG= require"Zframework/log" LOG= require"Zframework.log"
WS= require"Zframework/websocket" WS= require"Zframework.websocket"
LOADLIB=require"Zframework/loadLib" LOADLIB=require"Zframework.loadLib"
WHEELMOV=require"Zframework/wheelScroll" WHEELMOV=require"Zframework.wheelScroll"
require"Zframework/setFont" require"Zframework.setFont"
MDRAW=require"Zframework/mDraw" MDRAW=require"Zframework.mDraw"
mStr=MDRAW.str mStr=MDRAW.str
mText=MDRAW.simpX mText=MDRAW.simpX
mDraw=MDRAW.draw mDraw=MDRAW.draw
-- UPPERCHAR=require"Zframework/upperChar" -- UPPERCHAR=require"Zframework.upperChar"
JSON=require"Zframework/json" JSON=require"Zframework.json"
DUMPTABLE=require"Zframework/dumpTable" DUMPTABLE=require"Zframework.dumpTable"
URLENCODE=require"Zframework/urlEncode" URLENCODE=require"Zframework.urlEncode"
TABLE=require"Zframework/tableExtend" TABLE=require"Zframework.tableExtend"
SPLITSTR=require"Zframework/splitStr" SPLITSTR=require"Zframework.splitStr"
TIMESTR=require"Zframework/timeStr" TIMESTR=require"Zframework.timeStr"
VIB= require"Zframework/vibrate" VIB= require"Zframework.vibrate"
SFX= require"Zframework/sfx" SFX= require"Zframework.sfx"
LIGHT= require"Zframework/light" LIGHT= require"Zframework.light"
DOGC= require"Zframework/doGC" DOGC= require"Zframework.doGC"
BG= require"Zframework/background" BG= require"Zframework.background"
WIDGET= require"Zframework/widget" WIDGET= require"Zframework.widget"
TEXT= require"Zframework/text" TEXT= require"Zframework.text"
SYSFX= require"Zframework/sysFX" SYSFX= require"Zframework.sysFX"
IMG= require"Zframework/image" IMG= require"Zframework.image"
BGM= require"Zframework/bgm" BGM= require"Zframework.bgm"
VOC= require"Zframework/voice" VOC= require"Zframework.voice"
LANG= require"Zframework/languages" LANG= require"Zframework.languages"
TASK= require"Zframework/task" TASK= require"Zframework.task"
FILE= require"Zframework/file" FILE= require"Zframework.file"
PROFILE=require"Zframework/profile" PROFILE=require"Zframework.profile"
local ms,kb=love.mouse,love.keyboard local ms,kb=love.mouse,love.keyboard

View File

@@ -16,7 +16,7 @@ local band,bor,bxor=bit.band,bit.bor,bit.bxor
local shl,shr=bit.lshift,bit.rshift local shl,shr=bit.lshift,bit.rshift
local SOCK=require"socket".tcp() local SOCK=require"socket".tcp()
local JSON=require"Zframework/json" local JSON=require"Zframework.json"
local mask_key={1,14,5,14} local mask_key={1,14,5,14}
local function _send(opcode,message) local function _send(opcode,message)

View File

@@ -120,20 +120,20 @@ end
--Load modules --Load modules
require"Zframework" require"Zframework"
require"parts/list" require"parts.list"
require"parts/globalTables" require"parts.globalTables"
require"parts/gametoolfunc" require"parts.gametoolfunc"
SCR.setSize(1280,720)--Initialize Screen size SCR.setSize(1280,720)--Initialize Screen size
FIELD[1]=newBoard()--Initialize field[1] FIELD[1]=newBoard()--Initialize field[1]
AIBUILDER= require"parts/AITemplate" AIBUILDER= require"parts.AITemplate"
FREEROW= require"parts/freeRow" FREEROW= require"parts.freeRow"
TEXTURE= require"parts/texture" TEXTURE= require"parts.texture"
SKIN= require"parts/skin" SKIN= require"parts.skin"
PLY= require"parts/player" PLY= require"parts.player"
AIFUNC= require"parts/ai" AIFUNC= require"parts.ai"
MODES= require"parts/modes" MODES= require"parts.modes"
--First start for phones --First start for phones
if not fs.getInfo("conf/settings")and MOBILE then if not fs.getInfo("conf/settings")and MOBILE then
@@ -239,14 +239,14 @@ VOC.init{
--Initialize language lib --Initialize language lib
LANG.init( LANG.init(
{ {
require"parts/language/lang_zh", require"parts.language.lang_zh",
require"parts/language/lang_zh2", require"parts.language.lang_zh2",
require"parts/language/lang_yygq", require"parts.language.lang_yygq",
require"parts/language/lang_en", require"parts.language.lang_en",
require"parts/language/lang_fr", require"parts.language.lang_fr",
require"parts/language/lang_sp", require"parts.language.lang_sp",
require"parts/language/lang_pt", require"parts.language.lang_pt",
require"parts/language/lang_symbol", require"parts.language.lang_symbol",
--1. Add language file to LANG folder; --1. Add language file to LANG folder;
--2. Require it; --2. Require it;
--3. Add a button in parts/scenes/setting_lang.lua; --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 fs.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then
if v:sub(-3)=="lua"then if v:sub(-3)=="lua"then
local name=v:sub(1,-5) local name=v:sub(1,-5)
BG.add(name,require("parts/backgrounds/"..name)) BG.add(name,require("parts.backgrounds."..name))
end end
else else
LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v) LOG.print("Dangerous file : %SAVE%/parts/backgrounds/"..v)
@@ -289,7 +289,7 @@ end
for _,v in next,fs.getDirectoryItems("parts/scenes")do for _,v in next,fs.getDirectoryItems("parts/scenes")do
if fs.getRealDirectory("parts/scenes/"..v)~=SAVEDIR then if fs.getRealDirectory("parts/scenes/"..v)~=SAVEDIR then
local sceneName=v:sub(1,-5) local sceneName=v:sub(1,-5)
SCN.add(sceneName,require("parts/scenes/"..sceneName)) SCN.add(sceneName,require("parts.scenes."..sceneName))
LANG.addScene(sceneName) LANG.addScene(sceneName)
else else
LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v) LOG.print("Dangerous file : %SAVE%/parts/scenes/"..v)

View File

@@ -2,8 +2,8 @@ local int=math.floor
local pc_drop={50,45,40,35,30,26,22,18,15,12} 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_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 pc_fall={18,16,14,12,10,9,8,7,6,5}
local PCbase=require"parts/modes/PCbase" local PCbase=require"parts.modes.PCbase"
local PClist=require"parts/modes/PClist" local PClist=require"parts.modes.PClist"
local function task_PC(P) local function task_PC(P)
local D=P.modeData local D=P.modeData

View File

@@ -1,5 +1,5 @@
local PCbase=require"parts/modes/PCbase" local PCbase=require"parts.modes.PCbase"
local PClist=require"parts/modes/PClist" local PClist=require"parts.modes.PClist"
local PCtype={ local PCtype={
1,1,1,1,2, 1,1,1,1,2,
1,1,1,1,3, 1,1,1,1,3,

View File

@@ -1,13 +1,13 @@
local Player=require"parts/player/player" local Player=require"parts.player.player"
local prepareSequence=require"parts/player/prepareSequence" local prepareSequence=require"parts.player.prepareSequence"
local gameEnv0=require"parts/player/gameEnv0" local gameEnv0=require"parts.player.gameEnv0"
local rnd,max=math.random,math.max local rnd,max=math.random,math.max
local ins=table.insert local ins=table.insert
local PLY={ local PLY={
update=require"parts/player/update", update=require"parts.player.update",
draw=require"parts/player/draw", draw=require"parts.player.draw",
} }
--------------------------<Lib Func>-------------------------- --------------------------<Lib Func>--------------------------

View File

@@ -9,7 +9,7 @@ local max,min,modf=math.max,math.min,math.modf
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local YIELD=YIELD local YIELD=YIELD
local kickList=require"parts/kickList" local kickList=require"parts.kickList"
--------------------------<FX>-------------------------- --------------------------<FX>--------------------------
function Player.showText(P,text,dx,dy,font,style,spd,stop) function Player.showText(P,text,dx,dy,font,style,spd,stop)

View File

@@ -20,7 +20,7 @@ local scrollPos--Scroll down length
local lastSearch--Last searched string local lastSearch--Last searched string
function scene.sceneInit() 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() inputBox:clear()
result={} result={}

View File

@@ -6,7 +6,7 @@ function scene.sceneInit()
BG.set("cubes") BG.set("cubes")
if not inited then if not inited then
inited=true inited=true
WIDGET.active.texts:setTexts(require"parts/updateLog") WIDGET.active.texts:setTexts(require"parts.updateLog")
end end
if newVersionLaunch then if newVersionLaunch then
newVersionLaunch=false newVersionLaunch=false

View File

@@ -118,7 +118,7 @@ local loadingThread=coroutine.create(function()
upFloor() upFloor()
for i=1,#MODES do for i=1,#MODES do
local m=MODES[i]--Mode template 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 MODES[m.name],MODES[i]=M
for k,v in next,m do for k,v in next,m do
M[k]=v M[k]=v

View File

@@ -2,7 +2,7 @@ local scene={}
function scene.sceneInit() function scene.sceneInit()
BG.set("cubes") 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 end
function scene.wheelMoved(_,y) function scene.wheelMoved(_,y)