History

clear the face model URL if the username is changed in preferences

Stephen Birarda committed 13 years ago

Commit 26d5e2c1 parent 4b620261 file · +8 −4Browse files

Showing the changes to interface/src/Menu.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Menu.cpp+8−4
@@ -806,19 +806,18 @@ void Menu::editPreferences() { · 805 unmodified lines
806 806
807 QUrl faceModelURL(faceURLEdit->text());807 QUrl faceModelURL(faceURLEdit->text());
808 808
809
809 if (avatarUsernameEdit->text() != avatarUsername) {810 if (avatarUsernameEdit->text() != avatarUsername) {
810 // there has been a username change - set the new UUID on the avatar instance811 // there has been a username change - set the new UUID on the avatar instance
811 applicationInstance->getAvatar()->setUsername(avatarUsernameEdit->text());812 applicationInstance->getAvatar()->setUsername(avatarUsernameEdit->text());
812 813
813 if (faceModelURL.toString() == faceURLString) {814 if (faceModelURL.toString() == faceURLString) {
814 // if there was no change to the face model URL then ask the data-server for what it is815 // if there was no change to the face model URL then clear it and ask the data-server for what it is
816 applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(QUrl());
815 DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);817 DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);
816 }818 }
817 }819 }
818 820
819 QUrl avatarVoxelURL(avatarURL->text());
820 applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL);
821
822 if (faceModelURL.toString() != faceURLString) {821 if (faceModelURL.toString() != faceURLString) {
823 applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(faceModelURL);822 applicationInstance->getAvatar()->getHead().getBlendFace().setModelURL(faceModelURL);
824 823
@@ -827,6 +826,11 @@ void Menu::editPreferences() { · 2 unmodified lines
827 faceModelURL.toString().toLocal8Bit().constData());826 faceModelURL.toString().toLocal8Bit().constData());
828 }827 }
829 828
829 QUrl avatarVoxelURL(avatarURL->text());
830 applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL);
831
832
833
830 Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL);834 Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL);
831 835
832 applicationInstance->getAvatar()->getHead().setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());836 applicationInstance->getAvatar()->getHead().setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());