diff --git a/scripts/system/graphicsSettings.js b/scripts/system/graphicsSettings.js deleted file mode 100644 index 748eafca24..0000000000 --- a/scripts/system/graphicsSettings.js +++ /dev/null @@ -1,102 +0,0 @@ -// -// graphicsSettings.js -// -// Created by Kalila L. on August 5th, 2020 -// Copyright 2020 Vircadia contributors. -// Copyright 2024 Overte e.V. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -(function() { // BEGIN LOCAL_SCOPE - var channelComm = "Overte-ShowGraphicsIconChanged"; - var appStatus = false; - var GRAPHICS_HIDE_AND_SHOW_SETTING_KEY = "showGraphicsIcon"; - var GRAPHICS_HIDE_AND_SHOW_DEFAULT_VALUE = true; - - var AppUi = Script.require('appUi'); - - // cellphone-cog MDI - // var customIcon = 'data:image/svg+xml;utf8,' - - // application-cog MDI - var customIcon = 'data:image/svg+xml;utf8,' - var lqIcon = 'data:image/svg+xml;utf8,'; - var mqIcon = 'data:image/svg+xml;utf8,'; - var hqIcon = 'data:image/svg+xml;utf8,'; - - var BUTTON_NAME = "GRAPHICS"; - var GRAPHICS_QML_SOURCE = "hifi/dialogs/graphics/GraphicsSettings.qml"; - var ui; - - function getIcon() { - // TODO: Implement only once AppUi can be told to constantly retrieve / reset icons... - // var performanceProfile = Performance.getPerformancePreset(); - // - // switch (performanceProfile) { - // case 0: - // return customIcon; - // break; - // case 1: - // return lqIcon; - // break; - // case 2: - // return mqIcon; - // break; - // case 3: - // return hqIcon; - // break; - // default: - // return customIcon; - // } - return customIcon; - } - - function startup() { - if (!appStatus) { - ui = new AppUi({ - buttonName: BUTTON_NAME, - sortOrder: 8, - normalButton: getIcon(), - activeButton: getIcon().replace('white', 'black'), - home: GRAPHICS_QML_SOURCE - }); - } - appStatus = true; - } - - function shutdown() { - if (appStatus) { - ui.onScriptEnding(); - appStatus = false; - } - } - - function cleanup() { - Messages.messageReceived.disconnect(onMessageReceived); - Messages.unsubscribe(channelComm); - } - - function onMessageReceived(channel, message, sender, localOnly) { - if (channel === channelComm && localOnly) { - if (Settings.getValue(GRAPHICS_HIDE_AND_SHOW_SETTING_KEY, GRAPHICS_HIDE_AND_SHOW_DEFAULT_VALUE)) { - startup(); - } else { - shutdown(); - } - } - } - - // - // Run the functions. - // - if (Settings.getValue(GRAPHICS_HIDE_AND_SHOW_SETTING_KEY, GRAPHICS_HIDE_AND_SHOW_DEFAULT_VALUE)) { - startup(); - } - Messages.subscribe(channelComm); - Messages.messageReceived.connect(onMessageReceived); - - Script.scriptEnding.connect(cleanup); - -}()); // END LOCAL_SCOPE