soundButton.js 799 B

12345678910111213141516171819202122232425
  1. function SoundButton() {
  2. var switchFunction = function() {
  3. var button = arguments.callee.button;
  4. Global.prototype.mute = !Global.prototype.mute;
  5. TrinStorage.prototype.save("sound.mute", Global.prototype.mute);
  6. if (Global.prototype.mute) {
  7. button.switchAnimation("bSoundOff");
  8. TrinSound.prototype.muteAll();
  9. } else {
  10. button.switchAnimation("bSoundOn");
  11. TrinSound.prototype.unMuteAll();
  12. }
  13. };
  14. switchFunction.button = this;
  15. SoundButton.superclass.constructor.apply(this, [function(){}, "bCredits"]);
  16. if (!Global.prototype.mute) {
  17. }
  18. this.active = this.visible = TrinSound.prototype.soundsLoaded;
  19. }
  20. extend(SoundButton, TrinButton);
  21. SoundButton.prototype.update = function(){
  22. };