diff --git a/js/HuesCore.js b/js/HuesCore.js index 6e23093..c85b11a 100644 --- a/js/HuesCore.js +++ b/js/HuesCore.js @@ -459,17 +459,22 @@ HuesCore.prototype.resetAudio = function() { }; HuesCore.prototype.randomImage = function() { - var len = this.resourceManager.enabledImages.length; - var index = Math.floor(Math.random() * len); - if ((index == this.imageIndex || this.lastImageArray.indexOf(index) != -1) && len > 1) { - this.randomImage(); - } else { - this.setImage(index); - this.lastImageArray.push(index); - var cull = Math.min(20, Math.floor((len / 2))); - while (this.lastImageArray.length > cull && cull >= 0) { - this.lastImageArray.shift(); + if(localStorage["shuffleImages"] == "on") { + var len = this.resourceManager.enabledImages.length; + var index = Math.floor(Math.random() * len); + if ((index == this.imageIndex || this.lastImageArray.indexOf(index) != -1) && len > 1) { + this.randomImage(); + } else { + this.setImage(index); + this.lastImageArray.push(index); + var cull = Math.min(20, Math.floor((len / 2))); + 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); } }; diff --git a/js/HuesSettings.js b/js/HuesSettings.js index 50faecc..d4d004f 100644 --- a/js/HuesSettings.js +++ b/js/HuesSettings.js @@ -52,6 +52,7 @@ HuesSettings.prototype.defaultSettings = { blackoutUI: "off", playBuildups: "on", visualiser: "off", + shuffleImages: "on", autoSong: "off", autoSongDelay: 5, // loops or minutes depending on autoSong value autoSongShuffle: "on", @@ -82,13 +83,7 @@ HuesSettings.prototype.settingsCategories = { "autoSong", "autoSongShuffle", "autoSongFadeout", - "smartAlign" - ], - "Interface" : [ - "currentUI", - "colourSet", - "blackoutUI", - "visualiser" + "playBuildups" ], "Graphics" : [ "blurAmount", @@ -96,9 +91,16 @@ HuesSettings.prototype.settingsCategories = { "blurQuality", "trippyMode" ], - "Audio" : [ - "playBuildups" - ] + "Visuals" : [ + "smartAlign", + "shuffleImages", + "colourSet", + "visualiser" + ], + "Interface" : [ + "currentUI", + "blackoutUI", + ], }; HuesSettings.prototype.settingsOptions = { @@ -181,6 +183,10 @@ HuesSettings.prototype.settingsOptions = { trippyMode : { name : "Trippy Mode", options : ["off", "on"] + }, + shuffleImages : { + name : "Shuffle images", + options : ["off", "on"] } };