Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd3dfb03

Browse files
authored
Merge pull request#157 from SixParQuatre/MoreReleaseNotesButton
Add 'Cumulative Release Note' button
2 parents1df1105 +e9bb433 commitd3dfb03

File tree

3 files changed

+81
-23
lines changed

3 files changed

+81
-23
lines changed

‎UnityLauncherPro/MainWindow.xaml‎

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@
4848
<!-- Tab: Projects-->
4949
<TabItemHeader="Projects"Style="{DynamicResource TabItemStyle1}"Padding="0,0,0,0"Margin="-1,1,1,-1"BorderBrush="{x:Null}">
5050
<Grid>
51+
<Grid.ColumnDefinitions>
52+
<ColumnDefinitionWidth="185*"/>
53+
<ColumnDefinitionWidth="693*"/>
54+
</Grid.ColumnDefinitions>
5155
<!-- search box-->
52-
<GridBackground="{DynamicResource ThemeTextBoxBackground}"HorizontalAlignment="Left"VerticalAlignment="Top"Width="222"Margin="6,5,0,0"Height="20" >
56+
<GridBackground="{DynamicResource ThemeTextBoxBackground}"HorizontalAlignment="Left"VerticalAlignment="Top"Width="222"Margin="6,5,0,0"Height="20"Grid.ColumnSpan="2" >
5357
<!--<TextBlock Margin="3,2" MinWidth="100" Text="Search" Foreground="{DynamicResource ThemeSearchPlaceholder}" Visibility="{Binding Text.IsEmpty, Converter={StaticResource MyBoolToVisibilityConverter}, ElementName=txtSearchBox}" Height="24" />-->
5458
<TextBlockMargin="3,2"MinWidth="100"Text="Search"Foreground="{DynamicResource ThemeSearchPlaceholder}"Height="24">
5559
<TextBlock.Style>
@@ -84,10 +88,10 @@
8488
</Button>
8589
</Grid>
8690

87-
<ButtonStyle="{StaticResource CustomButton}"ToolTip="Browse and add existing project to list"x:Name="btnAddProjectFolder"Content="Add Project.."Height="22"Width="78"HorizontalAlignment="Right"VerticalAlignment="Top"Margin="0,4,38,0"Click="BtnAddProjectFolder_Click"BorderBrush="{x:Null}"TabIndex="10" />
88-
<ButtonStyle="{StaticResource CustomButton}"ToolTip="Refresh list (F5)"x:Name="btnRefreshProjectList"Content=""Height="22"Width="26"HorizontalAlignment="Right"VerticalAlignment="Top"FontSize="16"Margin="0,4,3,0"Padding="1,-2,1,1"BorderBrush="{x:Null}"Click="BtnRefreshProjectList_Click"TabIndex="11"/>
91+
<ButtonStyle="{StaticResource CustomButton}"ToolTip="Browse and add existing project to list"x:Name="btnAddProjectFolder"Content="Add Project.."Height="22"Width="78"HorizontalAlignment="Right"VerticalAlignment="Top"Margin="0,4,38,0"Click="BtnAddProjectFolder_Click"BorderBrush="{x:Null}"TabIndex="10"Grid.Column="1"/>
92+
<ButtonStyle="{StaticResource CustomButton}"ToolTip="Refresh list (F5)"x:Name="btnRefreshProjectList"Content=""Height="22"Width="26"HorizontalAlignment="Right"VerticalAlignment="Top"FontSize="16"Margin="0,4,3,0"Padding="1,-2,1,1"BorderBrush="{x:Null}"Click="BtnRefreshProjectList_Click"TabIndex="11" Grid.Column="1"/>
8993

90-
<DataGridx:Name="gridRecent"HorizontalContentAlignment="Left"VerticalContentAlignment="Top"SelectionMode="Single"Margin="4,30,2,42"CanUserAddRows="False"Background="{x:Null}"BorderBrush="{x:Null}"ColumnHeaderStyle="{StaticResource HeaderStyle}"Padding="0"HorizontalScrollBarVisibility="Disabled"HeadersVisibility="Column"Foreground="{DynamicResource ThemeGridForeground}"HorizontalGridLinesBrush="{DynamicResource ThemeDatagridLines}"VerticalGridLinesBrush="{DynamicResource ThemeGridVerticalGridLines}"AutoGenerateColumns="False"PreviewKeyDown="GridRecent_PreviewKeyDown"Loaded="GridRecent_Loaded"TabIndex="2"CellEditEnding="GridRecent_CellEditEnding"PreviewMouseDoubleClick="GridRecent_PreviewMouseDoubleClick"ContextMenuOpening="GridRecent_ContextMenuOpening"BeginningEdit="GridRecent_BeginningEdit"RowHeight="21"ColumnReordered="GridRecent_ColumnReordered"Sorting="gridRecent_Sorting" >
94+
<DataGridx:Name="gridRecent"HorizontalContentAlignment="Left"VerticalContentAlignment="Top"SelectionMode="Single"Margin="4,30,2,42"CanUserAddRows="False"Background="{x:Null}"BorderBrush="{x:Null}"ColumnHeaderStyle="{StaticResource HeaderStyle}"Padding="0"HorizontalScrollBarVisibility="Disabled"HeadersVisibility="Column"Foreground="{DynamicResource ThemeGridForeground}"HorizontalGridLinesBrush="{DynamicResource ThemeDatagridLines}"VerticalGridLinesBrush="{DynamicResource ThemeGridVerticalGridLines}"AutoGenerateColumns="False"PreviewKeyDown="GridRecent_PreviewKeyDown"Loaded="GridRecent_Loaded"TabIndex="2"CellEditEnding="GridRecent_CellEditEnding"PreviewMouseDoubleClick="GridRecent_PreviewMouseDoubleClick"ContextMenuOpening="GridRecent_ContextMenuOpening"BeginningEdit="GridRecent_BeginningEdit"RowHeight="21"ColumnReordered="GridRecent_ColumnReordered"Sorting="gridRecent_Sorting"Grid.ColumnSpan="2">
9195

9296
<DataGrid.CommandBindings>
9397
<CommandBindingCommand="ApplicationCommands.Copy"Executed="CopyRowFolderToClipBoard"CanExecute="CanExecute_Copy"/>
@@ -241,7 +245,7 @@
241245
</DataGrid>
242246

243247
<!-- bottom buttoms row-->
244-
<GridVerticalAlignment="Bottom"Margin="4,0,8,5">
248+
<GridVerticalAlignment="Bottom"Margin="4,0,8,5" Grid.ColumnSpan="2">
245249
<Grid.ColumnDefinitions>
246250
<ColumnDefinitionWidth="14*" />
247251
<ColumnDefinitionWidth="17*" />
@@ -492,7 +496,8 @@
492496
<ColumnDefinitionWidth="20*" />
493497
<ColumnDefinitionWidth="18*" />
494498
<ColumnDefinitionWidth="28*" />
495-
<ColumnDefinitionWidth="26*" />
499+
<ColumnDefinitionWidth="14*" />
500+
<ColumnDefinitionWidth="18*" />
496501
</Grid.ColumnDefinitions>
497502
<Grid.RowDefinitions>
498503
<RowDefinitionHeight="32" />
@@ -507,7 +512,10 @@
507512
<LabelContent="Download&amp; Install"Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
508513
</Button>
509514
<Button Grid.Column="3"Style="{StaticResource CustomButton}"x:Name="btnOpenWebsite"Margin="5,0,0,0"BorderBrush="{x:Null}"Click="BtnOpenWebsite_Click" >
510-
<LabelContent="Release _Notes"Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Control}}}" />
515+
<LabelContent="Release Notes"Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Control}, Mode=FindAncestor}}" />
516+
</Button>
517+
<Button Grid.Column="4"Style="{StaticResource CustomButton}"x:Name="btnShowCumulatedReleaseNotes"Margin="5,0,0,0"BorderBrush="{x:Null}"Click="BtnShowCumulatedReleaseNotes_Click"ToolTip="Show all Release Notes between the selected version and the older, closest one installed. Only works for final and patch versions." >
518+
<LabelContent="Cumulative Release Notes"Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType={x:Type Control}, Mode=FindAncestor}}" />
511519
</Button>
512520
</Grid>
513521
</Grid>
@@ -791,7 +799,7 @@
791799
<CheckBoxx:Name="chkQuitAfterOpen"Content="Close after opening project"Checked="ChkQuitAfterOpen_CheckedChanged"Unchecked="ChkQuitAfterOpen_CheckedChanged"ToolTip="Closes launcher after running project (not really useful)"HorizontalAlignment="Left"/>
792800
<CheckBoxx:Name="chkQuitAfterCommandline"Content="Close after launching from Explorer"Unchecked="ChkQuitAfterCommandline_CheckedChanged"Checked="ChkQuitAfterCommandline_CheckedChanged"ToolTip="Close launcher after running from commandline or Explorer (recommended)"HorizontalAlignment="Left"/>
793801
<CheckBoxx:Name="chkAllowSingleInstanceOnly"Content="Allow single instance only"Checked="ChkAllowSingleInstanceOnly_CheckedChanged"Unchecked="ChkAllowSingleInstanceOnly_CheckedChanged"ToolTip="Activates already running instance, instead of starting new exe (not working if app is minized to taskbar)"HorizontalAlignment="Left"/>
794-
<CheckBoxx:Name="useAlphaReleaseNotesSite"Content="Use Unity Alpha Release Notes Site (Unity 6 not supported)"ToolTip="Use the superior (but alpha) Unity Release Notes (https://alpha.release-notes.ds.unity3d.com/) site when clicking on the ReleaseNotes button. Otherwise will default to the normal build page."Checked="UseAlphaReleaseNotes_Checked"Unchecked="UseAlphaReleaseNotes_Checked"/>
802+
<CheckBoxx:Name="useAlphaReleaseNotesSite"Content="Use Unity Alpha Release Notes Site (only for final versions)"ToolTip="Use the superior (but alpha) Unity Release Notes (https://alpha.release-notes.ds.unity3d.com/) site when clicking on the ReleaseNotes button. Otherwise will default to the normal build page."Checked="UseAlphaReleaseNotes_Checked"Unchecked="UseAlphaReleaseNotes_Checked"/>
795803
<CheckBoxx:Name="chkStreamerMode"Content="Streamer Mode (hide project names and folders)"ToolTip="Hide project names and folders in main view"Checked="ChkStreamerMode_Checked"Unchecked="ChkStreamerMode_Checked"HorizontalAlignment="Left"/>
796804
<!--<StackPanel Orientation="Horizontal" Margin="0,0,0,4">
797805
<TextBox x:Name="txtTemplatePackagesFolder" BorderBrush="Transparent" CaretBrush="{DynamicResource ThemeSearchCaret}" Background="{DynamicResource ThemeTextBoxBackground}" SelectionBrush="{DynamicResource ThemeSearchSelection}" Foreground="{DynamicResource ThemeSearchForeground}" ToolTip="Folder for your custom unitypackage templates (for new project)" Padding="0,3,0,0" Width="110" TextChanged="TxtTemplatePackagesFolder_TextChanged" />

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public partial class MainWindow : Window
4646
System.Windows.Forms.NotifyIconnotifyIcon;
4747

4848
Updates[]updatesSource;
49-
publicstaticList<string>updatesAsStrings;
49+
publicstaticList<string>updatesAsStrings=newList<string>();
5050

5151
string_filterString=null;
5252
boolmultiWordSearch=false;
@@ -140,6 +140,7 @@ void Start()
140140

141141
// clear updates grid
142142
dataGridUpdates.Items.Clear();
143+
dataGridUpdates.SelectionChanged+=DataGridUpdates_SelectionChanged;
143144

144145
// clear buildreport grids
145146
gridBuildReport.Items.Clear();
@@ -177,6 +178,18 @@ void Start()
177178
isInitializing=false;
178179
}
179180

181+
privatevoidDataGridUpdates_SelectionChanged(objectsender,SelectionChangedEventArgse)
182+
{
183+
varselectedUp=GetSelectedUpdate();
184+
boolshowCumulative=false;
185+
if(selectedUp!=null)
186+
{
187+
varunityVer=GetSelectedUpdate().Version;
188+
showCumulative=Tools.HasAlphaReleaseNotes(unityVer);
189+
}
190+
btnShowCumulatedReleaseNotes.IsEnabled=showCumulative;
191+
}
192+
180193
// bring old window to front, but needs matching appname.. https://stackoverflow.com/a/36804161/5452781
181194
privatestaticvoidActivateOtherWindow()
182195
{
@@ -1543,6 +1556,12 @@ private void BtnOpenWebsite_Click(object sender, RoutedEventArgs e)
15431556
Tools.OpenReleaseNotes(unity?.Version);
15441557
}
15451558

1559+
privatevoidBtnShowCumulatedReleaseNotes_Click(objectsender,RoutedEventArgse)
1560+
{
1561+
varunity=GetSelectedUpdate();
1562+
Tools.OpenReleaseNotes_Cumulative(unity?.Version);
1563+
}
1564+
15461565
privatevoidChkMinimizeToTaskbar_CheckedChanged(objectsender,RoutedEventArgse)
15471566
{
15481567
if(this.IsActive==false)return;// dont run code on window init

‎UnityLauncherPro/Tools.cs‎

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -590,28 +590,25 @@ public static bool VersionIsAlpha(string version)
590590

591591
publicstaticboolVersionIsChinese(stringversion)
592592
{
593-
returnversion.Contains("c1");
593+
returnversion.Contains("c1");
594594
}
595595

596+
597+
//as of 21 May 2021, only final 'f' versions are now available on the alpha release notes for Unity 2018 and newer. 2017 and 5 still have patch 'p' versions as well.
598+
publicstaticboolHasAlphaReleaseNotes(stringversion)=>VersionIsArchived(version)||VersionIsPatch(version);
599+
600+
publicstaticstringGetAlphaReleaseNotesURL(stringfromVersion,stringtoVersion=null)
601+
=>"https://alpha.release-notes.ds.unity3d.com/search?fromVersion="+fromVersion+"&toVersion="+(toVersion!=null?toVersion:fromVersion);
602+
596603
// open release notes page in browser
597604
publicstaticboolOpenReleaseNotes(stringversion)
598605
{
599606
boolresult=false;
600607
if(string.IsNullOrEmpty(version))returnfalse;
601-
602-
//var url = Tools.GetUnityReleaseURL(version);
603608
stringurl=null;
604-
boolnoAlphaReleaseNotesPage=version.Contains("6000")&&!version.Contains("f");
605-
if(Properties.Settings.Default.useAlphaReleaseNotes&&!noAlphaReleaseNotesPage)
609+
if(Properties.Settings.Default.useAlphaReleaseNotes&&HasAlphaReleaseNotes(version))
606610
{
607-
//with the alpha release notes, we want a diff between the 2 versions, but the site just shows all the changes inclusive of from
608-
// so we need to compare the currently selected version to the one right after it that is available (installed or not)
609-
610-
varclosestVersion=Tools.FindNearestVersion(version,MainWindow.unityInstalledVersions.Keys.ToList(),true);
611-
vargetNextVersionToClosest=closestVersion==null?null:Tools.FindNearestVersion(version,MainWindow.updatesAsStrings);
612-
if(getNextVersionToClosest==null)getNextVersionToClosest=version;
613-
614-
url="https://alpha.release-notes.ds.unity3d.com/search?fromVersion="+getNextVersionToClosest+"&toVersion="+version;
611+
url=GetAlphaReleaseNotesURL(version);
615612
}
616613
else
617614
{
@@ -624,6 +621,36 @@ public static bool OpenReleaseNotes(string version)
624621
returnresult;
625622
}
626623

624+
publicstaticboolOpenReleaseNotes_Cumulative(stringversion)
625+
{
626+
boolresult=false;
627+
if(string.IsNullOrEmpty(version))returnfalse;
628+
629+
stringurl=null;
630+
varcomparisonVersion=version;
631+
//with the alpha release notes, we want a diff between an installed version and the one selected, but the site just shows all the changes inclusive of "fromVersion=vers"
632+
//so if we find a good installed candidate, we need the version just above it (installed or not) that has release notes page
633+
varclosestInstalledVersion=Tools.FindNearestVersion(version,MainWindow.unityInstalledVersions.Keys.ToList(),true);
634+
if(closestInstalledVersion!=null)
635+
{
636+
comparisonVersion=closestInstalledVersion;
637+
stringnextFinalVersionAfterInstalled=closestInstalledVersion;
638+
639+
//wwe need a loop here, to find the nearest final version. It might be better to warn the user about this before opening the page.
640+
do
641+
nextFinalVersionAfterInstalled=Tools.FindNearestVersion(nextFinalVersionAfterInstalled,MainWindow.updatesAsStrings);
642+
while(nextFinalVersionAfterInstalled!=null&&!HasAlphaReleaseNotes(nextFinalVersionAfterInstalled));
643+
644+
if(nextFinalVersionAfterInstalled!=null)comparisonVersion=nextFinalVersionAfterInstalled;
645+
646+
}
647+
url=GetAlphaReleaseNotesURL(comparisonVersion,version);
648+
649+
OpenURL(url);
650+
result=true;
651+
returnresult;
652+
}
653+
627654
publicstaticvoidOpenURL(stringurl)
628655
{
629656
Process.Start(url);
@@ -1047,10 +1074,14 @@ private static string FetchUnityVersionNumberFromHTML(string url)
10471074

10481075
publicstaticstringFindNearestVersion(stringcurrentVersion,List<string>allAvailable,boolcheckBelow=false)
10491076
{
1077+
if(allAvailable==null)
1078+
returnnull;
1079+
10501080
stringresult=null;
10511081

10521082
// add current version to list, to sort it with others
1053-
allAvailable.Add(currentVersion);
1083+
if(!allAvailable.Contains(currentVersion))
1084+
allAvailable.Add(currentVersion);
10541085

10551086
// sort list
10561087
if(checkBelow)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp