From eb79752455bc71842cd64eab06769eadbfb0bf45 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 5 Jul 2019 12:00:17 -0700 Subject: [PATCH] BUGZ-930: No more auto-LOD adjustment for SimplifiedUI users --- scripts/simplifiedUI/ui/simplifiedUI.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index 81f917e1c9..2402895f11 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -483,6 +483,25 @@ function maybeUpdateOutputDeviceMutedOverlay() { } +var oldAutomaticLODAdjust; +var oldLODLevel; +var DEFAULT_AUTO_LOD_ADJUST = false; +var DEFAULT_LOD_LEVEL = 0.5; +function modifyLODSettings() { + oldAutomaticLODAdjust = LODManager.automaticLODAdjust; + oldLODLevel = LODManager.lodQualityLevel; + + LODManager.automaticLODAdjust = DEFAULT_AUTO_LOD_ADJUST; + LODManager.lodQualityLevel = DEFAULT_LOD_LEVEL; +} + + +function restoreLODSettings() { + LODManager.automaticLODAdjust = oldAutomaticLODAdjust; + LODManager.lodQualityLevel = oldLODLevel; +} + + var simplifiedNametag = Script.require("./simplifiedNametag/simplifiedNametag.js?" + Date.now()); var SimplifiedStatusIndicator = Script.require("./simplifiedStatusIndicator/simplifiedStatusIndicator.js?" + Date.now()); var si; @@ -491,6 +510,7 @@ var oldShowBubbleTools; var keepExistingUIAndScriptsSetting = Settings.getValue("simplifiedUI/keepExistingUIAndScripts", false); function startup() { maybeRemoveDesktopMenu(); + modifyLODSettings(); if (!keepExistingUIAndScriptsSetting) { pauseCurrentScripts(); @@ -541,6 +561,7 @@ function restoreScripts() { function shutdown() { restoreScripts(); + restoreLODSettings(); if (!keepExistingUIAndScriptsSetting) { console.log("The Simplified UI script has been shut down. If you notice any strangeness with user interface, please restart this application.");