mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
use a setting to decide which UI is enabled
This commit is contained in:
parent
f18094f565
commit
98f1664a46
12 changed files with 13 additions and 20 deletions
|
@ -31,7 +31,7 @@ class HMDScriptingInterface : public AbstractHMDScriptingInterface, public Depen
|
|||
Q_PROPERTY(bool showTablet READ getShouldShowTablet)
|
||||
Q_PROPERTY(QUuid tabletID READ getCurrentTableUIID WRITE setCurrentTabletUIID)
|
||||
Q_PROPERTY(unsigned int homeButtonID READ getCurrentHomeButtonUUID WRITE setCurrentHomeButtonUUID)
|
||||
Q_PROPERTY(bool hudUIEnabled READ getHUDUIEnabled WRITE setHUDUIEnabled);
|
||||
|
||||
|
||||
public:
|
||||
Q_INVOKABLE glm::vec3 calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const;
|
||||
|
@ -96,9 +96,6 @@ public:
|
|||
void setCurrentHomeButtonUUID(unsigned int homeButtonID) { _homeButtonID = homeButtonID; }
|
||||
unsigned int getCurrentHomeButtonUUID() const { return _homeButtonID; }
|
||||
|
||||
bool getHUDUIEnabled() const { return _hudUIEnabled; }
|
||||
void setHUDUIEnabled(bool value) { _hudUIEnabled = value; }
|
||||
|
||||
private:
|
||||
bool _showTablet { false };
|
||||
QUuid _tabletUIID; // this is the entityID of the WebEntity which is part of (a child of) the tablet-ui.
|
||||
|
@ -114,8 +111,6 @@ private:
|
|||
bool getHUDLookAtPosition3D(glm::vec3& result) const;
|
||||
glm::mat4 getWorldHMDMatrix() const;
|
||||
std::atomic<int> _showHandControllersCount { 0 };
|
||||
|
||||
bool _hudUIEnabled;
|
||||
};
|
||||
|
||||
#endif // hifi_HMDScriptingInterface_h
|
||||
|
|
|
@ -43,8 +43,6 @@ var DEFAULT_SCRIPTS = [
|
|||
var MENU_CATEGORY = "Developer";
|
||||
var MENU_ITEM = "Debug defaultScripts.js";
|
||||
|
||||
HMD.hudUIEnabled = true;
|
||||
|
||||
var SETTINGS_KEY = '_debugDefaultScriptsIsChecked';
|
||||
var previousSetting = Settings.getValue(SETTINGS_KEY);
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
|
||||
// Setup the bubble button
|
||||
var buttonName = "BUBBLE";
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolbar.addButton({
|
||||
objectName: 'bubble',
|
||||
|
|
|
@ -237,7 +237,7 @@ var toolBar = (function () {
|
|||
});
|
||||
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
systemToolbar = Toolbars.getToolbar(SYSTEM_TOOLBAR);
|
||||
activeButton = systemToolbar.addButton({
|
||||
objectName: EDIT_TOGGLE_BUTTON,
|
||||
|
|
|
@ -27,7 +27,7 @@ function onClicked(){
|
|||
DialogsManager.toggleAddressBar();
|
||||
}
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
var buttonName = "HELP";
|
||||
var toolBar = null;
|
||||
var tablet = null;
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
|
@ -40,7 +40,7 @@ var button;
|
|||
var toolBar = null;
|
||||
var tablet = null;
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
} else {
|
||||
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
@ -50,7 +50,7 @@ if (HMD.hudUIEnabled) {
|
|||
// Disable them in hmd.
|
||||
var desktopOnlyViews = ['Mirror', 'Independent Mode', 'Entity Mode'];
|
||||
function onHmdChanged(isHmd) {
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
button.writeProperty('buttonState', isHmd ? 0 : 1);
|
||||
button.writeProperty('defaultState', isHmd ? 0 : 1);
|
||||
button.writeProperty('hoverState', isHmd ? 2 : 3);
|
||||
|
@ -78,7 +78,7 @@ function onClicked(){
|
|||
Menu.setIsOptionChecked(isDesktop ? headset : desktopMenuItemName, true);
|
||||
}
|
||||
if (headset) {
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
button = toolBar.addButton({
|
||||
objectName: "hmdToggle",
|
||||
imageURL: Script.resolvePath("assets/images/tools/switch.svg"),
|
||||
|
|
|
@ -112,7 +112,7 @@ function toggleMarketplace() {
|
|||
var tablet = null;
|
||||
var toolBar = null;
|
||||
var marketplaceButton = null;
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
marketplaceWindow = new OverlayWebWindow({
|
||||
title: "Marketplace",
|
||||
source: "about:blank",
|
||||
|
|
|
@ -26,7 +26,7 @@ function onClicked(){
|
|||
Menu.setIsOptionChecked(menuItem, !Menu.isOptionChecked(menuItem));
|
||||
}
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
|
@ -481,7 +481,7 @@ var button;
|
|||
var buttonName = "PAL";
|
||||
var tablet = null;
|
||||
var toolBar = null;
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
|
@ -22,7 +22,7 @@ var buttonName = "SNAP";
|
|||
var tablet = null;
|
||||
var toolBar = null;
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
|
@ -20,7 +20,7 @@ var tablet = null;
|
|||
|
||||
var MENU_ITEM = "Users Online";
|
||||
|
||||
if (HMD.hudUIEnabled) {
|
||||
if (Settings.getValue("HUDUIEnabled")) {
|
||||
toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||
button = toolBar.addButton({
|
||||
objectName: buttonName,
|
||||
|
|
Loading…
Reference in a new issue