代码拉取完成,页面将自动刷新
-- This is the start script of QSanguosha
package.path = package.path .. ";./lua/lib/?.lua"
package.cpath = package.cpath .. ";./lua/clib/?.dll"
dofile "lua/sgs_ex.lua"
function load_translation(file)
local t = dofile(file)
if type(t) ~= "table" then
error(("file %s is should return a table!"):format(file))
end
sgs.LoadTranslationTable(t)
end
function load_translations()
local lang = sgs.GetConfig("Language", "zh_CN")
local lang_dir = "lang/" .. lang
local lang_files = sgs.GetFileNames(lang_dir)
for _, file in ipairs(lang_files) do
load_translation(("%s/%s"):format(lang_dir, file))
end
end
function load_extensions(just_require)
local scripts = sgs.GetFileNames("extensions")
for _, script in ipairs(scripts) do
if script:match(".+%.lua$") then
local name = script:sub(script:find("%w+"))
local module_name = "extensions." .. name
local loaded = require(module_name)
sgs.Sanguosha:addPackage(loaded.extension)
end
end
end
if not sgs.GetConfig("DisableLua", false) then
load_extensions()
end
local done_loading = sgs.Sanguosha:property("DoneLoading"):toBool()
if not done_loading then
load_translations()
done_loading = sgs.QVariant(true)
sgs.Sanguosha:setProperty("DoneLoading", done_loading)
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。