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

28 lines
974 B
JavaScript

//WW
var URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/raise%20roof/Hip%20Hop%20Dancing.fbx';
var CONFIG = {
text: 'RAISE ROOF',
icon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/raise%20roof/raise%20roof%20icon%20off.svg",
activeIcon: "https://hifi-content.s3.amazonaws.com/wadewatts/Animation%20Apps/raise%20roof/raise%20roof%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, 124);
else
MyAvatar.restoreAnimation();
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });