调整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"
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

View File

@@ -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)

View File

@@ -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)

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_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

View File

@@ -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,

View File

@@ -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",
}
--------------------------<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 YIELD=YIELD
local kickList=require"parts/kickList"
local kickList=require"parts.kickList"
--------------------------<FX>--------------------------
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
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={}

View File

@@ -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

View File

@@ -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

View File

@@ -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)