From 7ae40127f15f8f2cb963a7efeb018f7887ebc1ea Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 20 Dec 2018 18:29:16 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/embed/scripts/path.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/lua/embed/scripts/path.lua (limited to 'src/lua/embed/scripts/path.lua') diff --git a/src/lua/embed/scripts/path.lua b/src/lua/embed/scripts/path.lua new file mode 100644 index 0000000..f7e1ec3 --- /dev/null +++ b/src/lua/embed/scripts/path.lua @@ -0,0 +1,16 @@ +/* path.lua */ +static const char* path_lua = R"( +jin.path = jin.path or {} + +local jp = jin.path + +-- game root directory +jin._root = nil + +-- return full path of a given path +function jin.path.full(path) + local root = jin._dir .. '/' .. jin._argv[2] + return root .. '/' .. path +end + +)"; \ No newline at end of file -- cgit v1.1-26-g67d0