Merge pull request #15058 from SamGondelman/reload

Case 21490: Fix lasers and keyboard on reload
This commit is contained in:
Shannon Romano 2019-03-01 09:31:56 -08:00 committed by GitHub
commit 00ca3bc933
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View file

@ -5770,6 +5770,11 @@ void Application::reloadResourceCaches() {
DependencyManager::get<NodeList>()->reset(); // Force redownload of .fst models
DependencyManager::get<ScriptEngines>()->reloadAllScripts();
getOffscreenUI()->clearCache();
DependencyManager::get<Keyboard>()->createKeyboard();
getMyAvatar()->resetFullAvatarURL();
}

View file

@ -259,6 +259,12 @@ void Keyboard::setUse3DKeyboard(bool use) {
void Keyboard::createKeyboard() {
auto pointerManager = DependencyManager::get<PointerManager>();
if (_created) {
pointerManager->removePointer(_leftHandStylus);
pointerManager->removePointer(_rightHandStylus);
clearKeyboardKeys();
}
QVariantMap modelProperties {
{ "url", MALLET_MODEL_URL }
};
@ -289,6 +295,8 @@ void Keyboard::createKeyboard() {
loadKeyboardFile(keyboardSvg);
_keySound = DependencyManager::get<SoundCache>()->getSound(SOUND_FILE);
_created = true;
}
bool Keyboard::isRaised() const {

View file

@ -193,6 +193,8 @@ private:
QSet<QUuid> _itemsToIgnore;
std::vector<QHash<QUuid, Key>> _keyboardLayers;
bool _created { false };
};
#endif