Merge pull request #77 from erri120/ui-fix

UI Fixes
This commit is contained in:
Timothy Baldridge 2019-10-11 11:57:22 -06:00 committed by GitHub
commit 73e56fd62a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View File

@ -72,7 +72,7 @@ namespace Wabbajack
slideshowThread.Start();
}
private DateTime _lastSlideShowUpdate = new DateTime();
public DateTime lastSlideShowUpdate = new DateTime();
public ObservableCollection<string> Log { get; } = new ObservableCollection<string>();
public ObservableCollection<CPUStatus> Status { get; } = new ObservableCollection<CPUStatus>();
@ -308,7 +308,7 @@ namespace Wabbajack
private string _SplashScreenSummary;
public string SplashScreenSummary { get => _SplashScreenSummary; set => this.RaiseAndSetIfChanged(ref _SplashScreenSummary, value); }
private bool _splashShowNSFW = true;
private bool _splashShowNSFW = false;
public bool SplashShowNSFW { get => _splashShowNSFW; set => this.RaiseAndSetIfChanged(ref _splashShowNSFW, value); }
private readonly Thread slideshowThread = null;
private bool _enableSlideShow = true;
@ -387,12 +387,12 @@ namespace Wabbajack
if (_slideShow.SlidesQueue.Any())
{
if (DateTime.Now - _lastSlideShowUpdate > TimeSpan.FromSeconds(10))
if (DateTime.Now - lastSlideShowUpdate > TimeSpan.FromSeconds(10))
{
_slideShow.UpdateSlideShowItem();
}
}
Thread.Sleep(10000);
Thread.Sleep(1000);
}
}

View File

@ -52,7 +52,7 @@
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="{Binding SplashScreenImage}" Stretch="Fill"/>
<Button Grid.Row="1" Height="30" Command="{Binding OpenReadme}" IsEnabled="{Binding HadReadme}">
<Button Grid.Row="1" Height="30" Command="{Binding OpenReadme}" IsEnabled="{Binding HasReadme}">
<TextBlock Text="Open README" FontSize="15" FontWeight="Bold"/>
</Button>
</Grid>

View File

@ -81,15 +81,15 @@ namespace Wabbajack.UI
{
var idx = _random.Next(0, SlideShowElements.Count);
var randomSlide = SlideShowElements[idx];
while (CachedSlides.ContainsKey(randomSlide.ModID) || SlidesQueue.Contains(randomSlide))
while (!CachedSlides.ContainsKey(randomSlide.ModID) || SlidesQueue.Contains(randomSlide))
{
idx = _random.Next(0, SlideShowElements.Count);
randomSlide = SlideShowElements[idx];
}
if (!CachedSlides.ContainsKey(randomSlide.ModID)) continue;
//if (SlidesQueue.Contains(randomSlide)) continue;
CachedSlides.Remove(randomSlide.ModID);
if(AppState.GcCollect)
if (AppState.GcCollect)
GC.Collect();
}
@ -111,6 +111,8 @@ namespace Wabbajack.UI
_appState._nexusSiteURL = slide.ModURL;
}
_appState.lastSlideShowUpdate = DateTime.Now;
SlidesQueue.Dequeue();
QueueRandomSlide(false, true);
}