整理代码
This commit is contained in:
1
main.lua
1
main.lua
@@ -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('')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user