整理代码

This commit is contained in:
MrZ626
2021-12-18 16:08:45 +08:00
parent d6ab7e72b2
commit 226e45b24d
7 changed files with 8 additions and 7 deletions

View File

@@ -86,6 +86,7 @@ mDraw=GC.draw
Snd=SFX.playSample
string.repD=STRING.repD
string.sArg=STRING.sArg
string.split=STRING.split
--Delete all naked files (from too old version)
FILE.clear('')

View File

@@ -79,7 +79,7 @@ end
--Parse notice
local function _parseNotice(str)
if str:find("///")then
str=STRING.split(str,"///")
str=str:split("///")
for i=1,#str do
local m=str[i]
if m:find("=")then

View File

@@ -232,7 +232,7 @@ local commands={}do
commands.mv={
code=function(arg)
--Check arguments
arg=STRING.split(arg," ")
arg=arg:split(" ")
if #arg>2 then
log{C.lY,"Warning: file names must have no spaces"}
return
@@ -867,7 +867,7 @@ local commands={}do
--Network
commands.switchhost={
code=function(arg)
arg=STRING.split(arg," ")
arg=arg:split(" ")
if arg[1]and #arg<=3 then
WS.switchHost(unpack(arg))
log{C.Y,"Host switched"}

View File

@@ -103,7 +103,7 @@ function scene.keyDown(key,isRep)
MES.new('check',text.exportSuccess)
elseif key=='v'and kb.isDown('lctrl','rctrl')or key=='cV'then
local str=sys.getClipboardText()
local args=STRING.split(str:sub((str:find(":")or 0)+1),"!")
local args=str:sub((str:find(":")or 0)+1):split("!")
if #args<4 then goto THROW_fail end
if not(
DATA.pasteQuestArgs(args[1])and

View File

@@ -2,7 +2,7 @@ local scene={}
function scene.sceneInit()
BG.set('cubes')
WIDGET.active.texts:setTexts(STRING.split(require"parts.updateLog","\n"))
WIDGET.active.texts:setTexts(require"parts.updateLog":split("\n"))
end
function scene.wheelMoved(_,y)

View File

@@ -3,7 +3,7 @@ function scene.sceneInit()
BG.set('cubes')
local fileData=love.filesystem.read("legals.md")
if fileData then
WIDGET.active.texts:setTexts(STRING.split(fileData,'\n'))
WIDGET.active.texts:setTexts(fileData:split('\n'))
else
WIDGET.active.texts:setTexts{"[legals.md not found]"}
end

View File

@@ -4,7 +4,7 @@ function scene.sceneInit()
BG.set('cubes')
local fileData=love.filesystem.read('parts/language/manual_'..(SETTING.locale:find'zh'and'zh'or'en')..'.txt')
if fileData then
WIDGET.active.texts:setTexts(STRING.split(fileData,'\n'))
WIDGET.active.texts:setTexts(fileData:split('\n'))
else
WIDGET.active.texts:setTexts{"[manual file not found]"}
end