mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Language settings menu
This commit is contained in:
parent
e97eb441d5
commit
4de8759ea2
10 changed files with 104 additions and 33 deletions
|
|
@ -34,6 +34,7 @@
|
|||
using std::unique_ptr;
|
||||
using std::shared_ptr;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
using std::filesystem::path;
|
||||
using glm::vec3;
|
||||
using gui::GUI;
|
||||
|
|
@ -60,15 +61,13 @@ Engine::Engine(EngineSettings& settings, EnginePaths* paths, Content* content)
|
|||
Audio::initialize();
|
||||
gui = new GUI();
|
||||
|
||||
std::vector<const ContentPack*> packs;
|
||||
auto resdir = paths->getResources();
|
||||
auto base = std::make_unique<ContentPack>("base", resdir/path("content/base"));
|
||||
packs.push_back(base.get());
|
||||
contentPacks.push_back(ContentPack("base", resdir/path("content/base")));
|
||||
|
||||
if (settings.ui.language == "auto") {
|
||||
settings.ui.language = platform::detect_locale();
|
||||
}
|
||||
langs::setup(resdir, settings.ui.language, packs);
|
||||
langs::setup(resdir, settings.ui.language, contentPacks);
|
||||
std::cout << "-- initializing finished" << std::endl;
|
||||
}
|
||||
|
||||
|
|
@ -148,6 +147,10 @@ const Content* Engine::getContent() const {
|
|||
return content;
|
||||
}
|
||||
|
||||
vector<ContentPack>& Engine::getContentPacks() {
|
||||
return contentPacks;
|
||||
}
|
||||
|
||||
EnginePaths* Engine::getPaths() {
|
||||
return paths;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue