mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
move menu pages loader to Lua & add gui.load_document, file.ext(), file.prefix() & add core:gui_util module
This commit is contained in:
parent
da471bd4eb
commit
0a1a16299e
16 changed files with 156 additions and 55 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include "logic/EngineController.hpp"
|
||||
#include "logic/CommandsInterpreter.hpp"
|
||||
#include "logic/scripting/scripting.hpp"
|
||||
#include "logic/scripting/scripting_hud.hpp"
|
||||
#include "network/Network.hpp"
|
||||
#include "util/listutil.hpp"
|
||||
#include "util/platform.hpp"
|
||||
|
|
@ -123,11 +124,10 @@ Engine::Engine(CoreParameters coreParameters)
|
|||
paths.getResourcesFolder()
|
||||
));
|
||||
}
|
||||
scripting::initialize(this);
|
||||
keepAlive(settings.ui.language.observe([this](auto lang) {
|
||||
setLanguage(lang);
|
||||
}, true));
|
||||
|
||||
scripting::initialize(this);
|
||||
basePacks = files::read_list(resdir/fs::path("config/builtins.list"));
|
||||
}
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ void Engine::setScreen(std::shared_ptr<Screen> screen) {
|
|||
void Engine::setLanguage(std::string locale) {
|
||||
langs::setup(paths.getResourcesFolder(), std::move(locale), contentPacks);
|
||||
if (gui) {
|
||||
gui->getMenu()->setPageLoader(menus::create_page_loader(*this));
|
||||
gui->getMenu()->setPageLoader(scripting::create_page_loader());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue