2 Star 1 Fork 2

Ubun Tenkei / ConanSlash

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sanguosha.lua 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
Ubun Tenkei 提交于 2013-05-04 11:45 . UI AI改造 part2
-- 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
C++
1
https://gitee.com/ubun/conanslash.git
git@gitee.com:ubun/conanslash.git
ubun
conanslash
ConanSlash
master

搜索帮助