History

Functionnal version of minecraft import

atlante45 committed 13 years ago

Commit 6c840a91 parent bf475763 files · +344 −187Browse files

Showing the changes to interface/src/Application.cpp (1 of 3 files). Show all

Unified · Split

interface/src/Application.cpp+9−7
@@ -1322,7 +1322,7 @@ void Application::exportVoxels() { · 1321 unmodified lines
13221322 void Application::importVoxels() {
13231323 QString desktopLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
13241324 QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation,
1325− tr("Sparse Voxel Octree Files, Square PNG (*.svo *.png)"));
1325+ tr("Sparse Voxel Octree Files, Square PNG, Schematic Files (*.svo *.png *.schematic)"));
13261326 QByteArray fileNameAscii = fileNameString.toAscii();
13271327 const char* fileName = fileNameAscii.data();
13281328
@@ -1343,8 +1343,10 @@ void Application::importVoxels() { · 14 unmodified lines
13431343 }
13441344
13451345 importVoxels.readFromSquareARGB32Pixels(pixels, pngImage.height());
1346− } else {
1346+ } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {
13471347 importVoxels.readFromSVOFile(fileName);
1348+ } else {
1349+ importVoxels.readFromSchematicsFile(fileName);
13481350 }
13491351
13501352 VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
@@ -1534,11 +1536,11 @@ void Application::initMenu() { · 183 unmodified lines
15341536 _voxelPaintColor->setIcon(createSwatchIcon(paintColor));
15351537 (_destructiveAddVoxel = voxelMenu->addAction("Create Voxel is Destructive"))->setCheckable(true);
15361538
1537− voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E);
1538− voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I);
1539− voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X);
1540− voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C);
1541− voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V);
1539+ voxelMenu->addAction("Export Voxels", this, SLOT(exportVoxels()), Qt::CTRL | Qt::Key_E);
1540+ voxelMenu->addAction("Import Voxels", this, SLOT(importVoxels()), Qt::CTRL | Qt::Key_I);
1541+ voxelMenu->addAction("Cut Voxels", this, SLOT(cutVoxels()), Qt::CTRL | Qt::Key_X);
1542+ voxelMenu->addAction("Copy Voxels", this, SLOT(copyVoxels()), Qt::CTRL | Qt::Key_C);
1543+ voxelMenu->addAction("Paste Voxels", this, SLOT(pasteVoxels()), Qt::CTRL | Qt::Key_V);
15421544
15431545 QMenu* debugMenu = menuBar->addMenu("Debug");
15441546

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t