fix: hide unavalible engines from another windows

This commit is contained in:
Alex Z 2020-03-10 00:46:58 +03:00
parent 89efcb86a9
commit f3bf6dcb48
2 changed files with 6 additions and 4 deletions

View File

@ -9,6 +9,7 @@ using System.Collections.Generic;
using UniversalValveToolbox.Utils; using UniversalValveToolbox.Utils;
using System.Globalization; using System.Globalization;
using System.Collections; using System.Collections;
using EpicMorg.SteamPathsLib;
namespace UniversalValveToolbox { namespace UniversalValveToolbox {
public partial class FormAddons : Form { public partial class FormAddons : Form {
@ -29,7 +30,7 @@ namespace UniversalValveToolbox {
.Cast<DictionaryEntry>() .Cast<DictionaryEntry>()
.ToArray(); .ToArray();
model = new FormAddonViewModel(dataProvider.Addons, dataProvider.Engines, categories); model = new FormAddonViewModel(dataProvider.Addons, dataProvider.Engines.Where(engine => SteamPathsUtil.GetSteamAppDataById(engine.Appid) != null).ToArray(), categories);
UpdateAddonsComboBox(); UpdateAddonsComboBox();
UpdateAddonCategoryComboBox(); UpdateAddonCategoryComboBox();

View File

@ -1,4 +1,5 @@
using kasthack.binding.wf; using EpicMorg.SteamPathsLib;
using kasthack.binding.wf;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -20,7 +21,7 @@ namespace UniversalValveToolbox {
public FormProjects() { public FormProjects() {
InitializeComponent(); InitializeComponent();
model = new FormProjectViewModel(dataProvider.Projects, dataProvider.Engines); model = new FormProjectViewModel(dataProvider.Projects, dataProvider.Engines.Where(engine => SteamPathsUtil.GetSteamAppDataById(engine.Appid) != null).ToArray());
UpdateComboBoxProject(); UpdateComboBoxProject();
UpdateComboBoxEngine(); UpdateComboBoxEngine();