28 lines
No EOL
829 B
JavaScript
28 lines
No EOL
829 B
JavaScript
(function() {
|
|
var TABLET_BUTTON_NAME_OFF = "SPV Off";
|
|
var TABLET_BUTTON_NAME_ON = "SPV On";
|
|
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
|
var button = tablet.addButton({
|
|
text: TABLET_BUTTON_NAME_OFF
|
|
});
|
|
var isActive = false;
|
|
|
|
function onClicked() {
|
|
MyAvatar.toggleSmoothPoleVectors();
|
|
isActive = !isActive;
|
|
button.editProperties ({
|
|
text : isActive ? TABLET_BUTTON_NAME_ON : TABLET_BUTTON_NAME_OFF
|
|
});
|
|
}
|
|
|
|
button.clicked.connect(onClicked);
|
|
|
|
Script.scriptEnding.connect(function () {
|
|
if (isActive) {
|
|
MyAvatar.toggleSmoothPoleVectors();
|
|
}
|
|
button.clicked.disconnect(onClicked);
|
|
tablet.removeButton(button);
|
|
});
|
|
|
|
})(); |