From ff9b0abfc7c4eed65960bf46b122e9b2d8108734 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 25 Oct 2021 05:09:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A4=E4=B8=AAmanual=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=94=B9=E4=B8=BAtxt=E6=A0=BC=E5=BC=8F=20=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E4=B9=A6=E5=92=8C=E6=B3=95=E5=BE=8B=E4=BF=A1=E6=81=AF=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=87=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E7=88=86=E7=82=B8=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/language/{manual_en.lua => manual_en.txt} | 2 -- parts/language/{manual_zh.lua => manual_zh.txt} | 2 -- parts/scenes/legals.lua | 7 ++++++- parts/scenes/manual.lua | 8 +++++++- 4 files changed, 13 insertions(+), 6 deletions(-) rename parts/language/{manual_en.lua => manual_en.txt} (99%) rename parts/language/{manual_zh.lua => manual_zh.txt} (99%) 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)