Skip to content

Commit

Permalink
Updated and renamed to Stride
Browse files Browse the repository at this point in the history
  • Loading branch information
tebjan committed Sep 5, 2020
1 parent da6abee commit 6314d76
Show file tree
Hide file tree
Showing 23 changed files with 104 additions and 100 deletions.
9 changes: 6 additions & 3 deletions XenkoShaderExplorer.sln → Stride.ShaderExplorer.sln
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 16
VisualStudioVersion = 16.0.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XenkoShaderExplorer", "XenkoShaderExplorer\XenkoShaderExplorer.csproj", "{EE2321A0-D100-4569-9E39-A6EBE8737569}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.ShaderExplorer", "Stride.ShaderExplorer\Stride.ShaderExplorer.csproj", "{EE2321A0-D100-4569-9E39-A6EBE8737569}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AurelienRibon.Ui.SyntaxHighlightBox", "SyntaxHighlightBox\AurelienRibon.Ui.SyntaxHighlightBox\AurelienRibon.Ui.SyntaxHighlightBox.csproj", "{10A9ECD3-AE1E-494D-9A27-8A32DD581759}"
EndProject
Expand All @@ -25,4 +25,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AD0D3404-312B-4182-B34B-FE2D0945198C}
EndGlobalSection
EndGlobal
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Application x:Class="XenkoShaderExplorer.App"
<Application x:Class="StrideShaderExplorer.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:XenkoShaderExplorer"
xmlns:local="clr-namespace:StrideShaderExplorer"
StartupUri="MainWindow.xaml">
<Application.Resources>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using System.Windows;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
/// <summary>
/// Interaktionslogik für "App.xaml"
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows.Data;
using System.Windows.Media;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
public class BoolToBrushConverter : IValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Windows;
using System.Windows.Documents;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
// Taken from http://stackoverflow.com/a/11433814
public static class HyperlinkExtensions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Window x:Class="XenkoShaderExplorer.InfoWindow"
<Window x:Class="StrideShaderExplorer.InfoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XenkoShaderExplorer"
Icon="Assets\XenkoShaderExplorerLogo.ico"
xmlns:local="clr-namespace:StrideShaderExplorer"
Icon="Assets\StrideShaderExplorerLogo.ico"
mc:Ignorable="d"
Foreground="White"
Title="Info" Height="200" Width="300"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System.Reflection;
using System.Windows;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
public partial class InfoWindow : Window
{
public InfoWindow()
{
InitializeComponent();
InfoHeaderBlock.Text = "Shader Explorer for Xenko " + Assembly.GetEntryAssembly().GetName().Version;
InfoHeaderBlock.Text = "Shader Explorer for Stride " + Assembly.GetEntryAssembly().GetName().Version;
}

private void OnCloseButtonClick(object sender, RoutedEventArgs e) => Close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@
using System.Text.RegularExpressions;
using System.Windows;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
public enum XenkoSourceDirMode
public enum StrideSourceDirMode
{
Official,
Dev
}

public class MainViewModel : ViewModelBase
{
private const string XenkoEnvironmentVariable = "XenkoDir";
private const string StrideEnvironmentVariable = "StrideDir";
private const string NugetEnvironmentVariable = "NUGET_PACKAGES";
private const string FallbackBasePath = @"C:\Program Files\Silicon Studio\Xenko\";

private string _filterText;
private IReadOnlyList<string> _path;
Expand Down Expand Up @@ -64,19 +63,32 @@ internal void Refresh()
try
{
List<string> basePath = null;
switch (XenkoDirMode)
switch (StrideDirMode)
{
case XenkoSourceDirMode.Official:
case StrideSourceDirMode.Official:
var nugetPackageDir = ResolveNugetPackageDir();
var directories = Directory.GetDirectories(nugetPackageDir) //package dir
.Where(dir => Path.GetFileName(dir).StartsWith("xenko", StringComparison.OrdinalIgnoreCase)) //xenko folders
.Where(dir => Path.GetFileName(dir).StartsWith("stride", StringComparison.OrdinalIgnoreCase)) //stride folders
.Select(dir => Directory.GetDirectories(dir).Where(subdir => !subdir.EndsWith("-dev")) //exclude local build package
.OrderBy(subdir2 => subdir2, StringComparer.OrdinalIgnoreCase).LastOrDefault()); //latest version
basePath = directories.ToList();
break;
case XenkoSourceDirMode.Dev:
basePath = new List<string> { Environment.GetEnvironmentVariable(XenkoEnvironmentVariable) ?? FallbackBasePath };
//basePath = System.IO.Path.Combine(basePath, "sources", "engine", "Xenko.Engine", "Rendering");
case StrideSourceDirMode.Dev:
var strideDir = Environment.GetEnvironmentVariable(StrideEnvironmentVariable);
if (strideDir != null)
{
basePath = new List<string> { strideDir };
}
else
{
var dialog = new System.Windows.Forms.FolderBrowserDialog();
dialog.Description = "\"StrideDir\" environment variable not found. Select source repo main folder manually.";
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
basePath = new List<string> { dialog.SelectedPath };
}
//basePath = System.IO.Path.Combine(basePath, "sources", "engine", "Stride.Engine", "Rendering");
}
break;
default:
break;
Expand All @@ -91,7 +103,7 @@ internal void Refresh()
}

/// <summary>
/// Path to the Xenko installation folder.
/// Path to the Stride installation folder.
/// </summary>
public IReadOnlyList<string> Paths
{
Expand All @@ -116,7 +128,7 @@ public IReadOnlyList<string> Paths
}
}

public XenkoSourceDirMode XenkoDirMode { get; internal set; }
public StrideSourceDirMode StrideDirMode { get; internal set; }

public MainViewModel()
{
Expand Down Expand Up @@ -156,7 +168,7 @@ private static IEnumerable<Shader> ShadersInPostOrder(Shader shader)

private IEnumerable<Shader> BuildShaderTree()
{
var files = Paths.SelectMany(path => Directory.GetFiles(path, "*.xksl", SearchOption.AllDirectories));
var files = Paths.SelectMany(path => Directory.GetFiles(path, "*.sdsl", SearchOption.AllDirectories));
var shaders = new Dictionary<string, Shader>();

foreach (var file in files)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Window x:Class="XenkoShaderExplorer.MainWindow"
<Window x:Class="StrideShaderExplorer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:XenkoShaderExplorer"
xmlns:local="clr-namespace:StrideShaderExplorer"
xmlns:shb="clr-namespace:AurelienRibon.Ui.SyntaxHighlightBox;assembly=AurelienRibon.Ui.SyntaxHighlightBox"
Icon="Assets\XenkoShaderExplorerLogo.ico"
Icon="Assets\StrideShaderExplorerLogo.ico"
mc:Ignorable="d"
Title="Shader Explorer for Xenko" Height="350" Width="525"
Title="Shader Explorer for Stride" Height="350" Width="525"
WindowState="Maximized">

<Grid Background="#FF434343">
Expand All @@ -16,16 +16,16 @@
<RowDefinition/>
</Grid.RowDefinitions>

<!-- Top row: title, Xenko installation path and buttons -->
<!-- Top row: title, Stride installation path and buttons -->
<Border Grid.Row="0">
<StackPanel Margin="8">
<StackPanel Orientation="Horizontal">
<Button Content="Expand all" Click="OnExpandAllButtonClick"/>
<Button Content="Collapse all" Margin="4,0,0,0" Click="OnCollapseAllButtonClick"/>
<Button Content="Info" Margin="4,0,0,0" Click="OnInfoButtonClick"/>
<ComboBox Name="XenkoDirMode" Margin="4,0,0,0" Width="80"/>
<ComboBox Name="StrideDirMode" Margin="4,0,0,0" Width="80"/>
<TextBox Text="{Binding Path, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Delay=1000}"
ToolTip="Enter the path to a Xenko installation"
ToolTip="Enter the path to a Stride installation"
BorderThickness="0"
Foreground="#A0A0A0" Background="Transparent"
FontSize="14" FontFamily="Segoe UI Light"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Reflection;
using System.Windows;

namespace XenkoShaderExplorer
namespace StrideShaderExplorer
{
public partial class MainWindow : Window
{
Expand All @@ -15,16 +15,16 @@ public MainWindow()
{
InitializeComponent();
DataContext = ViewModel;
Title = "Shader Explorer for Xenko " + Assembly.GetEntryAssembly().GetName().Version;
Title = "Shader Explorer for Stride " + Assembly.GetEntryAssembly().GetName().Version;
codeView.CurrentHighlighter = HighlighterManager.Instance.Highlighters["XKSL"];
XenkoDirMode.ItemsSource = Enum.GetValues(typeof(XenkoSourceDirMode)).Cast<XenkoSourceDirMode>();
XenkoDirMode.SelectedIndex = 0;
XenkoDirMode.SelectionChanged += XenkoDirMode_SelectionChanged;
StrideDirMode.ItemsSource = Enum.GetValues(typeof(StrideSourceDirMode)).Cast<StrideSourceDirMode>();
StrideDirMode.SelectedIndex = 0;
StrideDirMode.SelectionChanged += StrideDirMode_SelectionChanged;
}

private void XenkoDirMode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
private void StrideDirMode_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
ViewModel.XenkoDirMode = (XenkoSourceDirMode)XenkoDirMode.SelectedIndex;
ViewModel.StrideDirMode = (StrideSourceDirMode)StrideDirMode.SelectedIndex;
ViewModel.Refresh();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("XenkoShaderExplorer")]
[assembly: AssemblyTitle("StrideShaderExplorer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XenkoShaderExplorer")]
[assembly: AssemblyProduct("StrideShaderExplorer")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6314d76

Please sign in to comment.