mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
replace vc.get_project_args with vc.get_project_arg & rename table.merge_replace to table.extend
This commit is contained in:
parent
b1974405c6
commit
d9ae1fe6d4
3 changed files with 5 additions and 3 deletions
|
|
@ -57,7 +57,7 @@ function table.merge(t1, t2)
|
||||||
return t1
|
return t1
|
||||||
end
|
end
|
||||||
|
|
||||||
function table.merge_replace(t1, t2)
|
function table.extend(t1, t2)
|
||||||
for i, v in pairs(t2) do
|
for i, v in pairs(t2) do
|
||||||
if type(i) == "number" then
|
if type(i) == "number" then
|
||||||
t1[#t1 + 1] = v
|
t1[#t1 + 1] = v
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,9 @@ require "core:internal/extensions/file"
|
||||||
require "core:internal/extensions/table"
|
require "core:internal/extensions/table"
|
||||||
require "core:internal/extensions/string"
|
require "core:internal/extensions/string"
|
||||||
|
|
||||||
vc.get_project_args = table.copy(_vc_project_args)
|
vc.get_project_arg = function (name)
|
||||||
|
return _vc_project_args[name]
|
||||||
|
end
|
||||||
|
|
||||||
local bytearray = require "core:internal/bytearray"
|
local bytearray = require "core:internal/bytearray"
|
||||||
Bytearray = bytearray.FFIBytearray
|
Bytearray = bytearray.FFIBytearray
|
||||||
|
|
|
||||||
|
|
@ -1126,7 +1126,7 @@ static int l_gui_load_document(lua::State* L) {
|
||||||
auto env = scripting::create_doc_environment(parentEnv, alias);
|
auto env = scripting::create_doc_environment(parentEnv, alias);
|
||||||
// namespace extension
|
// namespace extension
|
||||||
if (lua::istable(L, 4)) {
|
if (lua::istable(L, 4)) {
|
||||||
if (lua::get_from(L, "table", "merge_replace")) {
|
if (lua::get_from(L, "table", "extend")) {
|
||||||
lua::pushenv(L, *env);
|
lua::pushenv(L, *env);
|
||||||
lua::pushvalue(L, 4);
|
lua::pushvalue(L, 4);
|
||||||
lua::call(L, 2, 0);
|
lua::call(L, 2, 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue