Skip to content

Commit

Permalink
Hide TheKing chess engine type if os is not Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sakya committed Feb 6, 2022
1 parent 762f667 commit c70fa3a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions CoreChess/Views/EnginesWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using ChessLib;
using ChessLib.Engines;
using CoreChess.Localizer;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace CoreChess.Views
Expand All @@ -30,6 +27,12 @@ protected override void InitializeComponent()
AvaloniaXamlLoader.Load(this);
base.InitializeComponent();

if (Environment.OSVersion.Platform != PlatformID.Win32NT) {
var cb = this.FindControl<ComboBox>("m_EngineType");
var items = cb.Items as Avalonia.Collections.AvaloniaList<object>;
items.RemoveAt(3);
}

m_Engines = new List<EngineBase>(App.Settings.Engines);
m_List = this.FindControl<Controls.ItemsList>("m_List");
m_List.Items = m_Engines.OrderBy(e => e.Name);
Expand Down

0 comments on commit c70fa3a

Please sign in to comment.