mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Slideshow timer resets when user hits next
This commit is contained in:
parent
f6290e7165
commit
f7b35198ec
@ -3,6 +3,7 @@
|
|||||||
#### Unreleased changes
|
#### Unreleased changes
|
||||||
* Nothing yet...
|
* Nothing yet...
|
||||||
* Slideshow more responsive on pressing next
|
* Slideshow more responsive on pressing next
|
||||||
|
* Slideshow timer resets when next is pressed
|
||||||
|
|
||||||
#### Version 1.0 alpha 2 - 10/15/2019
|
#### Version 1.0 alpha 2 - 10/15/2019
|
||||||
* Fix installer running in wrong mode
|
* Fix installer running in wrong mode
|
||||||
|
@ -137,13 +137,22 @@ namespace Wabbajack
|
|||||||
.DisposeWith(this.CompositeDisposable);
|
.DisposeWith(this.CompositeDisposable);
|
||||||
|
|
||||||
/// Wire slideshow updates
|
/// Wire slideshow updates
|
||||||
// Merge all the sources that trigger a slideshow update
|
var intervalSeconds = 10;
|
||||||
|
// Compile all the sources that trigger a slideshow update
|
||||||
Observable.Merge(
|
Observable.Merge(
|
||||||
// If the natural timer fires
|
|
||||||
Observable.Interval(TimeSpan.FromSeconds(10)).Unit(),
|
|
||||||
// If user requests one manually
|
// If user requests one manually
|
||||||
this.SlideShowNextItemCommand.StartingExecution())
|
this.SlideShowNextItemCommand.StartingExecution(),
|
||||||
// When enabled, fire an initial signal
|
// If the natural timer fires
|
||||||
|
Observable.Merge(
|
||||||
|
// Start with an initial timer
|
||||||
|
Observable.Return(Observable.Interval(TimeSpan.FromSeconds(intervalSeconds))),
|
||||||
|
// but reset timer if user requests one
|
||||||
|
this.SlideShowNextItemCommand.StartingExecution()
|
||||||
|
.Select(_ => Observable.Interval(TimeSpan.FromSeconds(intervalSeconds))))
|
||||||
|
// When a new timer comes in, swap to it
|
||||||
|
.Switch()
|
||||||
|
.Unit())
|
||||||
|
// When filter switch enabled, fire an initial signal
|
||||||
.StartWith(Unit.Default)
|
.StartWith(Unit.Default)
|
||||||
// Only subscribe to slideshow triggers if enabled and installing
|
// Only subscribe to slideshow triggers if enabled and installing
|
||||||
.FilterSwitch(
|
.FilterSwitch(
|
||||||
|
Loading…
Reference in New Issue
Block a user