fix lasers and keyboard on reload

This commit is contained in:
SamGondelman 2019-02-28 14:04:22 -08:00
parent 72f198fe00
commit 15064f0097
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