mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Added switch to pasteMode after successful import.
This commit is contained in:
parent
64031701e1
commit
f24cd0ceba
1 changed files with 29 additions and 12 deletions
|
@ -309,8 +309,13 @@ Application::~Application() {
|
||||||
delete idleTimer;
|
delete idleTimer;
|
||||||
|
|
||||||
Menu::getInstance()->saveSettings();
|
Menu::getInstance()->saveSettings();
|
||||||
|
|
||||||
_rearMirrorTools->saveSettings(_settings);
|
_rearMirrorTools->saveSettings(_settings);
|
||||||
|
|
||||||
|
_sharedVoxelSystem.changeTree(new VoxelTree);
|
||||||
|
if (_voxelImporter) {
|
||||||
|
_voxelImporter->saveSettings(_settings);
|
||||||
|
delete _voxelImporter;
|
||||||
|
}
|
||||||
_settings->sync();
|
_settings->sync();
|
||||||
|
|
||||||
// let the avatar mixer know we're out
|
// let the avatar mixer know we're out
|
||||||
|
@ -331,7 +336,6 @@ Application::~Application() {
|
||||||
|
|
||||||
storeSizeAndPosition();
|
storeSizeAndPosition();
|
||||||
saveScripts();
|
saveScripts();
|
||||||
_sharedVoxelSystem.changeTree(new VoxelTree);
|
|
||||||
|
|
||||||
VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown
|
VoxelTreeElement::removeDeleteHook(&_voxels); // we don't need to do this processing on shutdown
|
||||||
Menu::getInstance()->deleteLater();
|
Menu::getInstance()->deleteLater();
|
||||||
|
@ -1296,8 +1300,14 @@ void Application::mousePressEvent(QMouseEvent* event) {
|
||||||
pasteVoxels();
|
pasteVoxels();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (event->button() == Qt::RightButton && Menu::getInstance()->isVoxelModeActionChecked()) {
|
} else if (event->button() == Qt::RightButton) {
|
||||||
deleteVoxelUnderCursor();
|
if (Menu::getInstance()->isVoxelModeActionChecked()) {
|
||||||
|
deleteVoxelUnderCursor();
|
||||||
|
}
|
||||||
|
if (_pasteMode) {
|
||||||
|
_pasteMode = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1707,13 +1717,19 @@ void Application::exportVoxels() {
|
||||||
void Application::importVoxels() {
|
void Application::importVoxels() {
|
||||||
if (!_voxelImporter) {
|
if (!_voxelImporter) {
|
||||||
_voxelImporter = new VoxelImporter(_window);
|
_voxelImporter = new VoxelImporter(_window);
|
||||||
_voxelImporter->init(_settings);
|
_voxelImporter->loadSettings(_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_voxelImporter->exec()) {
|
if (!_voxelImporter->exec()) {
|
||||||
qDebug("[DEBUG] Import succeeded.");
|
qDebug() << "[DEBUG] Import succeeded." << endl;
|
||||||
|
Menu::getInstance()->setIsOptionChecked(MenuOption::VoxelSelectMode, true);
|
||||||
|
_pasteMode = true;
|
||||||
} else {
|
} else {
|
||||||
qDebug("[DEBUG] Import failed.");
|
qDebug() << "[DEBUG] Import failed." << endl;
|
||||||
|
if (_sharedVoxelSystem.getTree() == _voxelImporter->getVoxelTree()) {
|
||||||
|
_sharedVoxelSystem.killLocalVoxels();
|
||||||
|
_sharedVoxelSystem.changeTree(&_clipboard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore the main window's active state
|
// restore the main window's active state
|
||||||
|
@ -1770,10 +1786,11 @@ void Application::pasteVoxels() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pasteVoxelsToOctalCode(octalCodeDestination);
|
pasteVoxelsToOctalCode(octalCodeDestination);
|
||||||
|
|
||||||
if (calculatedOctCode) {
|
if (calculatedOctCode) {
|
||||||
delete[] calculatedOctCode;
|
delete[] calculatedOctCode;
|
||||||
}
|
}
|
||||||
|
_pasteMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::findAxisAlignment() {
|
void Application::findAxisAlignment() {
|
||||||
|
@ -1845,6 +1862,7 @@ void Application::init() {
|
||||||
|
|
||||||
VoxelTreeElement::removeUpdateHook(&_sharedVoxelSystem);
|
VoxelTreeElement::removeUpdateHook(&_sharedVoxelSystem);
|
||||||
|
|
||||||
|
// Cleanup of the original shared tree
|
||||||
_sharedVoxelSystem.init();
|
_sharedVoxelSystem.init();
|
||||||
VoxelTree* tmpTree = _sharedVoxelSystem.getTree();
|
VoxelTree* tmpTree = _sharedVoxelSystem.getTree();
|
||||||
_sharedVoxelSystem.changeTree(&_clipboard);
|
_sharedVoxelSystem.changeTree(&_clipboard);
|
||||||
|
@ -1936,12 +1954,11 @@ void Application::init() {
|
||||||
_audio.init(_glWidget);
|
_audio.init(_glWidget);
|
||||||
|
|
||||||
_rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings);
|
_rearMirrorTools = new RearMirrorTools(_glWidget, _mirrorViewRect, _settings);
|
||||||
|
|
||||||
connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));
|
connect(_rearMirrorTools, SIGNAL(closeView()), SLOT(closeMirrorView()));
|
||||||
connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView()));
|
connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView()));
|
||||||
connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView()));
|
connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView()));
|
||||||
connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors()));
|
connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors()));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::closeMirrorView() {
|
void Application::closeMirrorView() {
|
||||||
|
@ -2090,7 +2107,7 @@ void Application::updateMouseVoxels(float deltaTime, float& distance, BoxFace& f
|
||||||
PerformanceWarning warn(showWarnings, "Application::updateMouseVoxels()");
|
PerformanceWarning warn(showWarnings, "Application::updateMouseVoxels()");
|
||||||
|
|
||||||
_mouseVoxel.s = 0.0f;
|
_mouseVoxel.s = 0.0f;
|
||||||
bool wasInitialized = _mouseVoxelScaleInitialized;
|
bool wasInitialized = _mouseVoxelScaleInitialized ;
|
||||||
if (Menu::getInstance()->isVoxelModeActionChecked() &&
|
if (Menu::getInstance()->isVoxelModeActionChecked() &&
|
||||||
(fabs(_myAvatar->getVelocity().x) +
|
(fabs(_myAvatar->getVelocity().x) +
|
||||||
fabs(_myAvatar->getVelocity().y) +
|
fabs(_myAvatar->getVelocity().y) +
|
||||||
|
|
Loading…
Reference in a new issue