mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
cleanup debugAvatarMixer
This commit is contained in:
parent
8ffd9412f3
commit
7ba41c72ef
1 changed files with 1 additions and 39 deletions
|
@ -17,28 +17,7 @@
|
||||||
|
|
||||||
Script.include("/~/system/libraries/controllers.js");
|
Script.include("/~/system/libraries/controllers.js");
|
||||||
|
|
||||||
// grab the toolbar
|
var isShowingOverlays = true;
|
||||||
var toolbar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
|
||||||
|
|
||||||
var ASSETS_PATH = Script.resolvePath("assets");
|
|
||||||
var TOOLS_PATH = Script.resolvePath("assets/images/tools/");
|
|
||||||
|
|
||||||
function buttonImageURL() {
|
|
||||||
return TOOLS_PATH + (Users.canKick ? 'kick.svg' : 'ignore.svg');
|
|
||||||
}
|
|
||||||
|
|
||||||
// setup the mod button and add it to the toolbar
|
|
||||||
var button = toolbar.addButton({
|
|
||||||
objectName: 'debugAvatarMixer',
|
|
||||||
imageURL: buttonImageURL(),
|
|
||||||
visible: true,
|
|
||||||
buttonState: 1,
|
|
||||||
defaultState: 1,
|
|
||||||
hoverState: 3,
|
|
||||||
alpha: 0.9
|
|
||||||
});
|
|
||||||
|
|
||||||
var isShowingOverlays = false;
|
|
||||||
var debugOverlays = {};
|
var debugOverlays = {};
|
||||||
|
|
||||||
function removeOverlays() {
|
function removeOverlays() {
|
||||||
|
@ -55,22 +34,6 @@ function removeOverlays() {
|
||||||
debugOverlays = {};
|
debugOverlays = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
// handle clicks on the toolbar button
|
|
||||||
function buttonClicked(){
|
|
||||||
if (isShowingOverlays) {
|
|
||||||
removeOverlays();
|
|
||||||
isShowingOverlays = false;
|
|
||||||
} else {
|
|
||||||
isShowingOverlays = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
button.writeProperty('buttonState', isShowingOverlays ? 0 : 1);
|
|
||||||
button.writeProperty('defaultState', isShowingOverlays ? 0 : 1);
|
|
||||||
button.writeProperty('hoverState', isShowingOverlays ? 2 : 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
button.clicked.connect(buttonClicked);
|
|
||||||
|
|
||||||
function updateOverlays() {
|
function updateOverlays() {
|
||||||
if (isShowingOverlays) {
|
if (isShowingOverlays) {
|
||||||
|
|
||||||
|
@ -161,7 +124,6 @@ AvatarList.avatarRemovedEvent.connect(function(avatarID){
|
||||||
|
|
||||||
// cleanup the toolbar button and overlays when script is stopped
|
// cleanup the toolbar button and overlays when script is stopped
|
||||||
Script.scriptEnding.connect(function() {
|
Script.scriptEnding.connect(function() {
|
||||||
toolbar.removeButton('debugAvatarMixer');
|
|
||||||
removeOverlays();
|
removeOverlays();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue