mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Created Next button functions
This commit is contained in:
parent
a0588bb564
commit
1ee0137800
@ -198,6 +198,47 @@ namespace Wabbajack
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand SlideShowNextItem
|
||||
{
|
||||
get
|
||||
{
|
||||
return new LambdaCommand(() => true, () => NextSlideshowItem());
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
private void VisitNexusSite()
|
||||
|
Loading…
Reference in New Issue
Block a user