两个manual文件改为txt格式

说明书和法律信息场景找不到文件不会爆炸了
This commit is contained in:
MrZ626
2021-10-25 05:09:32 +08:00
parent 275e983f55
commit ff9b0abfc7
4 changed files with 13 additions and 6 deletions

View File

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

View File

@@ -2,7 +2,13 @@ local scene={}
function scene.sceneInit()
BG.set('cubes')
WIDGET.active.texts:setTexts(require("parts.language.manual_"..(SETTING.locale:find'zh'and'zh'or'en')))
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'))
else
WIDGET.active.texts:setTexts{"[manual file not found]"}
end
end
function scene.wheelMoved(_,y)