-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathNewProject.xaml
More file actions
190 lines (182 loc) · 13.8 KB
/
NewProject.xaml
File metadata and controls
190 lines (182 loc) · 13.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<Window x:Class="UnityLauncherPro.NewProject"
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:UnityLauncherPro"
xmlns:data="clr-namespace:UnityLauncherPro.Data"
d:DataContext="{d:DesignInstance Type=local:NewProject}"
mc:Ignorable="d"
Title="Create New Project" Height="520" Width="640" Background="{DynamicResource ThemeDarkestBackground}" PreviewKeyDown="Window_PreviewKeyDown" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" ShowInTaskbar="True">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="164"/>
</Grid.ColumnDefinitions>
<StackPanel Margin="10,3">
<Label Content="Unity Version" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,0,0,3" Padding="5,5,5,3" />
<DataGrid x:Name="gridAvailableVersions" KeyboardNavigation.TabNavigation = "None" SelectionMode="Single" Height="230" Margin="0" HeadersVisibility="None" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" Foreground="{DynamicResource ThemeButtonForeground}" Background="{DynamicResource ThemeMainBackgroundColor}" SelectionChanged="GridAvailableVersions_SelectionChanged" IsTabStop="True" TabIndex="1" Loaded="GridAvailableVersions_Loaded" EnableRowVirtualization="False" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled" PreviewMouseDoubleClick="gridAvailableVersions_PreviewMouseDoubleClick" CanUserAddRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserSortColumns="False" CanUserResizeRows="False" CanUserDeleteRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Version" Binding="{Binding Version}" IsReadOnly="True" CanUserResize="False" MinWidth="80" />
<DataGridTextColumn Header="Platforms" Binding="{Binding PlatformsCombined}" IsReadOnly="True" CanUserResize="False" MinWidth="270" />
<DataGridTextColumn Header="Release" Binding="{Binding ReleaseType}" IsReadOnly="True" CanUserResize="False" MinWidth="70" />
</DataGrid.Columns>
</DataGrid>
<Grid HorizontalAlignment="Stretch" Margin="0,20,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="35*"/>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="22*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<Label x:Name="lblNewProjectNameLabel" Grid.Column="0" Content="Project Name:" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0" Padding="0,5,5,0" />
<Label Grid.Column="1" Content="Platform:" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0" Padding="0,5,0,0" />
<Label x:Name="lblTemplateTitleAndCount" Grid.Column="2" Content="Templates:" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0" Padding="5,5,5,0" />
<Label Content="Override" x:Name="lblOverride" Grid.Column="3" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0" Padding="0,5,0,0"/>
</Grid>
<Grid HorizontalAlignment="Stretch" Margin="0,3,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="35*"/>
<ColumnDefinition Width="15*"/>
<ColumnDefinition Width="22*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" x:Name="txtNewProjectName" VerticalAlignment="Center" IsUndoEnabled="True" TextChanged="TxtNewProjectName_TextChanged" PreviewKeyDown="TxtNewProjectName_PreviewKeyDown" TabIndex="0" Margin="0,2,6,2" />
<ComboBox Grid.Column="1" x:Name="cmbNewProjectPlatform" SelectedIndex="0" Margin="0,0,0,0" TabIndex="2" DropDownOpened="CmbNewProjectPlatform_DropDownOpened" />
<ComboBox Grid.Column="2" x:Name="cmbNewProjectTemplate" DisplayMemberPath="Key" SelectedIndex="0" Margin="6,0,0,0" TabIndex="2" DropDownOpened="CmbNewProjectTemplate_DropDownOpened" />
<CheckBox Grid.Column="3" x:Name="chkForceDX11" Content="DX11" ToolTip="Use DX11 instead of DX12" Margin="6,0,0,0" IsChecked="False" Checked="chkForceDX11_Checked" Unchecked="chkForceDX11_Checked"/>
</Grid>
<Label x:Name="lblNewProjectFolderLabel" Grid.Column="0" Content="Project Root Folder:" Foreground="{DynamicResource ThemeButtonForeground}" Margin="0,8,0,0" Padding="0,5,5,0" />
<Grid HorizontalAlignment="Stretch" Margin="0,3,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="18*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBox Grid.Column="0" x:Name="txtNewProjectFolder" VerticalAlignment="Center" IsUndoEnabled="True" TextChanged="txtNewProjectFolder_TextChanged" PreviewKeyDown="TxtNewProjectName_PreviewKeyDown" TabIndex="0" Margin="0,2,6,2" />
<Button Grid.Column="1" x:Name="btnBrowseForProjectFolder" Style="{StaticResource CustomButton}" ToolTip="Browse for New Project folder" Content="..." Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="btnBrowseForProjectFolder_Click"/>
<Button Grid.Column="2" x:Name="btnCreateMissingFolder" Style="{StaticResource CustomButton}" ToolTip="Create Missing Folder from your path" Content="+" Height="22" Width="22" HorizontalAlignment="Right" VerticalAlignment="Top" FontSize="16" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="btnCreateMissingFolder_Click"/>
</Grid>
<!--<Label x:Name="lblNewProjectFolder" Content="(folder)" Foreground="{DynamicResource ThemeButtonForegroundDisabled}" Margin="0" FontSize="10" Padding="5,0,5,3" />-->
<Grid HorizontalAlignment="Stretch" Margin="0,32,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Style="{StaticResource CustomButton}" x:Name="btnCancelNewProject" Margin="0,0,3,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCancelNewProject_Click" TabIndex="4" >
<Label Content="Cancel" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"/>
</Button>
<Button Grid.Column="1" Style="{StaticResource CustomButton}" x:Name="btnCreateNewProject" Margin="3,0,0,3" BorderBrush="{x:Null}" VerticalAlignment="Top" Height="35" Click="BtnCreateNewProject_Click" TabIndex="3">
<Label Content="_Create Project" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button}, Path=Foreground}"/>
</Button>
</Grid>
<Grid Grid.Row="2" UseLayoutRounding="False">
<StatusBar VerticalAlignment="Center" Background="{x:Null}" Foreground="{DynamicResource ThemeStatusText}">
<StatusBarItem>
<TextBlock x:Name="txtNewProjectStatus" VerticalAlignment="Center" Text=""/>
</StatusBarItem>
</StatusBar>
</Grid>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="0,3,10,3" Grid.Column="1">
<StackPanel Orientation="Horizontal">
<Label Name="lblUnityOnlineTemplates" Content="Online Templates" Foreground="{DynamicResource ThemeButtonForeground}" Margin="5,0,0,3" Padding="5,5,5,3" HorizontalAlignment="Left" />
<Button Style="{StaticResource CustomButton}" ToolTip="Fetch list of templates" x:Name="btnFetchTemplates" Content="⟳" Height="22" Width="26" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="16" Margin="20,0,0,0" Padding="1,-2,1,1" BorderBrush="{x:Null}" Click="btnFetchTemplates_Click"/>
</StackPanel>
<ListBox x:Name="listOnlineTemplates" Margin="6,5,0,0" Height="411"
Background="{DynamicResource ThemeMainBackgroundColor}"
Foreground="{DynamicResource ThemeButtonForeground}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
d:ItemsSource="{d:SampleData ItemCount=4}"
PreviewMouseDown="listOnlineTemplates_PreviewMouseDown"
SelectionChanged="listOnlineTemplates_SelectionChanged">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="2"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Margin="3">
<Grid>
<Image Source="{Binding PreviewImage}"
Margin="0,0,0,5"
ToolTip="{Binding Description}"
Stretch="Uniform"
HorizontalAlignment="Stretch"/>
<Button x:Name="btnDownloadTemplate"
ToolTip="Download Template"
Content="📥"
Height="32"
Width="32"
HorizontalAlignment="Right"
VerticalAlignment="Top"
FontSize="18"
Margin="1"
Padding="0"
BorderBrush="{x:Null}"
Opacity="0.9"
Click="btnDownloadTemplate_Click"
Tag="{Binding}">
<Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource CustomButton}">
<Setter Property="Visibility" Value="Visible"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsDownloaded}" Value="True">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
<!-- Downloaded indicator badge -->
<Border Background="#CC2E7D32"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Height="32"
Width="32"
Padding="0"
Margin="1">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsDownloaded}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="✓" ToolTip="Already downloaded" FontSize="18" VerticalAlignment="Center" TextAlignment="Center" FontWeight="Bold" Foreground="White"/>
</Border>
</Grid>
<TextBlock Text="{Binding Name}"
FontWeight="Bold"
TextWrapping="Wrap"
Foreground="{DynamicResource ThemeButtonForeground}"/>
<TextBlock Text="{Binding Type}"
FontSize="10"
Foreground="{DynamicResource ThemeButtonForeground}"
Opacity="0.7"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Label x:Name="lblSelectedTemplate"
Content=""
BorderBrush="{DynamicResource ThemeGridGreenText}"
BorderThickness="0"
Foreground="{DynamicResource ThemeButtonForeground}"
Margin="6,5,0,0"
Padding="5,3,5,3"
FontSize="11"
Height="25"/>
</StackPanel>
</Grid>
</Window>