diff --git a/FModel/Framework/NavigationList.cs b/FModel/Framework/NavigationList.cs new file mode 100644 index 00000000..7e32beea --- /dev/null +++ b/FModel/Framework/NavigationList.cs @@ -0,0 +1,34 @@ +using System.Collections.Generic; + +namespace FModel.Framework +{ + public class NavigationList : List + { + private int _currentIndex = 0; + public int CurrentIndex + { + get + { + if (_currentIndex > Count - 1) { _currentIndex = Count - 1; } + if (_currentIndex < 0) { _currentIndex = 0; } + return _currentIndex; + } + set { _currentIndex = value; } + } + + public T MoveNext + { + get { _currentIndex++; return this[CurrentIndex]; } + } + + public T MovePrevious + { + get { _currentIndex--; return this[CurrentIndex]; } + } + + public T Current + { + get { return this[CurrentIndex]; } + } + } +} diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 877cabcc..3c95a135 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -357,6 +357,7 @@ namespace FModel.ViewModels await _threadWorkerView.Begin(cancellationToken => { var hotfixes = ApplicationService.ApiEndpointView.BenbotApi.GetHotfixes(cancellationToken, Provider.GetLanguageCode(UserSettings.Default.AssetLanguage)); + if (hotfixes == null) return; foreach (var entries in hotfixes) { diff --git a/FModel/Views/Resources/Controls/AvalonEditor.xaml b/FModel/Views/Resources/Controls/AvalonEditor.xaml index f45de016..e1b45d20 100644 --- a/FModel/Views/Resources/Controls/AvalonEditor.xaml +++ b/FModel/Views/Resources/Controls/AvalonEditor.xaml @@ -17,7 +17,7 @@ - +