mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
dynamic::create_map, dynamic::create_list
This commit is contained in:
parent
7270e0ba24
commit
debdec1dc2
6 changed files with 27 additions and 9 deletions
|
|
@ -72,7 +72,7 @@ static void show_content_missing(
|
|||
std::shared_ptr<ContentLUT> lut
|
||||
) {
|
||||
using namespace dynamic;
|
||||
auto root = std::make_shared<Map>();
|
||||
auto root = create_map();
|
||||
auto& contentEntries = root->putList("content");
|
||||
for (auto& entry : lut->getMissingContent()) {
|
||||
std::string contentName = contenttype_name(entry.type);
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ dynamic::Value lua::LuaState::tovalue(int idx) {
|
|||
int len = lua_objlen(L, idx);
|
||||
if (len) {
|
||||
// array
|
||||
auto list = std::make_shared<List>();
|
||||
auto list = create_list();
|
||||
for (int i = 1; i <= len; i++) {
|
||||
lua_rawgeti(L, idx, i);
|
||||
list->put(tovalue(-1));
|
||||
|
|
@ -336,7 +336,7 @@ dynamic::Value lua::LuaState::tovalue(int idx) {
|
|||
return list;
|
||||
} else {
|
||||
// table
|
||||
auto map = std::make_shared<Map>();
|
||||
auto map = create_map();
|
||||
lua_pushvalue(L, idx);
|
||||
lua_pushnil(L);
|
||||
while (lua_next(L, -2)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue