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

Commitfd47430

Browse files
committed
add setting for using unoffical releases list
1 parenta870bb8 commitfd47430

File tree

5 files changed

+42
-16
lines changed

5 files changed

+42
-16
lines changed

‎UnityLauncherPro/GetUnityUpdates.cs‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,29 @@ public static class GetUnityUpdates
1919

2020
staticDictionary<string,string>unofficialReleaseURLs=newDictionary<string,string>();
2121

22-
publicstaticasyncTask<List<UnityVersion>>FetchAll()
22+
publicstaticasyncTask<List<UnityVersion>>FetchAll(booluseUnofficialList=false)
2323
{
2424
varcachedVersions=LoadCachedVersions();
2525
varnewVersions=awaitFetchNewVersions(cachedVersions);
2626

27-
varunofficialVersions=awaitFetchUnofficialVersions(cachedVersions);
27+
varallVersions=newVersions.Concat(cachedVersions).ToList();
2828

29-
unofficialReleaseURLs.Clear();
30-
// TODO modify FetchUnofficialVersions to put items in this dictionary directly
31-
foreach(varversioninunofficialVersions)
29+
if(useUnofficialList==true)
3230
{
33-
//Console.WriteLine("unofficial: " + version.Version + " , " + version.directURL);
34-
if(unofficialReleaseURLs.ContainsKey(version.Version)==false)
31+
varunofficialVersions=awaitFetchUnofficialVersions(cachedVersions);
32+
unofficialReleaseURLs.Clear();
33+
// TODO modify FetchUnofficialVersions to put items in this dictionary directlys
34+
foreach(varversioninunofficialVersions)
3535
{
36-
unofficialReleaseURLs.Add(version.Version,version.directURL);
36+
//Console.WriteLine("unofficial: " + version.Version + " , " + version.directURL);
37+
if(unofficialReleaseURLs.ContainsKey(version.Version)==false)
38+
{
39+
unofficialReleaseURLs.Add(version.Version,version.directURL);
40+
}
3741
}
42+
allVersions=unofficialVersions.Concat(allVersions).ToList();
3843
}
3944

40-
varallVersions=newVersions.Concat(unofficialVersions).Concat(cachedVersions).ToList();
41-
//var allVersions = newVersions.Concat(cachedVersions).ToList();
42-
43-
// TODO save unofficial versions to cache also? or maybe not, they will appear in official list later
4445
if(newVersions.Count>0)
4546
{
4647
SaveCachedVersions(allVersions);
@@ -168,9 +169,9 @@ private static async Task<string> ExtractDownloadUrlAsync(string json, string un
168169
Console.WriteLine("Unofficial release found in the list.");
169170

170171
stringunityHash=ParseHashCodeFromURL(unofficialReleaseURLs[unityVersion]);
171-
// Console.WriteLine(unityHash);
172+
// Console.WriteLine(unityHash);
172173
stringdownloadURL=Tools.ParseDownloadURLFromWebpage(unityVersion,unityHash,false,true);
173-
// Console.WriteLine("direct download url: "+downloadURL);
174+
// Console.WriteLine("direct download url: "+downloadURL);
174175
returndownloadURL;
175176
}
176177

‎UnityLauncherPro/MainWindow.xaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,7 @@
810810
<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"/>
811811
<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"/>
812812
<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"/>
813+
<CheckBoxx:Name="useUnofficialReleaseList"Content="Use Unofficial Release Watch List (for latest downloads)"ToolTip="Checks latest releases from https://github.com/unitycoder/UnofficialUnityReleasesWatcher (if not yet available in The Unity Releases API)"Checked="useUnofficialReleaseList_Checked"Unchecked="useUnofficialReleaseList_Checked"/>
813814
<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"/>
814815
<!--<StackPanel Orientation="Horizontal" Margin="0,0,0,4">
815816
<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: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ void LoadSettings()
459459
txtWebglRelativePath.Text=Settings.Default.webglBuildPath;
460460
txtCustomThemeFile.Text=Settings.Default.themeFile;
461461
useAlphaReleaseNotesSite.IsChecked=Settings.Default.useAlphaReleaseNotes;
462+
useUnofficialReleaseList.IsChecked=Settings.Default.useUnofficialReleaseList;
462463

463464
chkEnablePlatformSelection.IsChecked=Settings.Default.enablePlatformSelection;
464465
chkRunAutomatically.IsChecked=Settings.Default.runAutomatically;
@@ -783,7 +784,7 @@ void AddUnityInstallationRootFolder()
783784
asyncTaskCallGetUnityUpdates()
784785
{
785786
dataGridUpdates.ItemsSource=null;
786-
vartask=GetUnityUpdates.FetchAll();
787+
vartask=GetUnityUpdates.FetchAll((bool)useUnofficialReleaseList.IsChecked);
787788
varitems=awaittask;
788789
updatesSource=items.ToArray();
789790
if(updatesSource==null)return;
@@ -1105,7 +1106,7 @@ private async void OnTabSelectionChanged(object sender, SelectionChangedEventArg
11051106
// if we dont have previous results yet, TODO scan again if previous was 24hrs ago
11061107
if(updatesSource==null)
11071108
{
1108-
vartask=GetUnityUpdates.FetchAll();
1109+
vartask=GetUnityUpdates.FetchAll((bool)useUnofficialReleaseList.IsChecked);
11091110
varitems=awaittask;
11101111
if(task.IsCompleted==false||task.IsFaulted==true)return;
11111112
if(items==null)return;
@@ -3832,6 +3833,14 @@ private void chkCheckSRP_Checked(object sender, RoutedEventArgs e)
38323833
Settings.Default.Save();
38333834
RefreshRecentProjects();
38343835
}
3836+
3837+
privatevoiduseUnofficialReleaseList_Checked(objectsender,RoutedEventArgse)
3838+
{
3839+
if(this.IsActive==false)return;// dont run code on window init
3840+
3841+
Settings.Default.useUnofficialReleaseList=(bool)useUnofficialReleaseList.IsChecked;
3842+
Settings.Default.Save();
3843+
}
38353844
//private void menuProjectProperties_Click(object sender, RoutedEventArgs e)
38363845
//{
38373846
// var proj = GetSelectedProject();

‎UnityLauncherPro/Properties/Settings.Designer.cs‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎UnityLauncherPro/Properties/Settings.settings‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,8 @@
148148
<SettingName="checkSRP"Type="System.Boolean"Scope="User">
149149
<ValueProfile="(Default)">False</Value>
150150
</Setting>
151+
<SettingName="useUnofficialReleaseList"Type="System.Boolean"Scope="User">
152+
<ValueProfile="(Default)">False</Value>
153+
</Setting>
151154
</Settings>
152155
</SettingsFile>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp