mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 04:37:48 +02:00
save settings for change in: identity, position
This commit is contained in:
parent
e08dfeae2a
commit
a436b59971
7 changed files with 16 additions and 4 deletions
|
@ -250,6 +250,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
|
||||||
QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
|
QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
|
||||||
|
|
||||||
_settings = new QSettings(this);
|
_settings = new QSettings(this);
|
||||||
|
_numChangedSettings = 0;
|
||||||
|
|
||||||
// Check to see if the user passed in a command line option for loading a local
|
// Check to see if the user passed in a command line option for loading a local
|
||||||
// Voxel File.
|
// Voxel File.
|
||||||
|
@ -406,6 +407,7 @@ void Application::saveSettings() {
|
||||||
_voxelImporter->saveSettings(_settings);
|
_voxelImporter->saveSettings(_settings);
|
||||||
}
|
}
|
||||||
_settings->sync();
|
_settings->sync();
|
||||||
|
_numChangedSettings = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1271,6 +1273,9 @@ void Application::idle() {
|
||||||
// After finishing all of the above work, restart the idle timer, allowing 2ms to process events.
|
// After finishing all of the above work, restart the idle timer, allowing 2ms to process events.
|
||||||
idleTimer->start(2);
|
idleTimer->start(2);
|
||||||
}
|
}
|
||||||
|
if (_numChangedSettings > 0) {
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1617,6 +1622,7 @@ void Application::init() {
|
||||||
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()));
|
||||||
|
connect(_myAvatar, SIGNAL(transformChanged()), this, SLOT(bumpSettings()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::closeMirrorView() {
|
void Application::closeMirrorView() {
|
||||||
|
|
|
@ -286,6 +286,8 @@ public slots:
|
||||||
void uploadHead();
|
void uploadHead();
|
||||||
void uploadSkeleton();
|
void uploadSkeleton();
|
||||||
|
|
||||||
|
void bumpSettings() { ++_numChangedSettings; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void timer();
|
void timer();
|
||||||
void idle();
|
void idle();
|
||||||
|
@ -376,6 +378,7 @@ private:
|
||||||
QNetworkAccessManager* _networkAccessManager;
|
QNetworkAccessManager* _networkAccessManager;
|
||||||
QMutex _settingsMutex;
|
QMutex _settingsMutex;
|
||||||
QSettings* _settings;
|
QSettings* _settings;
|
||||||
|
int _numChangedSettings;
|
||||||
|
|
||||||
QUndoStack _undoStack;
|
QUndoStack _undoStack;
|
||||||
|
|
||||||
|
|
|
@ -898,6 +898,7 @@ void Menu::editPreferences() {
|
||||||
|
|
||||||
if (shouldDispatchIdentityPacket) {
|
if (shouldDispatchIdentityPacket) {
|
||||||
applicationInstance->getAvatar()->sendIdentityPacket();
|
applicationInstance->getAvatar()->sendIdentityPacket();
|
||||||
|
applicationInstance->bumpSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());
|
applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());
|
||||||
|
@ -1063,7 +1064,6 @@ void Menu::goToLocation() {
|
||||||
QString currentLocation = QString("%1, %2, %3").arg(QString::number(avatarPos.x),
|
QString currentLocation = QString("%1, %2, %3").arg(QString::number(avatarPos.x),
|
||||||
QString::number(avatarPos.y), QString::number(avatarPos.z));
|
QString::number(avatarPos.y), QString::number(avatarPos.z));
|
||||||
|
|
||||||
|
|
||||||
QInputDialog coordinateDialog(Application::getInstance()->getWindow());
|
QInputDialog coordinateDialog(Application::getInstance()->getWindow());
|
||||||
coordinateDialog.setWindowTitle("Go to Location");
|
coordinateDialog.setWindowTitle("Go to Location");
|
||||||
coordinateDialog.setLabelText("Coordinate as x,y,z:");
|
coordinateDialog.setLabelText("Coordinate as x,y,z:");
|
||||||
|
|
|
@ -1175,6 +1175,7 @@ void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
|
||||||
glm::vec3 newPosition = glm::vec3(coordinateItems[0].toFloat(), coordinateItems[1].toFloat(),
|
glm::vec3 newPosition = glm::vec3(coordinateItems[0].toFloat(), coordinateItems[1].toFloat(),
|
||||||
coordinateItems[2].toFloat()) - newOrientation * IDENTITY_FRONT * DISTANCE_TO_USER;
|
coordinateItems[2].toFloat()) - newOrientation * IDENTITY_FRONT * DISTANCE_TO_USER;
|
||||||
setPosition(newPosition);
|
setPosition(newPosition);
|
||||||
|
emit transformChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,9 @@ public slots:
|
||||||
glm::vec3 getThrust() { return _thrust; };
|
glm::vec3 getThrust() { return _thrust; };
|
||||||
void setThrust(glm::vec3 newThrust) { _thrust = newThrust; }
|
void setThrust(glm::vec3 newThrust) { _thrust = newThrust; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void transformChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _mousePressed;
|
bool _mousePressed;
|
||||||
float _bodyPitchDelta; // degrees
|
float _bodyPitchDelta; // degrees
|
||||||
|
|
|
@ -118,8 +118,6 @@ void LocationManager::checkForMultipleDestinations() {
|
||||||
Application::getInstance()->getAvatar()->goToLocationFromResponse(_placeData);
|
Application::getInstance()->getAvatar()->goToLocationFromResponse(_placeData);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit locationChanged();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +176,7 @@ void LocationManager::goToOrientation(QString orientation) {
|
||||||
glm::quat avatarOrientation = myAvatar->getOrientation();
|
glm::quat avatarOrientation = myAvatar->getOrientation();
|
||||||
if (newAvatarOrientation != avatarOrientation) {
|
if (newAvatarOrientation != avatarOrientation) {
|
||||||
myAvatar->setOrientation(newAvatarOrientation);
|
myAvatar->setOrientation(newAvatarOrientation);
|
||||||
|
emit myAvatar->transformChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -211,6 +210,7 @@ bool LocationManager::goToDestination(QString destination) {
|
||||||
|
|
||||||
qDebug("Going To Location: %f, %f, %f...", x, y, z);
|
qDebug("Going To Location: %f, %f, %f...", x, y, z);
|
||||||
myAvatar->setPosition(newAvatarPos);
|
myAvatar->setPosition(newAvatarPos);
|
||||||
|
emit myAvatar->transformChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -48,7 +48,6 @@ private:
|
||||||
signals:
|
signals:
|
||||||
void creationCompleted(LocationManager::NamedLocationCreateResponse response);
|
void creationCompleted(LocationManager::NamedLocationCreateResponse response);
|
||||||
void multipleDestinationsFound(const QJsonObject& userData, const QJsonObject& placeData);
|
void multipleDestinationsFound(const QJsonObject& userData, const QJsonObject& placeData);
|
||||||
void locationChanged();
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void namedLocationDataReceived(const QJsonObject& data);
|
void namedLocationDataReceived(const QJsonObject& data);
|
||||||
|
|
Loading…
Reference in a new issue