Skip to content

Commit 311db8a

Browse files
committed
Change stopOnLastImage to loopSlideshow
1 parent 748ba74 commit 311db8a

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

BrowserImageSlideshow.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686

8787
// called each interval of setInterval()
8888
function update() {
89-
if (index === images.length-1 && stopOnLastImage === true) {
89+
if (index === images.length-1 && loopSlideshow === false) {
9090
clearInterval(slideshowFunc);
9191
isSlideshowPaused = true;
9292
return;

SlideshowSettings.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ slideDuration = 3800
1212
defaultSlideDuration = 4000
1313
minSlideDuration = 1000
1414
maxSlideDuration = 100000
15+
loopSlideshow = true
1516
startWithAutoplay = true
1617
browserSourceName = "Browser"
1718
local mode_options = {"Random Order", "Alphabetical Order", "Alphabetical order, start on random"}
@@ -55,7 +56,7 @@ function script_properties()
5556

5657
obs.obs_properties_add_int(props, "slideDuration", "Slide duration (ms):", minSlideDuration, maxSlideDuration, 500)
5758
obs.obs_properties_add_bool(props, "startWithAutoplay", "Autoplay")
58-
obs.obs_properties_add_bool(props, "stopOnLastImage", "Stop slideshow on last image")
59+
obs.obs_properties_add_bool(props, "loopSlideshow", "Loop slideshow")
5960
obs.obs_properties_add_text(props, "browserSourceName", "Browser source name:\n(for use with hotkeys)", obs.OBS_TEXT_DEFAULT)
6061
obs.obs_properties_add_button(props, "refreshButton", "Refresh", refresh_source)
6162
return props
@@ -128,6 +129,7 @@ end
128129
function script_load(settings)
129130
obs.obs_data_set_default_int(settings, "slideDuration", defaultSlideDuration)
130131
obs.obs_data_set_default_bool(settings, "startWithAutoplay", true)
132+
obs.obs_data_set_default_bool(settings, "loopSlideshow", true)
131133
obs.obs_data_set_default_string(settings, "browserSourceName", "Browser")
132134
update_image_list()
133135

@@ -178,17 +180,17 @@ end
178180
function script_update(settings)
179181
mode = obs.obs_data_get_int(settings, "mode")
180182
slideDuration = obs.obs_data_get_int(settings, "slideDuration")
181-
stopOnLastImage = obs.obs_data_get_bool(settings, "stopOnLastImage")
183+
loopSlideshow = obs.obs_data_get_bool(settings, "loopSlideshow")
182184
startWithAutoplay = obs.obs_data_get_bool(settings, "startWithAutoplay")
183185
browserSourceName = obs.obs_data_get_string(settings, "browserSourceName")
184186

185187
local output = assert(io.open(script_path() .. 'settings.js', "w"))
186188
output:write('let mode = '.. mode .. ';\n')
187189
output:write('let slideDuration = '.. slideDuration .. ';\n')
188-
if stopOnLastImage == true then
189-
output:write('let stopOnLastImage = true;\n')
190+
if loopSlideshow == true then
191+
output:write('let loopSlideshow = true;\n')
190192
else
191-
output:write('let stopOnLastImage = false;\n')
193+
output:write('let loopSlideshow = false;\n')
192194
end
193195

194196
if startWithAutoplay == true then
@@ -278,6 +280,6 @@ function log_slideshow_info()
278280
"source name: \"" .. browserSourceName ..
279281
"\" | mode: ".. mode_options[mode+1] ..
280282
" | slide duration: ".. slideDuration ..
281-
"ms | loop: " .. tostring(not(stopOnLastImage)) ..
283+
"ms | loop: " .. tostring(loopSlideshow) ..
282284
" | autoplay: " .. tostring(startWithAutoplay))
283285
end

settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
let mode = 0;
22
let slideDuration = 4000;
3-
let stopOnLastImage = false;
3+
let loopSlideshow = true;
44
let startWithAutoplay = true;

0 commit comments

Comments
 (0)