mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge branch 'tablet-ui' of github.com:highfidelity/hifi into tablet-ui-reenable-web-lasers
This commit is contained in:
commit
bacaadc7ca
3 changed files with 19 additions and 14 deletions
|
@ -6,6 +6,8 @@ Item {
|
|||
property var uuid;
|
||||
property string text: "EDIT"
|
||||
property string icon: "icons/edit-icon.svg"
|
||||
property string activeText: tabletButton.text
|
||||
property string activeIcon: tabletButton.icon
|
||||
property bool isActive: false
|
||||
property bool inDebugMode: false
|
||||
property bool isEntered: false
|
||||
|
@ -170,12 +172,18 @@ Item {
|
|||
PropertyChanges {
|
||||
target: text
|
||||
color: "#333333"
|
||||
text: tabletButton.activeText
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: iconColorOverlay
|
||||
color: "#333333"
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: icon
|
||||
source: "../../../" + tabletButton.activeIcon
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hover active state"
|
||||
|
|
|
@ -15,16 +15,15 @@
|
|||
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
||||
function muteURL() {
|
||||
return "icons/tablet-icons/" + (AudioDevice.getMuted() ? "mic-a.svg" : "mic-i.svg");
|
||||
}
|
||||
var button = tablet.addButton({
|
||||
icon: "icons/tablet-icons/mic-a.svg",
|
||||
text: "MUTE"
|
||||
text: "MUTE",
|
||||
activeIcon: "icons/tablet-icons/mic-i.svg",
|
||||
activeText: "UNMUTE"
|
||||
});
|
||||
|
||||
function onMuteToggled() {
|
||||
button.editProperties({icon: muteURL()});
|
||||
button.editProperties({isActive: AudioDevice.getMuted()});
|
||||
}
|
||||
onMuteToggled();
|
||||
function onClicked(){
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
}
|
||||
|
||||
function updateShowTablet() {
|
||||
if (tabletShown) {
|
||||
var currentMicLevel = getMicLevel();
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.updateAudioBar(currentMicLevel);
|
||||
}
|
||||
|
||||
if (HMD.showTablet && !tabletShown) {
|
||||
showTabletUI();
|
||||
} else if (!HMD.showTablet && tabletShown) {
|
||||
|
@ -60,8 +66,7 @@
|
|||
Messages.subscribe("toggleHand");
|
||||
Messages.messageReceived.connect(toggleHand);
|
||||
|
||||
Script.update.connect(updateShowTablet);
|
||||
// Script.setInterval(updateShowTablet, 1000);
|
||||
Script.setInterval(updateShowTablet, 100);
|
||||
|
||||
// Initialise variables used to calculate audio level
|
||||
var accumulatedLevel = 0.0;
|
||||
|
@ -90,12 +95,5 @@
|
|||
return micLevel;
|
||||
}
|
||||
|
||||
Script.setInterval(function() {
|
||||
if (tabletShown) {
|
||||
var currentMicLevel = getMicLevel();
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
tablet.updateAudioBar(currentMicLevel);
|
||||
}
|
||||
}, MIC_LEVEL_UPDATE_INTERVAL_MS);
|
||||
|
||||
}()); // END LOCAL_SCOPE
|
||||
|
|
Loading…
Reference in a new issue