Add ability to not shuffle images in full auto

master
William Toohey 10 years ago
parent 9873b724cd
commit fb53f1e900
  1. 25
      js/HuesCore.js
  2. 26
      js/HuesSettings.js

@ -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);
} }
}; };

@ -52,6 +52,7 @@ HuesSettings.prototype.defaultSettings = {
blackoutUI: "off", blackoutUI: "off",
playBuildups: "on", playBuildups: "on",
visualiser: "off", visualiser: "off",
shuffleImages: "on",
autoSong: "off", autoSong: "off",
autoSongDelay: 5, // loops or minutes depending on autoSong value autoSongDelay: 5, // loops or minutes depending on autoSong value
autoSongShuffle: "on", autoSongShuffle: "on",
@ -82,13 +83,7 @@ HuesSettings.prototype.settingsCategories = {
"autoSong", "autoSong",
"autoSongShuffle", "autoSongShuffle",
"autoSongFadeout", "autoSongFadeout",
"smartAlign" "playBuildups"
],
"Interface" : [
"currentUI",
"colourSet",
"blackoutUI",
"visualiser"
], ],
"Graphics" : [ "Graphics" : [
"blurAmount", "blurAmount",
@ -96,9 +91,16 @@ HuesSettings.prototype.settingsCategories = {
"blurQuality", "blurQuality",
"trippyMode" "trippyMode"
], ],
"Audio" : [ "Visuals" : [
"playBuildups" "smartAlign",
] "shuffleImages",
"colourSet",
"visualiser"
],
"Interface" : [
"currentUI",
"blackoutUI",
],
}; };
HuesSettings.prototype.settingsOptions = { HuesSettings.prototype.settingsOptions = {
@ -181,6 +183,10 @@ HuesSettings.prototype.settingsOptions = {
trippyMode : { trippyMode : {
name : "Trippy Mode", name : "Trippy Mode",
options : ["off", "on"] options : ["off", "on"]
},
shuffleImages : {
name : "Shuffle images",
options : ["off", "on"]
} }
}; };

Loading…
Cancel
Save