mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Rewrote next button to incorporate new slideshow system
This commit is contained in:
parent
651ca26ef9
commit
d5669e8661
@ -203,42 +203,12 @@ namespace Wabbajack
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new LambdaCommand(() => true, () => NextSlideshowItem());
|
return new LambdaCommand(() => true, () => {
|
||||||
}
|
UpdateSlideShowItem();
|
||||||
}
|
QueueRandomSlide();
|
||||||
private void NextSlideshowItem()
|
|
||||||
{
|
|
||||||
var idx = _random.Next(0, SlideShowElements.Count);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var element = SlideShowElements[idx];
|
|
||||||
if (!element.Adult || (element.Adult && SplashShowNSFW))
|
|
||||||
{
|
|
||||||
var data = new MemoryStream();
|
|
||||||
using (var stream = new HttpClient().GetStreamSync(element.ImageURL))
|
|
||||||
stream.CopyTo(data);
|
|
||||||
data.Seek(0, SeekOrigin.Begin);
|
|
||||||
|
|
||||||
|
|
||||||
dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
var bitmap = new BitmapImage();
|
|
||||||
bitmap.BeginInit();
|
|
||||||
bitmap.CacheOption = BitmapCacheOption.OnLoad;
|
|
||||||
bitmap.StreamSource = data;
|
|
||||||
bitmap.EndInit();
|
|
||||||
|
|
||||||
SplashScreenImage = bitmap;
|
|
||||||
SplashScreenModName = element.ModName;
|
|
||||||
SplashScreenAuthorName = element.AuthorName;
|
|
||||||
SplashScreenSummary = element.ModSummary;
|
|
||||||
_nexusSiteURL = element.ModURL;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) { }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string _nexusSiteURL = null;
|
public string _nexusSiteURL = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user