This commit is contained in:
MDR 2025-04-21 04:11:21 +08:00
parent 9d97b2fa99
commit 510d1573c0
9 changed files with 1235 additions and 1216 deletions

View File

@ -14,7 +14,8 @@ local world = ____global.world
local ____launcher = require("code.screens.launcher")
local mouseButtonMenu = ____launcher.mouseButtonMenu
local function textGen()
return {header = "(确定要退出吗?)\n{color=0xff3f3f}(本世界未保存的数据\n将会丢失。)", button1 = "继续游玩", button2 = "退出游戏"}
return { header = "(确定要退出吗?)\n{color=0xff3f3f}(本世界未保存的数据\n将会丢失。)", button1 = "继续游玩", button2 =
"退出游戏" }
end
local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
local screen
@ -68,7 +69,8 @@ local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
screen:attach(wrapper)
local ____self_2 = mouseButtonMenu(
wrapper,
{main = ST:populate(
{
main = ST:populate(
3,
function(i)
local content = ({ text.header, text.button1, text.button2 })[i + 1]
@ -114,7 +116,8 @@ local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
}
)
end
)},
)
},
"main"
)
____self_2["then"](

View File

@ -4,19 +4,32 @@ from tempfile import TemporaryDirectory
import subprocess
import shutil
import os
import re
import datetime
from tools import convert_zh_to_tw, import_translation_json
# Wasneet聲明
# 這個版本完全是依照「能跑就行」原則寫的,不准糾我錯!
# ========== 配置区域 ==========
IMPORTLANG = "zh_CN" # 語言選項
VERSION = "V1.1" # 版本號
WEBLATE_PATH = "/Deskto/psoutertale-weblate" # WEBLATE文件夾路徑須修改
SOURCE_DIR = Path("F:/Deskto/Petrichor-PSTVL").resolve()
# ==============================
IMPORTLANG = input("语言?(跳过则语言默认为zh_CN)") # 語言選項
if len(IMPORTLANG) == 0:
IMPORTLANG = "zh_CN"
VERSION = "v" + input("版本号?(跳过则记录构建日期)") # 版本號
if len(VERSION) == 1:
VERSION = "构建于" + str(datetime.date.today())
WEBLATE_PATH = os.path.abspath("../weblate")
BUILD_PATH = os.path.abspath("..") # MDR留其他有地方不认字符串啊qwq,以我的能力只会分开写了
SOURCE_DIR = Path("../source").resolve()
# 删除过时构建
os.chdir(BUILD_PATH) # MDR留抄的qwq
for file in os.listdir(BUILD_PATH):
if re.match(r'.+.love', file):
os.remove(file)
# ==============================
os.chdir("translate")
os.chdir(SOURCE_DIR / "translate")
# 拉取weblate仓库更改
print("🟡「提示」 Weblate文本獲取中...")
os.system(f"cd {WEBLATE_PATH} && git pull")
@ -31,7 +44,7 @@ for lua_file in src_text_path.glob("*.lua"):
os.chdir("..")
PROJECT_ROOT = SOURCE_DIR
LANG_IMAGES = SOURCE_DIR / "images" / IMPORTLANG
BUILD_OUTPUT = SOURCE_DIR / "translate" / "gamebuild" / f"Petrichor-{VERSION}.love"
BUILD_OUTPUT = f"{BUILD_PATH}/PETRICHOR-{IMPORTLANG} {VERSION}.love"
src_text_path = PROJECT_ROOT / "translate" / "src"
# 7z校驗

View File

@ -14,7 +14,8 @@ local world = ____global.world
local ____launcher = require("code.screens.launcher")
local mouseButtonMenu = ____launcher.mouseButtonMenu
local function textGen()
return {header = "(确定要退出吗?)\n{color=0xff3f3f}(本世界未保存的数据\n将会丢失。)", button1 = "继续游玩", button2 = "退出游戏"}
return { header = "(确定要退出吗?)\n{color=0xff3f3f}(本世界未保存的数据\n将会丢失。)", button1 = "继续游玩", button2 =
"退出游戏" }
end
local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
local screen
@ -68,7 +69,8 @@ local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
screen:attach(wrapper)
local ____self_2 = mouseButtonMenu(
wrapper,
{main = ST:populate(
{
main = ST:populate(
3,
function(i)
local content = ({ text.header, text.button1, text.button2 })[i + 1]
@ -114,7 +116,8 @@ local function acquit(assets, atlas, batch, ____debug, ____bindingPattern0)
}
)
end
)},
)
},
"main"
)
____self_2["then"](