content/hifi-content/wadewatts/Animation Apps/darn/animation-button-darn.js
2022-02-14 02:04:11 +01:00

28 lines
921 B
JavaScript

//WW
var URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/darn/Disappointed.fbx';
var CONFIG = {
text: 'DARN',
icon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/darn/darn%20icon%20off.svg",
activeIcon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/darn/darn%20icon%20on.svg"
};
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"),
button = tablet.addButton(CONFIG);
button.clicked.connect(function() {
this.a = !this.a;
button.editProperties({ isActive: this.a });
if (this.a)
MyAvatar.overrideAnimation(URL, 30, true, 0, 127);
else
MyAvatar.restoreAnimation();
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });