add file.name(), file.stem() & add 'path' to pack info & add start_coroutine()
This commit is contained in:
parent
c51a7e0153
commit
136c35591c
@ -120,3 +120,15 @@ file.read_combined_object(path: str) -> array
|
|||||||
```
|
```
|
||||||
|
|
||||||
Combines objects from JSON files of different packs.
|
Combines objects from JSON files of different packs.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
file.name(path: str) --> str
|
||||||
|
```
|
||||||
|
|
||||||
|
Extracts the file name from the path.
|
||||||
|
|
||||||
|
``lua
|
||||||
|
file.stem(path: str) --> str
|
||||||
|
```
|
||||||
|
|
||||||
|
Extracts the file name from the path, removing the extension.
|
||||||
|
|||||||
@ -83,6 +83,7 @@ pack.get_info(packid: str) -> {
|
|||||||
creator: str,
|
creator: str,
|
||||||
description: str,
|
description: str,
|
||||||
version: str,
|
version: str,
|
||||||
|
path: str,
|
||||||
icon: str, -- not available in headless mode
|
icon: str, -- not available in headless mode
|
||||||
dependencies: optional strings array
|
dependencies: optional strings array
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,3 +120,15 @@ file.read_combined_object(путь: str) -> массив
|
|||||||
```
|
```
|
||||||
|
|
||||||
Совмещает объекты из JSON файлов разных паков.
|
Совмещает объекты из JSON файлов разных паков.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
file.name(путь: str) --> str
|
||||||
|
```
|
||||||
|
|
||||||
|
Извлекает имя файла из пути.
|
||||||
|
|
||||||
|
```lua
|
||||||
|
file.stem(путь: str) --> str
|
||||||
|
```
|
||||||
|
|
||||||
|
Извлекает имя файла из пути, удаляя расширение.
|
||||||
|
|||||||
@ -70,6 +70,7 @@ pack.get_info(packid: str) -> {
|
|||||||
creator: str,
|
creator: str,
|
||||||
description: str,
|
description: str,
|
||||||
version: str,
|
version: str,
|
||||||
|
path: str,
|
||||||
icon: str, -- отсутствует в headless режиме
|
icon: str, -- отсутствует в headless режиме
|
||||||
dependencies: опциональный массив строк
|
dependencies: опциональный массив строк
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
settings = session.get_entry('new_world')
|
settings = session.get_entry('new_world')
|
||||||
|
|
||||||
function world_name_validator(name)
|
local function world_name_validator(name)
|
||||||
return name:match("^[%w-\\.\\ ]+$") ~= nil and not world.exists(name)
|
return name:match("^[%w-\\.\\ ]+$") ~= nil and not world.exists(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -163,7 +163,7 @@ function Document.new(docname)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local _RadioGroup = {}
|
local _RadioGroup = {}
|
||||||
function _RadioGroup.set(self, key)
|
function _RadioGroup:set(key)
|
||||||
if type(self) ~= 'table' then
|
if type(self) ~= 'table' then
|
||||||
error("called as non-OOP via '.', use radiogroup:set")
|
error("called as non-OOP via '.', use radiogroup:set")
|
||||||
end
|
end
|
||||||
@ -176,7 +176,7 @@ function _RadioGroup.set(self, key)
|
|||||||
self.callback(key)
|
self.callback(key)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function _RadioGroup.__call(self, elements, onset, default)
|
function _RadioGroup:__call(elements, onset, default)
|
||||||
local group = setmetatable({
|
local group = setmetatable({
|
||||||
elements=elements,
|
elements=elements,
|
||||||
callback=onset,
|
callback=onset,
|
||||||
@ -192,24 +192,6 @@ _GUI_ROOT = Document.new("core:root")
|
|||||||
_MENU = _GUI_ROOT.menu
|
_MENU = _GUI_ROOT.menu
|
||||||
menu = _MENU
|
menu = _MENU
|
||||||
|
|
||||||
local __post_runnables = {}
|
|
||||||
|
|
||||||
function __process_post_runnables()
|
|
||||||
if #__post_runnables then
|
|
||||||
for _, func in ipairs(__post_runnables) do
|
|
||||||
local status, result = xpcall(func, __vc__error)
|
|
||||||
if not status then
|
|
||||||
debug.error("error in post_runnable: "..result)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
__post_runnables = {}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function time.post_runnable(runnable)
|
|
||||||
table.insert(__post_runnables, runnable)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Console library extension ---
|
--- Console library extension ---
|
||||||
console.cheats = {}
|
console.cheats = {}
|
||||||
|
|
||||||
@ -409,6 +391,7 @@ function __vc_on_world_quit()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local __vc_coroutines = {}
|
local __vc_coroutines = {}
|
||||||
|
local __vc_named_coroutines = {}
|
||||||
local __vc_next_coroutine = 1
|
local __vc_next_coroutine = 1
|
||||||
local __vc_coroutine_error = nil
|
local __vc_coroutine_error = nil
|
||||||
|
|
||||||
@ -447,6 +430,45 @@ function __vc_stop_coroutine(id)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function start_coroutine(chunk, name)
|
||||||
|
local co = coroutine.create(function()
|
||||||
|
local status, error = xpcall(chunk, __vc__error)
|
||||||
|
if not status then
|
||||||
|
debug.error(error)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
__vc_named_coroutines[name] = co
|
||||||
|
end
|
||||||
|
|
||||||
|
local __post_runnables = {}
|
||||||
|
|
||||||
|
function __process_post_runnables()
|
||||||
|
if #__post_runnables then
|
||||||
|
for _, func in ipairs(__post_runnables) do
|
||||||
|
local status, result = xpcall(func, __vc__error)
|
||||||
|
if not status then
|
||||||
|
debug.error("error in post_runnable: "..result)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
__post_runnables = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
local dead = {}
|
||||||
|
for name, co in pairs(__vc_named_coroutines) do
|
||||||
|
coroutine.resume(co)
|
||||||
|
if coroutine.status(co) == "dead" then
|
||||||
|
table.insert(dead, name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for _, name in ipairs(dead) do
|
||||||
|
__vc_named_coroutines[name] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function time.post_runnable(runnable)
|
||||||
|
table.insert(__post_runnables, runnable)
|
||||||
|
end
|
||||||
|
|
||||||
assets = {}
|
assets = {}
|
||||||
assets.load_texture = core.__load_texture
|
assets.load_texture = core.__load_texture
|
||||||
|
|
||||||
|
|||||||
@ -361,3 +361,16 @@ function __vc_warning(msg, detail, n)
|
|||||||
"core:warning", msg, detail, debug.get_traceback(1 + (n or 0)))
|
"core:warning", msg, detail, debug.get_traceback(1 + (n or 0)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function file.name(path)
|
||||||
|
return path:match("([^:/\\]+)$")
|
||||||
|
end
|
||||||
|
|
||||||
|
function file.stem(path)
|
||||||
|
local name = file.name(path)
|
||||||
|
return name:match("(.+)%.[^%.]+$") or name
|
||||||
|
end
|
||||||
|
|
||||||
|
function file.ext(path)
|
||||||
|
return path:match("%.([^:/\\]+)$")
|
||||||
|
end
|
||||||
|
|||||||
@ -15,7 +15,7 @@ namespace fs = std::filesystem;
|
|||||||
|
|
||||||
ContentPack ContentPack::createCore(const EnginePaths& paths) {
|
ContentPack ContentPack::createCore(const EnginePaths& paths) {
|
||||||
return ContentPack {
|
return ContentPack {
|
||||||
"core", "Core", ENGINE_VERSION_STRING, "", "", paths.getResourcesFolder(), {}
|
"core", "Core", ENGINE_VERSION_STRING, "", "", paths.getResourcesFolder(), "res:", {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ static void checkContentPackId(const std::string& id, const fs::path& folder) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentPack ContentPack::read(const fs::path& folder) {
|
ContentPack ContentPack::read(const std::string& path, const fs::path& folder) {
|
||||||
auto root = files::read_json(folder / fs::path(PACKAGE_FILENAME));
|
auto root = files::read_json(folder / fs::path(PACKAGE_FILENAME));
|
||||||
ContentPack pack;
|
ContentPack pack;
|
||||||
root.at("id").get(pack.id);
|
root.at("id").get(pack.id);
|
||||||
@ -90,6 +90,7 @@ ContentPack ContentPack::read(const fs::path& folder) {
|
|||||||
root.at("description").get(pack.description);
|
root.at("description").get(pack.description);
|
||||||
root.at("source").get(pack.source);
|
root.at("source").get(pack.source);
|
||||||
pack.folder = folder;
|
pack.folder = folder;
|
||||||
|
pack.path = path;
|
||||||
|
|
||||||
if (auto found = root.at("dependencies")) {
|
if (auto found = root.at("dependencies")) {
|
||||||
const auto& dependencies = *found;
|
const auto& dependencies = *found;
|
||||||
@ -123,17 +124,19 @@ ContentPack ContentPack::read(const fs::path& folder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ContentPack::scanFolder(
|
void ContentPack::scanFolder(
|
||||||
const fs::path& folder, std::vector<ContentPack>& packs
|
const std::string& path, const fs::path& folder, std::vector<ContentPack>& packs
|
||||||
) {
|
) {
|
||||||
if (!fs::is_directory(folder)) {
|
if (!fs::is_directory(folder)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const auto& entry : fs::directory_iterator(folder)) {
|
for (const auto& entry : fs::directory_iterator(folder)) {
|
||||||
const fs::path& folder = entry.path();
|
const fs::path& packFolder = entry.path();
|
||||||
if (!fs::is_directory(folder)) continue;
|
if (!fs::is_directory(packFolder)) continue;
|
||||||
if (!is_pack(folder)) continue;
|
if (!is_pack(packFolder)) continue;
|
||||||
try {
|
try {
|
||||||
packs.push_back(read(folder));
|
packs.push_back(
|
||||||
|
read(path + "/" + packFolder.filename().string(), packFolder)
|
||||||
|
);
|
||||||
} catch (const contentpack_error& err) {
|
} catch (const contentpack_error& err) {
|
||||||
std::cerr << "package.json error at " << err.getFolder().u8string();
|
std::cerr << "package.json error at " << err.getFolder().u8string();
|
||||||
std::cerr << ": " << err.what() << std::endl;
|
std::cerr << ": " << err.what() << std::endl;
|
||||||
|
|||||||
@ -10,18 +10,18 @@
|
|||||||
|
|
||||||
class EnginePaths;
|
class EnginePaths;
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
|
||||||
|
|
||||||
class contentpack_error : public std::runtime_error {
|
class contentpack_error : public std::runtime_error {
|
||||||
std::string packId;
|
std::string packId;
|
||||||
fs::path folder;
|
std::filesystem::path folder;
|
||||||
public:
|
public:
|
||||||
contentpack_error(
|
contentpack_error(
|
||||||
std::string packId, fs::path folder, const std::string& message
|
std::string packId,
|
||||||
|
std::filesystem::path folder,
|
||||||
|
const std::string& message
|
||||||
);
|
);
|
||||||
|
|
||||||
std::string getPackId() const;
|
std::string getPackId() const;
|
||||||
fs::path getFolder() const;
|
std::filesystem::path getFolder() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class DependencyLevel {
|
enum class DependencyLevel {
|
||||||
@ -42,45 +42,52 @@ struct ContentPack {
|
|||||||
std::string version = "0.0";
|
std::string version = "0.0";
|
||||||
std::string creator = "";
|
std::string creator = "";
|
||||||
std::string description = "no description";
|
std::string description = "no description";
|
||||||
fs::path folder;
|
std::filesystem::path folder;
|
||||||
|
std::string path;
|
||||||
std::vector<DependencyPack> dependencies;
|
std::vector<DependencyPack> dependencies;
|
||||||
std::string source = "";
|
std::string source = "";
|
||||||
|
|
||||||
fs::path getContentFile() const;
|
std::filesystem::path getContentFile() const;
|
||||||
|
|
||||||
static inline const std::string PACKAGE_FILENAME = "package.json";
|
static inline const std::string PACKAGE_FILENAME = "package.json";
|
||||||
static inline const std::string CONTENT_FILENAME = "content.json";
|
static inline const std::string CONTENT_FILENAME = "content.json";
|
||||||
static inline const fs::path BLOCKS_FOLDER = "blocks";
|
static inline const std::filesystem::path BLOCKS_FOLDER = "blocks";
|
||||||
static inline const fs::path ITEMS_FOLDER = "items";
|
static inline const std::filesystem::path ITEMS_FOLDER = "items";
|
||||||
static inline const fs::path ENTITIES_FOLDER = "entities";
|
static inline const std::filesystem::path ENTITIES_FOLDER = "entities";
|
||||||
static inline const fs::path GENERATORS_FOLDER = "generators";
|
static inline const std::filesystem::path GENERATORS_FOLDER = "generators";
|
||||||
static const std::vector<std::string> RESERVED_NAMES;
|
static const std::vector<std::string> RESERVED_NAMES;
|
||||||
|
|
||||||
static bool is_pack(const fs::path& folder);
|
static bool is_pack(const std::filesystem::path& folder);
|
||||||
static ContentPack read(const fs::path& folder);
|
static ContentPack read(
|
||||||
|
const std::string& path, const std::filesystem::path& folder
|
||||||
static void scanFolder(
|
|
||||||
const fs::path& folder, std::vector<ContentPack>& packs
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static std::vector<std::string> worldPacksList(const fs::path& folder);
|
static void scanFolder(
|
||||||
|
const std::string& path,
|
||||||
|
const std::filesystem::path& folder,
|
||||||
|
std::vector<ContentPack>& packs
|
||||||
|
);
|
||||||
|
|
||||||
static fs::path findPack(
|
static std::vector<std::string> worldPacksList(
|
||||||
|
const std::filesystem::path& folder
|
||||||
|
);
|
||||||
|
|
||||||
|
static std::filesystem::path findPack(
|
||||||
const EnginePaths* paths,
|
const EnginePaths* paths,
|
||||||
const fs::path& worldDir,
|
const std::filesystem::path& worldDir,
|
||||||
const std::string& name
|
const std::string& name
|
||||||
);
|
);
|
||||||
|
|
||||||
static ContentPack createCore(const EnginePaths&);
|
static ContentPack createCore(const EnginePaths&);
|
||||||
|
|
||||||
static inline fs::path getFolderFor(ContentType type) {
|
static inline std::filesystem::path getFolderFor(ContentType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ContentType::BLOCK: return ContentPack::BLOCKS_FOLDER;
|
case ContentType::BLOCK: return ContentPack::BLOCKS_FOLDER;
|
||||||
case ContentType::ITEM: return ContentPack::ITEMS_FOLDER;
|
case ContentType::ITEM: return ContentPack::ITEMS_FOLDER;
|
||||||
case ContentType::ENTITY: return ContentPack::ENTITIES_FOLDER;
|
case ContentType::ENTITY: return ContentPack::ENTITIES_FOLDER;
|
||||||
case ContentType::GENERATOR: return ContentPack::GENERATORS_FOLDER;
|
case ContentType::GENERATOR: return ContentPack::GENERATORS_FOLDER;
|
||||||
case ContentType::NONE: return fs::u8path("");
|
case ContentType::NONE: return std::filesystem::u8path("");
|
||||||
default: return fs::u8path("");
|
default: return std::filesystem::u8path("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
PacksManager::PacksManager() = default;
|
PacksManager::PacksManager() = default;
|
||||||
|
|
||||||
void PacksManager::setSources(std::vector<fs::path> sources) {
|
void PacksManager::setSources(std::vector<std::pair<std::string, fs::path>> sources) {
|
||||||
this->sources = std::move(sources);
|
this->sources = std::move(sources);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ void PacksManager::scan() {
|
|||||||
packs.clear();
|
packs.clear();
|
||||||
|
|
||||||
std::vector<ContentPack> packsList;
|
std::vector<ContentPack> packsList;
|
||||||
for (auto& folder : sources) {
|
for (auto& [path, folder] : sources) {
|
||||||
ContentPack::scanFolder(folder, packsList);
|
ContentPack::scanFolder(path, folder, packsList);
|
||||||
for (auto& pack : packsList) {
|
for (auto& pack : packsList) {
|
||||||
packs.try_emplace(pack.id, pack);
|
packs.try_emplace(pack.id, pack);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,12 +10,12 @@ namespace fs = std::filesystem;
|
|||||||
|
|
||||||
class PacksManager {
|
class PacksManager {
|
||||||
std::unordered_map<std::string, ContentPack> packs;
|
std::unordered_map<std::string, ContentPack> packs;
|
||||||
std::vector<fs::path> sources;
|
std::vector<std::pair<std::string, fs::path>> sources;
|
||||||
public:
|
public:
|
||||||
PacksManager();
|
PacksManager();
|
||||||
|
|
||||||
/// @brief Set content packs sources (search folders)
|
/// @brief Set content packs sources (search folders)
|
||||||
void setSources(std::vector<fs::path> sources);
|
void setSources(std::vector<std::pair<std::string, fs::path>> sources);
|
||||||
|
|
||||||
/// @brief Scan sources and collect all found packs excluding duplication.
|
/// @brief Scan sources and collect all found packs excluding duplication.
|
||||||
/// Scanning order depends on sources order
|
/// Scanning order depends on sources order
|
||||||
|
|||||||
@ -262,9 +262,9 @@ cmd::CommandsInterpreter* Engine::getCommandsInterpreter() {
|
|||||||
PacksManager Engine::createPacksManager(const fs::path& worldFolder) {
|
PacksManager Engine::createPacksManager(const fs::path& worldFolder) {
|
||||||
PacksManager manager;
|
PacksManager manager;
|
||||||
manager.setSources({
|
manager.setSources({
|
||||||
worldFolder/fs::path("content"),
|
{"world:content", worldFolder.empty() ? worldFolder : worldFolder/fs::path("content")},
|
||||||
paths.getUserFilesFolder()/fs::path("content"),
|
{"user:content", paths.getUserFilesFolder()/fs::path("content")},
|
||||||
paths.getResourcesFolder()/fs::path("content")
|
{"res:content", paths.getResourcesFolder()/fs::path("content")}
|
||||||
});
|
});
|
||||||
return manager;
|
return manager;
|
||||||
}
|
}
|
||||||
@ -413,11 +413,12 @@ void Engine::loadWorldContent(const fs::path& folder) {
|
|||||||
contentPacks.clear();
|
contentPacks.clear();
|
||||||
auto packNames = ContentPack::worldPacksList(folder);
|
auto packNames = ContentPack::worldPacksList(folder);
|
||||||
PacksManager manager;
|
PacksManager manager;
|
||||||
manager.setSources({
|
manager.setSources(
|
||||||
folder/fs::path("content"),
|
{{"world:content",
|
||||||
paths.getUserFilesFolder()/fs::path("content"),
|
folder.empty() ? folder : folder / fs::path("content")},
|
||||||
paths.getResourcesFolder()/fs::path("content")
|
{"user:content", paths.getUserFilesFolder() / fs::path("content")},
|
||||||
});
|
{"res:content", paths.getResourcesFolder() / fs::path("content")}}
|
||||||
|
);
|
||||||
manager.scan();
|
manager.scan();
|
||||||
contentPacks = manager.getAll(manager.assemble(packNames));
|
contentPacks = manager.getAll(manager.assemble(packNames));
|
||||||
paths.setCurrentWorldFolder(folder);
|
paths.setCurrentWorldFolder(folder);
|
||||||
|
|||||||
@ -64,7 +64,7 @@ static int l_pack_get_available(lua::State* L) {
|
|||||||
static int l_pack_get_info(
|
static int l_pack_get_info(
|
||||||
lua::State* L, const ContentPack& pack, const Content* content
|
lua::State* L, const ContentPack& pack, const Content* content
|
||||||
) {
|
) {
|
||||||
lua::createtable(L, 0, 5);
|
lua::createtable(L, 0, 6);
|
||||||
|
|
||||||
lua::pushstring(L, pack.id);
|
lua::pushstring(L, pack.id);
|
||||||
lua::setfield(L, "id");
|
lua::setfield(L, "id");
|
||||||
@ -81,6 +81,9 @@ static int l_pack_get_info(
|
|||||||
lua::pushstring(L, pack.version);
|
lua::pushstring(L, pack.version);
|
||||||
lua::setfield(L, "version");
|
lua::setfield(L, "version");
|
||||||
|
|
||||||
|
lua::pushstring(L, pack.path);
|
||||||
|
lua::setfield(L, "path");
|
||||||
|
|
||||||
if (!engine->isHeadless()) {
|
if (!engine->isHeadless()) {
|
||||||
auto assets = engine->getAssets();
|
auto assets = engine->getAssets();
|
||||||
std::string icon = pack.id + ".icon";
|
std::string icon = pack.id + ".icon";
|
||||||
|
|||||||
@ -44,7 +44,6 @@ static void create_libs(State* L, StateType stateType) {
|
|||||||
openlib(L, "bjson", bjsonlib);
|
openlib(L, "bjson", bjsonlib);
|
||||||
openlib(L, "block", blocklib);
|
openlib(L, "block", blocklib);
|
||||||
openlib(L, "byteutil", byteutillib);
|
openlib(L, "byteutil", byteutillib);
|
||||||
openlib(L, "core", corelib);
|
|
||||||
openlib(L, "file", filelib);
|
openlib(L, "file", filelib);
|
||||||
openlib(L, "generation", generationlib);
|
openlib(L, "generation", generationlib);
|
||||||
openlib(L, "item", itemlib);
|
openlib(L, "item", itemlib);
|
||||||
@ -52,7 +51,6 @@ static void create_libs(State* L, StateType stateType) {
|
|||||||
openlib(L, "mat4", mat4lib);
|
openlib(L, "mat4", mat4lib);
|
||||||
openlib(L, "pack", packlib);
|
openlib(L, "pack", packlib);
|
||||||
openlib(L, "quat", quatlib);
|
openlib(L, "quat", quatlib);
|
||||||
openlib(L, "time", timelib);
|
|
||||||
openlib(L, "toml", tomllib);
|
openlib(L, "toml", tomllib);
|
||||||
openlib(L, "utf8", utf8lib);
|
openlib(L, "utf8", utf8lib);
|
||||||
openlib(L, "vec2", vec2lib);
|
openlib(L, "vec2", vec2lib);
|
||||||
@ -61,16 +59,20 @@ static void create_libs(State* L, StateType stateType) {
|
|||||||
|
|
||||||
if (stateType == StateType::SCRIPT) {
|
if (stateType == StateType::SCRIPT) {
|
||||||
openlib(L, "app", applib);
|
openlib(L, "app", applib);
|
||||||
|
} else if (stateType == StateType::BASE) {
|
||||||
|
openlib(L, "__vc_app", applib);
|
||||||
}
|
}
|
||||||
if (stateType == StateType::BASE || stateType == StateType::SCRIPT) {
|
if (stateType == StateType::BASE || stateType == StateType::SCRIPT) {
|
||||||
|
openlib(L, "audio", audiolib);
|
||||||
|
openlib(L, "console", consolelib);
|
||||||
|
openlib(L, "core", corelib);
|
||||||
openlib(L, "gui", guilib);
|
openlib(L, "gui", guilib);
|
||||||
openlib(L, "input", inputlib);
|
openlib(L, "input", inputlib);
|
||||||
openlib(L, "inventory", inventorylib);
|
openlib(L, "inventory", inventorylib);
|
||||||
openlib(L, "world", worldlib);
|
|
||||||
openlib(L, "audio", audiolib);
|
|
||||||
openlib(L, "console", consolelib);
|
|
||||||
openlib(L, "player", playerlib);
|
|
||||||
openlib(L, "network", networklib);
|
openlib(L, "network", networklib);
|
||||||
|
openlib(L, "player", playerlib);
|
||||||
|
openlib(L, "time", timelib);
|
||||||
|
openlib(L, "world", worldlib);
|
||||||
|
|
||||||
openlib(L, "entities", entitylib);
|
openlib(L, "entities", entitylib);
|
||||||
openlib(L, "cameras", cameralib);
|
openlib(L, "cameras", cameralib);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user