content/hifi-content/rebecca/tomb/defaultMemoryChanger.js
2022-02-14 02:04:11 +01:00

46 lines
1.3 KiB
JavaScript

//
// maxMemoryChanger.js
//
// created by Rebecca Stankus on 12/27/18
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
(function() {
var _this;
var AUDIO_VOLUME_LEVEL = 1;
var CHANGE_SOUND = SoundCache.getSound(Script.resolvePath("Sounds/change.wav"));
var MaxMemoryChanger = function() {
_this = this;
};
MaxMemoryChanger.prototype = {
preload: function(entityID) {
_this.entityID = entityID;
},
playSound: function() {
if (CHANGE_SOUND.downloaded) {
print("sound ready");
Audio.playSound(CHANGE_SOUND, {
position: MyAvatar.position,
volume: AUDIO_VOLUME_LEVEL,
localOnly: true
});
}
},
mousePressOnEntity: function(entityID, mouseEvent) {
if (mouseEvent.isLeftButton) {
_this.playSound();
Menu.setIsOptionChecked("Automatic Texture Memory", true);
}
}
};
return new MaxMemoryChanger();
});