Skip to content

Commit

Permalink
#93 Prevent edge-based model viewer from loading on Win7
Browse files Browse the repository at this point in the history
Caused crash on Windows 7 computers.
  • Loading branch information
NotCoffee418 committed May 5, 2020
1 parent 8579501 commit 7502cfd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion TrinityCreator/UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using TrinityCreator.Tools.VendorCreator;
using TrinityCreator.Tools.ProfileCreator;
using TrinityCreator.Helpers;
using System.Windows.Controls;

namespace TrinityCreator.UI
{
Expand All @@ -37,7 +38,6 @@ public MainWindow()
// Load usable creators
ItemTab.Content = new ItemPage();
QuestTab.Content = new QuestPage();
ModelViewerTabFrame.Content = new ModelViewerPage();
CreatureCreatorTab.Content = new CreatureCreatorPage();
LootCreatorTab.Content = new LootPage();
VendorCreatorTab.Content = new VendorPage();
Expand All @@ -46,6 +46,23 @@ public MainWindow()
tipTimer.Elapsed += ChangeRandomTip;
tipTimer.Interval = 200; // don't change interval here
tipTimer.Start();

// Load model viewer on windows 10 or message on older
try
{
if (System.Environment.OSVersion.Version >= new Version(6, 2))
ModelViewerTabFrame.Content = new ModelViewerPage();
else
{
TextBox tb = new TextBox();
tb.Text = "Model Viewer is not supported before Windows 10.";
ModelViewerTabFrame.Content = tb;
}
}
catch (Exception ex)
{
Logger.Log("Exception has occurred loading model viewer: " + ex.Message);
}
}

static Random random = new Random();
Expand Down

0 comments on commit 7502cfd

Please sign in to comment.