diff --git a/parts/language/manual_en.lua b/parts/language/manual_en.txt similarity index 99% rename from parts/language/manual_en.lua rename to parts/language/manual_en.txt index 38b87005..82e52d5b 100644 --- a/parts/language/manual_en.lua +++ b/parts/language/manual_en.txt @@ -1,4 +1,3 @@ -return STRING.split([=[ Gameplay: The system will provide you with tetrominoes (4-block pieces), with a total of 7 types, and the player needs to control them @@ -89,4 +88,3 @@ Custom mode: regular colored cells have to be made of the corresponding block; garbage-colored cells can be any block but not air. Once you make the shape, you will win. -]=],"\n") diff --git a/parts/language/manual_zh.lua b/parts/language/manual_zh.txt similarity index 99% rename from parts/language/manual_zh.lua rename to parts/language/manual_zh.txt index 9fc0870f..61260213 100644 --- a/parts/language/manual_zh.lua +++ b/parts/language/manual_zh.txt @@ -1,4 +1,3 @@ -return STRING.split([=[ 游戏方法: 系统会提供的一个个四连骨牌("方块",总共7种) 玩家需要控制(左右移动和旋转90,180,270度)这些骨牌直到下落到场地底部,锁定 @@ -73,4 +72,3 @@ back to back(B2B)点数说明: 普通的七种彩色方块必须颜色对应; 垃圾行方块的位置只要有方块就可以,但是不能是空气. 玩家拼出画的图后就会判定胜利. -]=],"\n") diff --git a/parts/scenes/legals.lua b/parts/scenes/legals.lua index 106a96f3..4e61408e 100644 --- a/parts/scenes/legals.lua +++ b/parts/scenes/legals.lua @@ -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) diff --git a/parts/scenes/manual.lua b/parts/scenes/manual.lua index 140df538..10b70bcf 100644 --- a/parts/scenes/manual.lua +++ b/parts/scenes/manual.lua @@ -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)