|
|
@ -459,17 +459,22 @@ HuesCore.prototype.resetAudio = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
HuesCore.prototype.randomImage = function() { |
|
|
|
HuesCore.prototype.randomImage = function() { |
|
|
|
var len = this.resourceManager.enabledImages.length; |
|
|
|
if(localStorage["shuffleImages"] == "on") { |
|
|
|
var index = Math.floor(Math.random() * len); |
|
|
|
var len = this.resourceManager.enabledImages.length; |
|
|
|
if ((index == this.imageIndex || this.lastImageArray.indexOf(index) != -1) && len > 1) { |
|
|
|
var index = Math.floor(Math.random() * len); |
|
|
|
this.randomImage(); |
|
|
|
if ((index == this.imageIndex || this.lastImageArray.indexOf(index) != -1) && len > 1) { |
|
|
|
} else { |
|
|
|
this.randomImage(); |
|
|
|
this.setImage(index); |
|
|
|
} else { |
|
|
|
this.lastImageArray.push(index); |
|
|
|
this.setImage(index); |
|
|
|
var cull = Math.min(20, Math.floor((len / 2))); |
|
|
|
this.lastImageArray.push(index); |
|
|
|
while (this.lastImageArray.length > cull && cull >= 0) { |
|
|
|
var cull = Math.min(20, Math.floor((len / 2))); |
|
|
|
this.lastImageArray.shift(); |
|
|
|
while (this.lastImageArray.length > cull && cull >= 0) { |
|
|
|
|
|
|
|
this.lastImageArray.shift(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { // jk, not actually random
|
|
|
|
|
|
|
|
var img=(this.imageIndex + 1) % this.resourceManager.enabledImages.length; |
|
|
|
|
|
|
|
this.setImage(img); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|