From 9a866a129d4bc1c3298156055e4570e8fa6b7fb2 Mon Sep 17 00:00:00 2001 From: SamGondelman Date: Wed, 10 Jul 2019 10:20:27 -0700 Subject: [PATCH 1/7] fix text visibility toggle --- .../src/RenderableEntityItem.cpp | 15 ++++++++++----- .../src/RenderableTextEntityItem.cpp | 15 +-------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index f8bd6f8ce1..4320e72389 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -173,16 +173,21 @@ render::hifi::Layer EntityRenderer::getHifiRenderLayer() const { } ItemKey EntityRenderer::getKey() { + ItemKey::Builder builder = ItemKey::Builder().withTypeShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + if (isTransparent()) { - return ItemKey::Builder::transparentShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + builder.withTransparent(); } - // This allows shapes to cast shadows if (_canCastShadow) { - return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withShadowCaster().withLayer(getHifiRenderLayer()); - } else { - return ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(getTagMask()).withLayer(getHifiRenderLayer()); + builder.withShadowCaster(); } + + if (!_visible) { + builder.withInvisible(); + } + + return builder; } uint32_t EntityRenderer::metaFetchMetaSubItems(ItemIDs& subItems) const { diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp index 146b9861dc..0ead1de71a 100644 --- a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp @@ -282,20 +282,7 @@ ItemKey entities::TextPayload::getKey() const { auto renderable = entityTreeRenderer->renderableForEntityId(_entityID); if (renderable) { auto textRenderable = std::static_pointer_cast(renderable); - ItemKey::Builder key; - // Similar to EntityRenderer::getKey() - if (textRenderable->isTextTransparent()) { - key = ItemKey::Builder::transparentShape().withSubMetaCulled().withTagBits(textRenderable->getTagMask()).withLayer(textRenderable->getHifiRenderLayer()); - } else if (textRenderable->_canCastShadow) { - key = ItemKey::Builder::opaqueShape().withSubMetaCulled().withTagBits(textRenderable->getTagMask()).withShadowCaster().withLayer(textRenderable->getHifiRenderLayer()); - } else { - key = ItemKey::Builder::opaqueShape().withSubMetaCulled().withTagBits(textRenderable->getTagMask()).withLayer(textRenderable->getHifiRenderLayer()); - } - - if (!textRenderable->_visible) { - key.withInvisible(); - } - return key; + return ItemKey::Builder(textRenderable->getKey()).withoutMetaCullGroup().withSubMetaCulled(); } } return ItemKey::Builder::opaqueShape(); From a64d307bdf086538d6834d77f4146e6f5e8fbf35 Mon Sep 17 00:00:00 2001 From: Sam Gondelman Date: Wed, 10 Jul 2019 14:21:56 -0700 Subject: [PATCH 2/7] make sure we don't have transparent shadow casters --- libraries/entities-renderer/src/RenderableEntityItem.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableEntityItem.cpp b/libraries/entities-renderer/src/RenderableEntityItem.cpp index 4320e72389..11e369b532 100644 --- a/libraries/entities-renderer/src/RenderableEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableEntityItem.cpp @@ -177,9 +177,7 @@ ItemKey EntityRenderer::getKey() { if (isTransparent()) { builder.withTransparent(); - } - - if (_canCastShadow) { + } else if (_canCastShadow) { builder.withShadowCaster(); } From c8ed1e369d9a7d53e55d0f7bd703f96e62af2fc2 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 10 Jul 2019 15:45:14 -0700 Subject: [PATCH 3/7] Trim spaces on orgname and username --- launchers/win32/LauncherDlg.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/launchers/win32/LauncherDlg.cpp b/launchers/win32/LauncherDlg.cpp index 1b6b16d303..704a2f3050 100644 --- a/launchers/win32/LauncherDlg.cpp +++ b/launchers/win32/LauncherDlg.cpp @@ -9,6 +9,7 @@ // #include "stdafx.h" +#include #include "LauncherApp.h" #include "LauncherDlg.h" @@ -268,7 +269,10 @@ afx_msg void CLauncherDlg::OnNextClicked() { m_orgname.GetWindowTextW(orgname); m_username.GetWindowTextW(username); m_password.GetWindowTextW(password); - + // trim spaces + orgname = CString(std::regex_replace(LauncherUtils::cStringToStd(orgname), std::regex("^ +| +$|( ) +"), "$1").c_str()); + username = CString(std::regex_replace(LauncherUtils::cStringToStd(username), std::regex("^ +| +$|( ) +"), "$1").c_str()); + // encode username = LauncherUtils::urlEncodeString(username); password = LauncherUtils::urlEncodeString(password); LauncherUtils::ResponseError error; From 94002436e917a4325fe5d45a8816e423c84cd366 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 10 Jul 2019 16:05:24 -0700 Subject: [PATCH 4/7] Override default script --- launchers/win32/LauncherManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/launchers/win32/LauncherManager.cpp b/launchers/win32/LauncherManager.cpp index e6c950596c..48202d51e9 100644 --- a/launchers/win32/LauncherManager.cpp +++ b/launchers/win32/LauncherManager.cpp @@ -296,8 +296,8 @@ HWND LauncherManager::launchApplication() { LauncherManager::getAndCreatePaths(PathType::Interface_Directory, installDir); CString interfaceExe = installDir + _T("\\interface.exe"); CString urlParam = _T("--url \"") + _domainURL + ("\" "); - CString scriptsURL = installDir + _T("\\scripts\\simplifiedUI"); - CString scriptsParam = _T("--scripts \"") + scriptsURL + ("\" "); + CString scriptsURL = installDir + _T("\\scripts\\simplifiedUIBootstrapper.js"); + CString scriptsParam = _T("--defaultScriptsOverride \"") + scriptsURL + ("\" "); CString cacheDir; LauncherManager::getAndCreatePaths(PathType::Content_Directory, cacheDir); CString cacheParam = _T("--cache \"") + cacheDir + ("\" "); From 562a181377e8c8341d264d3480f13ad37bc36930 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 10 Jul 2019 16:56:17 -0700 Subject: [PATCH 5/7] replace backslashes on script override --- launchers/win32/LauncherManager.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/launchers/win32/LauncherManager.cpp b/launchers/win32/LauncherManager.cpp index 48202d51e9..e56e0e71fc 100644 --- a/launchers/win32/LauncherManager.cpp +++ b/launchers/win32/LauncherManager.cpp @@ -297,6 +297,7 @@ HWND LauncherManager::launchApplication() { CString interfaceExe = installDir + _T("\\interface.exe"); CString urlParam = _T("--url \"") + _domainURL + ("\" "); CString scriptsURL = installDir + _T("\\scripts\\simplifiedUIBootstrapper.js"); + scriptsURL.Replace(_T("\\"), _T("/")); CString scriptsParam = _T("--defaultScriptsOverride \"") + scriptsURL + ("\" "); CString cacheDir; LauncherManager::getAndCreatePaths(PathType::Content_Directory, cacheDir); From 2ffacfea83ecedc643b5aaa59e94cc7fb300e912 Mon Sep 17 00:00:00 2001 From: dante ruiz Date: Thu, 11 Jul 2019 08:51:47 -0700 Subject: [PATCH 6/7] change script params --- launchers/darwin/src/Launcher.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launchers/darwin/src/Launcher.m b/launchers/darwin/src/Launcher.m index 71eb7828e9..1a84e9143d 100644 --- a/launchers/darwin/src/Launcher.m +++ b/launchers/darwin/src/Launcher.m @@ -442,7 +442,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; NSString* contentPath = [[self getDownloadPathForContentAndScripts] stringByAppendingString:@"content"]; NSString* displayName = [ self displayName]; - NSString* scriptsPath = [[self getAppPath] stringByAppendingString:@"interface.app/Contents/Resources/scripts/simplifiedUI/"]; + NSString* scriptsPath = [[self getAppPath] stringByAppendingString:@"interface.app/Contents/Resources/scripts/simplifiedUIBootstrapper.js"]; NSString* domainUrl = [[Settings sharedSettings] getDomainUrl]; NSString* userToken = [[Launcher sharedLauncher] getTokenString]; NSString* homeBookmark = [[NSString stringWithFormat:@"hqhome="] stringByAppendingString:domainUrl]; @@ -453,7 +453,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; @"--tokens", userToken, @"--cache", contentPath, @"--displayName", displayName, - @"--scripts", scriptsPath, + @"--defaultScriptsOverride", scriptsPath, @"--setBookmark", homeBookmark, @"--no-updater", @"--no-launcher", nil]; @@ -461,7 +461,7 @@ static BOOL const DELETE_ZIP_FILES = TRUE; arguments = [NSArray arrayWithObjects: @"--url" , domainUrl, @"--cache", contentPath, - @"--scripts", scriptsPath, + @"--defaultScriptsOverride", scriptsPath, @"--setBookmark", homeBookmark, @"--no-updater", @"--no-launcher", nil]; From 07c71cbadbc01dfd9a756b1f5b1e17b48d7179b3 Mon Sep 17 00:00:00 2001 From: PrestonB1123 Date: Thu, 11 Jul 2019 12:05:15 -0700 Subject: [PATCH 7/7] disabled P shortcut and re-enabled in metaverse --- interface/src/Application.cpp | 21 ------------------- .../keyboardShortcuts/keyboardShortcuts.js | 8 +++++++ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b59fd223ba..a6f7e63247 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4429,27 +4429,6 @@ void Application::keyPressEvent(QKeyEvent* event) { } break; - case Qt::Key_P: { - if (!isShifted && !isMeta && !isOption && !event->isAutoRepeat()) { - AudioInjectorOptions options; - options.localOnly = true; - options.positionSet = false; // system sound - options.stereo = true; - - Setting::Handle notificationSounds{ MenuOption::NotificationSounds, true }; - Setting::Handle notificationSoundSnapshot{ MenuOption::NotificationSoundsSnapshot, true }; - if (notificationSounds.get() && notificationSoundSnapshot.get()) { - if (_snapshotSoundInjector) { - DependencyManager::get()->setOptionsAndRestart(_snapshotSoundInjector, options); - } else { - _snapshotSoundInjector = DependencyManager::get()->playSound(_snapshotSound, options); - } - } - takeSnapshot(true); - } - break; - } - case Qt::Key_Apostrophe: { if (isMeta) { auto cursor = Cursor::Manager::instance().getCursor(); diff --git a/scripts/system/keyboardShortcuts/keyboardShortcuts.js b/scripts/system/keyboardShortcuts/keyboardShortcuts.js index cf3927ac2d..165928d089 100644 --- a/scripts/system/keyboardShortcuts/keyboardShortcuts.js +++ b/scripts/system/keyboardShortcuts/keyboardShortcuts.js @@ -12,11 +12,19 @@ // (function () { // BEGIN LOCAL_SCOPE + var snapActivateSound = SoundCache.getSound(Script.resourcesPath() + "sounds/snapshot/snap.wav"); function keyPressEvent(event) { if (event.text.toUpperCase() === "B" && event.isControl) { Window.openWebBrowser(); } else if (event.text.toUpperCase() === "N" && event.isControl) { Users.toggleIgnoreRadius(); + } else if (event.text.toUpperCase() === "P") { + Audio.playSound(snapActivateSound, { + position: { x: MyAvatar.position.x, y: MyAvatar.position.y, z: MyAvatar.position.z }, + localOnly: true, + volume: 0.5 + }); + Window.takeSnapshot(true); } }