mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add loaders (WIP)
This commit is contained in:
parent
4b234eb661
commit
9ca809ff94
6 changed files with 100 additions and 10 deletions
|
|
@ -220,7 +220,6 @@ void AssetsLoader::processPreloadList(AssetType tag, const dv::value& list) {
|
|||
}
|
||||
|
||||
void AssetsLoader::processPreloadConfig(const io::path& file) {
|
||||
logger.debug() << "===== PRELOAD FILE: " << file.string();
|
||||
auto root = io::read_json(file);
|
||||
processPreloadList(AssetType::ATLAS, root["atlases"]);
|
||||
processPreloadList(AssetType::FONT, root["fonts"]);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,11 @@ static void create_libs(State* L, StateType stateType) {
|
|||
getglobal(L, "__vc_app");
|
||||
setregistry(L, "app");
|
||||
|
||||
createtable(L, 0, 0);
|
||||
pushvalue(L, -1);
|
||||
setglobal(L, "__vc_internals");
|
||||
setregistry(L, "internals");
|
||||
|
||||
if (stateType == StateType::SCRIPT) {
|
||||
getregistry(L, "app");
|
||||
setglobal(L, "app");
|
||||
|
|
|
|||
|
|
@ -288,7 +288,23 @@ void scripting::on_content_load(Content* content) {
|
|||
lua::setfield(L, "properties");
|
||||
lua::pop(L);
|
||||
}
|
||||
load_script("post_content.lua", true);
|
||||
|
||||
lua::getregistry(L, "app");
|
||||
lua::setglobal(L, "__vc_app");
|
||||
lua::getregistry(L, "internals");
|
||||
lua::setglobal(L, "__vc_internals");
|
||||
try {
|
||||
load_script("post_content.lua", true);
|
||||
} catch (const std::exception&) {
|
||||
lua::pushnil(L);
|
||||
lua::setglobal(L, "__vc_app");
|
||||
throw;
|
||||
}
|
||||
lua::pushnil(L);
|
||||
lua::setglobal(L, "__vc_app");
|
||||
lua::pushnil(L);
|
||||
lua::setglobal(L, "__vc_internals");
|
||||
|
||||
load_script("stdcmd.lua", true);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue