mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
implement blocks data conversion
This commit is contained in:
parent
28d746f371
commit
bc05716772
16 changed files with 341 additions and 23 deletions
|
|
@ -71,17 +71,37 @@ void show_convert_request(
|
|||
const std::shared_ptr<WorldFiles>& worldFiles,
|
||||
const runnable& postRunnable
|
||||
) {
|
||||
guiutil::confirm(
|
||||
engine->getGUI(),
|
||||
langs::get(report->isUpgradeRequired() ?
|
||||
L"world.upgrade-request" : L"world.convert-request"),
|
||||
[=]() {
|
||||
auto on_confirm = [=]() {
|
||||
auto converter =
|
||||
create_converter(engine, worldFiles, content, report, postRunnable);
|
||||
menus::show_process_panel(
|
||||
engine, converter, L"Converting world..."
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
std::wstring message = L"world.convert-request";
|
||||
if (report->isUpgradeRequired()) {
|
||||
message = L"world.upgrade-request";
|
||||
} else if (report->hasDataLoss()) {
|
||||
message = L"world.convert-with-loss";
|
||||
std::wstring text;
|
||||
for (const auto& line : report->getDataLoss()) {
|
||||
text += util::str2wstr_utf8(line) + L"\n";
|
||||
}
|
||||
guiutil::confirmWithMemo(
|
||||
engine->getGUI(),
|
||||
langs::get(message),
|
||||
text,
|
||||
on_confirm,
|
||||
L"",
|
||||
langs::get(L"Cancel")
|
||||
);
|
||||
return;
|
||||
}
|
||||
guiutil::confirm(
|
||||
engine->getGUI(),
|
||||
langs::get(message),
|
||||
on_confirm,
|
||||
L"",
|
||||
langs::get(L"Cancel")
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue