1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Partially implemented Setup Window

This commit is contained in:
Ivan Savenko
2023-03-11 00:57:55 +02:00
parent 6fe319329b
commit c3d78ba761
14 changed files with 578 additions and 99 deletions

View File

@@ -49,7 +49,7 @@ void CGeneralTextHandler::detectInstallParameters()
// load file that will be used for footprint generation
// this is one of the most text-heavy files in game and consists solely from translated texts
auto resource = CResourceHandler::get()->load(ResourceID("DATA/GENRLTXT.TXT", EResType::TEXT));
auto resource = CResourceHandler::get("core")->load(ResourceID("DATA/GENRLTXT.TXT", EResType::TEXT));
std::array<size_t, 256> charCount{};
std::array<double, 16> footprint{};
@@ -87,6 +87,9 @@ void CGeneralTextHandler::detectInstallParameters()
Settings language = settings.write["session"]["language"];
language->String() = knownLanguages[bestIndex];
Settings confidence = settings.write["session"]["languageDeviation"];
confidence->Float() = deviations[bestIndex];
Settings encoding = settings.write["session"]["encoding"];
encoding->String() = Languages::getLanguageOptions(knownLanguages[bestIndex]).encoding;
}